Ignore:
Timestamp:
2016-07-04T14:18:17+02:00 (10 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java

    r32425 r32556  
    1 // License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
     1// License: GPL. For details, see LICENSE file.
    22package cadastre_fr;
    33
     
    106106
    107107        // convert SVG nodes to eastNorth coordinates
    108         for (int i=0; i< SVGpaths.length; i++) {
     108        for (int i = 0; i < SVGpaths.length; i++) {
    109109            ArrayList<EastNorth> eastNorth = new ArrayList<>();
    110110            createNodes(SVGpaths[i], eastNorth);
     
    147147                for (Way w : svgDataSet.getWays()) {
    148148                    int replaced = 0;
    149                     for (Node node : w.getNodes())
     149                    for (Node node : w.getNodes()) {
    150150                        if (node == n) {
    151151                            node = nearestNewNode;
    152152                            replaced++;
    153153                        }
     154                    }
    154155                    if (w.getNodesCount() == replaced)
    155156                        w.setDeleted(true);
     
    161162
    162163        Collection<Command> cmds = new LinkedList<>();
    163         for (Node node : svgDataSet.getNodes())
     164        for (Node node : svgDataSet.getNodes()) {
    164165            if (!node.isDeleted())
    165166                cmds.add(new AddCommand(node));
    166         for (Way way : svgDataSet.getWays())
     167        }
     168        for (Way way : svgDataSet.getWays()) {
    167169            if (!way.isDeleted())
    168170                cmds.add(new AddCommand(way));
     171        }
    169172        Main.main.undoRedo.add(new SequenceCommand(tr("Create buildings"), cmds));
    170173        Main.map.repaint();
     
    176179        double dx = Double.parseDouble(coor[1]);
    177180        double dy = Double.parseDouble(coor[2]);
    178         for (int i=3; i<coor.length; i+=2){
     181        for (int i = 3; i < coor.length; i += 2) {
    179182            if (coor[i].isEmpty()) {
    180183                eastNorth.clear(); // some paths are just artifacts
    181184                return;
    182185            }
    183             double east = dx+=Double.parseDouble(coor[i]);
    184             double north = dy+=Double.parseDouble(coor[i+1]);
    185             eastNorth.add(new EastNorth(east,north));
     186            double east = dx += Double.parseDouble(coor[i]);
     187            double north = dy += Double.parseDouble(coor[i+1]);
     188            eastNorth.add(new EastNorth(east, north));
    186189        }
    187190        // flip the image (svg using a reversed Y coordinate system)
     
    240243
    241244    private String grabSVG(URL url) throws IOException, OsmTransferException {
    242         wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
     245        wmsInterface.urlConn = (HttpURLConnection) url.openConnection();
    243246        wmsInterface.urlConn.setRequestProperty("Connection", "close");
    244247        wmsInterface.urlConn.setRequestMethod("GET");
     
    253256                 BufferedReader br = new BufferedReader(isr)) {
    254257                String line;
    255                 while ( null!=(line=br.readLine())){
     258                while (null != (line = br.readLine())) {
    256259                    line += "\n";
    257260                    bos.write(line.getBytes(StandardCharsets.UTF_8));
Note: See TracChangeset for help on using the changeset viewer.