Ignore:
Timestamp:
2015-07-05T02:25:58+02:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle

Location:
trunk/src/org/openstreetmap/josm/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r8569 r8570  
    110110        }
    111111
    112         private final String getTypeString() {
     112        private String getTypeString() {
    113113            return typeString;
    114114        }
     
    124124    }
    125125
    126     private class SelectLayerDialog extends ExtendedDialog {
     126    private final class SelectLayerDialog extends ExtendedDialog {
    127127        private Layer[] layers;
    128128        private JList<String> list;
     
    133133            this.list = new JList<>(getLayerNames(layers));
    134134            this.list.setPreferredSize(new Dimension(400, 400));
    135             this.list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION) ;
     135            this.list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    136136            JPanel panel = new JPanel(new GridBagLayout());
    137137            panel.add(this.list, GBC.eol().fill());
     
    141141        private String[] getLayerNames(Collection<Layer> layers) {
    142142            Collection<String> ret = new ArrayList<>();
    143             for(Layer layer: layers) {
     143            for (Layer layer: layers) {
    144144                ret.add(layer.name);
    145145            }
     
    167167     * Creates a tile source based on imagery info
    168168     * @param info imagery info
    169      * @throws IOException
     169     * @throws IOException if any I/O error occurs
    170170     */
    171171    public WMTSTileSource(ImageryInfo info) throws IOException {
     
    189189        initProjection();
    190190    }
    191 
    192 
    193191
    194192    private String handleTemplate(String url) {
     
    222220            }
    223221            Document document = builder.parse(new ByteArrayInputStream(data));
    224             Node getTileOperation = getByXpath(document, "/Capabilities/OperationsMetadata/Operation[@name=\"GetTile\"]/DCP/HTTP/Get").item(0);
     222            Node getTileOperation = getByXpath(document,
     223                    "/Capabilities/OperationsMetadata/Operation[@name=\"GetTile\"]/DCP/HTTP/Get").item(0);
    225224            this.baseUrl = getStringByXpath(getTileOperation, "@href");
    226             this.transferMode = TransferMode.fromString(getStringByXpath(getTileOperation, "Constraint[@name=\"GetEncoding\"]/AllowedValues/Value"));
     225            this.transferMode = TransferMode.fromString(getStringByXpath(getTileOperation,
     226                    "Constraint[@name=\"GetEncoding\"]/AllowedValues/Value"));
    227227            NodeList layersNodeList = getByXpath(document, "/Capabilities/Contents/Layer");
    228228            Map<String, TileMatrixSet> matrixSetById = parseMatrices(getByXpath(document, "/Capabilities/Contents/TileMatrixSet"));
     
    231231        } catch (Exception e) {
    232232            Main.error(e);
    233             //Main.error(new String(data, "UTF-8"));
    234233        }
    235234        return null;
     
    242241    }
    243242
    244     private final Collection<Layer> parseLayer(NodeList nodeList, Map<String, TileMatrixSet> matrixSetById) throws XPathExpressionException {
     243    private Collection<Layer> parseLayer(NodeList nodeList, Map<String, TileMatrixSet> matrixSetById) throws XPathExpressionException {
    245244        Collection<Layer> ret = new ArrayList<>();
    246245        for (int layerId = 0; layerId < nodeList.getLength(); layerId++) {
     
    262261    }
    263262
    264     private final Map<String, TileMatrixSet> parseMatrices(NodeList nodeList) throws DOMException, XPathExpressionException {
     263    private Map<String, TileMatrixSet> parseMatrices(NodeList nodeList) throws DOMException, XPathExpressionException {
    265264        Map<String, TileMatrixSet> ret = new ConcurrentHashMap<>();
    266265        for (int matrixSetId = 0; matrixSetId < nodeList.getLength(); matrixSetId++) {
     
    292291
    293292    private static String crsToCode(String crsIdentifier) {
    294         if(crsIdentifier.startsWith("urn:ogc:def:crs:")) {
     293        if (crsIdentifier.startsWith("urn:ogc:def:crs:")) {
    295294            return crsIdentifier.replaceFirst("urn:ogc:def:crs:([^:]*):[^:]*:(.*)$", "$1:$2");
    296295        }
    297296        return crsIdentifier;
    298297    }
     298
    299299    private static String getStringByXpath(Node document, String xpathQuery) throws XPathExpressionException {
    300300        return (String) getByXpath(document, xpathQuery, XPathConstants.STRING);
     
    304304        return (NodeList) getByXpath(document, xpathQuery, XPathConstants.NODESET);
    305305    }
    306 
    307306
    308307    private static Object getByXpath(Node document, String xpathQuery, QName returnType) throws XPathExpressionException {
     
    325324    public void initProjection(Projection proj) {
    326325        this.currentTileMatrixSet = currentLayer.tileMatrixSetByCRS.get(proj.toCode());
    327         if(this.currentTileMatrixSet == null) {
     326        if (this.currentTileMatrixSet == null) {
    328327            Main.warn("Unsupported CRS selected");
    329328            // take first, maybe it will work (if user sets custom projections, codes will not match)
    330329            this.currentTileMatrixSet = currentLayer.tileMatrixSetByCRS.values().iterator().next();
    331330        }
    332         this.crsScale = getTileSize() * 0.28e-03 / proj.getMetersPerUnit() ;
     331        this.crsScale = getTileSize() * 0.28e-03 / proj.getMetersPerUnit();
    333332    }
    334333
     
    381380    /**
    382381     *
    383      * @param zoom
     382     * @param zoom zoom level
    384383     * @return TileMatrix that's working on this zoom level
    385384     */
     
    423422        throw new UnsupportedOperationException("Not implemented");
    424423    }
    425 
    426424
    427425    @Override
     
    513511    public Coordinate XYToLatLon(int x, int y, int zoom) {
    514512        TileMatrix matrix = getTileMatrix(zoom);
    515         if (matrix == null ){
     513        if (matrix == null) {
    516514            return new Coordinate(0, 0);
    517515        }
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r8568 r8570  
    3636public class CustomProjection extends AbstractProjection {
    3737
    38     private final static Map<String, Double> UNITS_TO_METERS = getUnitsToMeters();
    39     private final static double METER_PER_UNIT_DEGREE = 2 * Math.PI * 6370997 / 360;
     38    private static final Map<String, Double> UNITS_TO_METERS = getUnitsToMeters();
     39    private static final double METER_PER_UNIT_DEGREE = 2 * Math.PI * 6370997 / 360;
    4040
    4141    /**
Note: See TracChangeset for help on using the changeset viewer.