Changeset 30737 in osm for applications/editors/josm/plugins/cadastre-fr/src
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java
r29801 r30737 131 131 MapView mv = Main.map.mapView; 132 132 Point mousePos = e.getPoint(); 133 List<Way> mouseOnExistingWays = new ArrayList< Way>();134 List<Way> mouseOnExistingBuildingWays = new ArrayList< Way>();135 mouseOnExistingWays = new ArrayList< Way>();133 List<Way> mouseOnExistingWays = new ArrayList<>(); 134 List<Way> mouseOnExistingBuildingWays = new ArrayList<>(); 135 mouseOnExistingWays = new ArrayList<>(); 136 136 Node currentMouseNode = mv.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate); 137 137 if (currentMouseNode != null) { … … 144 144 && !inputStreet.getText().equals("")) { 145 145 // house number already present but not linked to a street 146 Collection<Command> cmds = new LinkedList< Command>();146 Collection<Command> cmds = new LinkedList<>(); 147 147 addStreetNameOrRelation(currentMouseNode, cmds); 148 148 Command c = new SequenceCommand("Add node address", cmds); … … 164 164 inputStreet.setText(currentMouseNode.get(tagHouseStreet)); 165 165 if (ctrl) { 166 Collection<Command> cmds = new LinkedList< Command>();166 Collection<Command> cmds = new LinkedList<>(); 167 167 addAddrToPrimitive(currentMouseNode, cmds); 168 168 if (num == null) … … 179 179 applyInputNumberChange(); 180 180 } 181 Collection<Command> cmds = new LinkedList< Command>();181 Collection<Command> cmds = new LinkedList<>(); 182 182 addAddrToPrimitive(currentMouseNode, cmds); 183 183 } else { … … 206 206 Toolkit.getDefaultToolkit().beep(); 207 207 } else { 208 Collection<Command> cmds = new LinkedList< Command>();208 Collection<Command> cmds = new LinkedList<>(); 209 209 if (ctrl) { 210 210 applyInputNumberChange(); … … 305 305 cmds.add(new AddCommand(n)); 306 306 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments(e.getPoint(), OsmPrimitive.isSelectablePredicate); 307 Map<Way, List<Integer>> insertPoints = new HashMap< Way, List<Integer>>();307 Map<Way, List<Integer>> insertPoints = new HashMap<>(); 308 308 for (WaySegment ws : wss) { 309 309 List<Integer> is; … … 311 311 is = insertPoints.get(ws.way); 312 312 } else { 313 is = new ArrayList< Integer>();313 is = new ArrayList<>(); 314 314 insertPoints.put(ws.way, is); 315 315 } … … 317 317 is.add(ws.lowerIndex); 318 318 } 319 Set<Pair<Node,Node>> segSet = new HashSet< Pair<Node,Node>>();320 ArrayList<Way> replacedWays = new ArrayList< Way>();321 ArrayList<Way> reuseWays = new ArrayList< Way>();319 Set<Pair<Node,Node>> segSet = new HashSet<>(); 320 ArrayList<Way> replacedWays = new ArrayList<>(); 321 ArrayList<Way> reuseWays = new ArrayList<>(); 322 322 for (Map.Entry<Way, List<Integer>> insertPoint : insertPoints.entrySet()) { 323 323 Way w = insertPoint.getKey(); … … 326 326 pruneSuccsAndReverse(is); 327 327 for (int i : is) { 328 segSet.add(Pair.sort(new Pair< Node,Node>(w.getNode(i), w.getNode(i+1))));328 segSet.add(Pair.sort(new Pair<>(w.getNode(i), w.getNode(i+1)))); 329 329 } 330 330 for (int i : is) { … … 403 403 //if (is.size() < 2) return; 404 404 405 HashSet<Integer> is2 = new HashSet< Integer>();405 HashSet<Integer> is2 = new HashSet<>(); 406 406 for (int i : is) { 407 407 if (!is2.contains(i - 1) && !is2.contains(i + 1)) { … … 541 541 542 542 private void setNewSelection(OsmPrimitive osm) { 543 Collection<OsmPrimitive> newSelection = new LinkedList< OsmPrimitive>(Main.main.getCurrentDataSet().getSelected());543 Collection<OsmPrimitive> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelected()); 544 544 newSelection.clear(); 545 545 newSelection.add(osm); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
r29922 r30737 44 44 public WMSLayer wmsLayer = null; 45 45 46 private ArrayList<GeorefImage> imagesToSave = new ArrayList< GeorefImage>();46 private ArrayList<GeorefImage> imagesToSave = new ArrayList<>(); 47 47 private Lock imagesLock = new ReentrantLock(); 48 48 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r30701 r30737 33 33 private String lastWMSLayerName = null; 34 34 private URL searchFormURL; 35 private Vector<String> listOfCommunes = new Vector< String>();36 private Vector<String> listOfTA = new Vector< String>();35 private Vector<String> listOfCommunes = new Vector<>(); 36 private Vector<String> listOfTA = new Vector<>(); 37 37 class PlanImage { 38 38 String name; … … 43 43 } 44 44 } 45 private Vector<PlanImage> listOfFeuilles = new Vector< PlanImage>();45 private Vector<PlanImage> listOfFeuilles = new Vector<>(); 46 46 private long cookieTimestamp; 47 47 … … 435 435 private int selectFeuilleDialog() { 436 436 JPanel p = new JPanel(new GridBagLayout()); 437 Vector<String> imageNames = new Vector< String>();437 Vector<String> imageNames = new Vector<>(); 438 438 for (PlanImage src : listOfFeuilles) { 439 439 imageNames.add(src.name); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r29922 r30737 422 422 zone = code - 27561; 423 423 } else { // UTM_France_DOM 424 Map<Integer, Integer> utmfr = new HashMap< Integer, Integer>();424 Map<Integer, Integer> utmfr = new HashMap<>(); 425 425 utmfr.put(2969, 0); 426 426 utmfr.put(2970, 1); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
r30532 r30737 39 39 { 40 40 if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !apiDataSet.getPrimitivesToAdd().isEmpty()) { 41 Collection<OsmPrimitive> sel = new HashSet< OsmPrimitive>();41 Collection<OsmPrimitive> sel = new HashSet<>(); 42 42 for (OsmPrimitive osm : apiDataSet.getPrimitivesToAdd()) { 43 43 if ((osm instanceof Way && (osm.getKeys().size() == 0 || !tagSourceExist(osm))) -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r29854 r30737 99 99 private void createBuildings(String svg) { 100 100 String[] SVGpaths = new SVGParser().getClosedPaths(svg); 101 ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList< ArrayList<EastNorth>>();101 ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<>(); 102 102 103 103 // convert SVG nodes to eastNorth coordinates 104 104 for (int i=0; i< SVGpaths.length; i++) { 105 ArrayList<EastNorth> eastNorth = new ArrayList< EastNorth>();105 ArrayList<EastNorth> eastNorth = new ArrayList<>(); 106 106 createNodes(SVGpaths[i], eastNorth); 107 107 if (eastNorth.size() > 2) … … 156 156 } 157 157 158 Collection<Command> cmds = new LinkedList< Command>();158 Collection<Command> cmds = new LinkedList<>(); 159 159 for (Node node : svgDataSet.getNodes()) 160 160 if (!node.isDeleted()) -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r29854 r30737 104 104 private void createWay(String svg) { 105 105 String[] SVGpaths = new SVGParser().getClosedPaths(svg); 106 ArrayList<Double> fitViewBox = new ArrayList< Double>();107 ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList< ArrayList<EastNorth>>();106 ArrayList<Double> fitViewBox = new ArrayList<>(); 107 ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<>(); 108 108 for (int i=0; i< SVGpaths.length; i++) { 109 ArrayList<EastNorth> eastNorth = new ArrayList< EastNorth>();109 ArrayList<EastNorth> eastNorth = new ArrayList<>(); 110 110 fitViewBox.add( createNodes(SVGpaths[i], eastNorth) ); 111 111 eastNorths.add(eastNorth); … … 114 114 Double min = Collections.min(fitViewBox); 115 115 int bestPath = fitViewBox.indexOf(min); 116 List<Node> nodeList = new ArrayList< Node>();116 List<Node> nodeList = new ArrayList<>(); 117 117 for (EastNorth eastNorth : eastNorths.get(bestPath)) { 118 118 nodeList.add(new Node(Main.getProjection().eastNorth2latlon(eastNorth))); 119 119 } 120 120 Way wayToAdd = new Way(); 121 Collection<Command> cmds = new LinkedList< Command>();121 Collection<Command> cmds = new LinkedList<>(); 122 122 for (Node node : nodeList) { 123 123 cmds.add(new AddCommand(node)); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java
r26524 r30737 25 25 private Lock lockImagesToGrag = new ReentrantLock(); 26 26 27 private ArrayList<EastNorthBound> imagesToGrab = new ArrayList< EastNorthBound>();27 private ArrayList<EastNorthBound> imagesToGrab = new ArrayList<>(); 28 28 29 29 private CacheControl cacheControl = null; … … 58 58 59 59 public ArrayList<EastNorthBound> getImagesToGrabCopy() { 60 ArrayList<EastNorthBound> copyList = new ArrayList< EastNorthBound>();60 ArrayList<EastNorthBound> copyList = new ArrayList<>(); 61 61 lockImagesToGrag.lock(); 62 62 for (EastNorthBound img : imagesToGrab) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SVGParser.java
r18544 r30737 47 47 */ 48 48 public String [] getClosedPaths(String svg) { 49 ArrayList<String> path = new ArrayList< String>();49 ArrayList<String> path = new ArrayList<>(); 50 50 int i = 0; 51 51 while (svg.indexOf(cPathStart, i) != -1) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java
r20585 r30737 23 23 public void simplifyWayRange(Way wnew, int from, int to, double thr) { 24 24 if (to - from >= 2) { 25 ArrayList<Node> ns = new ArrayList< Node>();25 ArrayList<Node> ns = new ArrayList<>(); 26 26 simplifyWayRange(wnew, from, to, ns, thr); 27 27 List<Node> nodes = wnew.getNodes(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java
r30701 r30737 25 25 public static WMSLayer getLayer() { 26 26 // check if we already have a layer created. if not, create; if yes, reuse. 27 ArrayList<WMSLayer> existingWMSlayers = new ArrayList< WMSLayer>();27 ArrayList<WMSLayer> existingWMSlayers = new ArrayList<>(); 28 28 if (Main.map != null) { 29 29 Layer activeLayer = Main.map.mapView.getActiveLayer(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r29922 r30737 54 54 CadastrePlugin.class.getResource("/images/cadastre_small.png"))); 55 55 56 private Vector<GeorefImage> images = new Vector< GeorefImage>();56 private Vector<GeorefImage> images = new Vector<>(); 57 57 58 58 public Lock imagesLock = new ReentrantLock(); … … 67 67 public static int currentFormat; 68 68 69 private ArrayList<EastNorthBound> dividedBbox = new ArrayList< EastNorthBound>();69 private ArrayList<EastNorthBound> dividedBbox = new ArrayList<>(); 70 70 71 71 private String location = ""; … … 540 540 int oldImgWidth = images.get(0).image.getWidth(); 541 541 int oldImgHeight = images.get(0).image.getHeight(); 542 HashSet<Double> lx = new HashSet< Double>();543 HashSet<Double> ly = new HashSet< Double>();542 HashSet<Double> lx = new HashSet<>(); 543 HashSet<Double> ly = new HashSet<>(); 544 544 for (GeorefImage img : images) { 545 545 lx.add(img.min.east());
Note:
See TracChangeset
for help on using the changeset viewer.