Changeset 30713 in osm for applications/editors/josm/plugins
- Timestamp:
- 2014-10-12T12:13:45+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/merge-overlap/src/mergeoverlap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MergeOverlapAction.java
r30712 r30713 61 61 } 62 62 63 Map<Way, List<Relation>> relations = new HashMap< Way, List<Relation>>();64 Map<Way, Way> oldWays = new HashMap< Way, Way>();65 Map<Relation, Relation> newRelations = new HashMap< Relation, Relation>();66 Set<Way> deletes = new HashSet< Way>();63 Map<Way, List<Relation>> relations = new HashMap<>(); 64 Map<Way, Way> oldWays = new HashMap<>(); 65 Map<Relation, Relation> newRelations = new HashMap<>(); 66 Set<Way> deletes = new HashSet<>(); 67 67 68 68 /** … … 76 76 77 77 // List of selected ways 78 List<Way> ways = new ArrayList< Way>();78 List<Way> ways = new ArrayList<>(); 79 79 relations.clear(); 80 80 newRelations.clear(); … … 85 85 Way way = (Way) osm; 86 86 ways.add(way); 87 List<Relation> rels = new ArrayList< Relation>();87 List<Relation> rels = new ArrayList<>(); 88 88 for (Relation r : OsmPrimitive.getFilteredList(way 89 89 .getReferrers(), Relation.class)) { … … 94 94 } 95 95 96 List<Way> sel = new ArrayList< Way>(ways);97 Collection<Command> cmds = new LinkedList< Command>();96 List<Way> sel = new ArrayList<>(ways); 97 Collection<Command> cmds = new LinkedList<>(); 98 98 99 99 // ***** … … 101 101 // ***** 102 102 for (Way way : ways) { 103 Set<Node> nodes = new HashSet< Node>();103 Set<Node> nodes = new HashSet<>(); 104 104 for (Way opositWay : ways) { 105 105 if (way != opositWay) { 106 List<NodePos> nodesPos = new LinkedList< NodePos>();106 List<NodePos> nodesPos = new LinkedList<>(); 107 107 108 108 int pos = 0; … … 166 166 if (!nodes.isEmpty() && !way.isClosed() || nodes.size() >= 2) { 167 167 List<List<Node>> wayChunks = SplitWayAction.buildSplitChunks( 168 way, new ArrayList< Node>(nodes));168 way, new ArrayList<>(nodes)); 169 169 SplitWayResult result = splitWay(getEditLayer(), way, wayChunks); 170 170 … … 184 184 // merge 185 185 // ***** 186 ways = new ArrayList< Way>(sel);186 ways = new ArrayList<>(sel); 187 187 while (!ways.isEmpty()) { 188 188 Way way = ways.get(0); 189 List<Way> combine = new ArrayList< Way>();189 List<Way> combine = new ArrayList<>(); 190 190 combine.add(way); 191 191 for (Way opositWay : ways) { … … 232 232 } 233 233 234 List<Way> del = new LinkedList< Way>();234 List<Way> del = new LinkedList<>(); 235 235 for (Way w : deletes) { 236 236 if (!w.isDeleted()) { … … 319 319 List<List<Node>> wayChunks) { 320 320 // build a list of commands, and also a new selection list 321 Collection<Command> commandList = new ArrayList< Command>(wayChunks321 Collection<Command> commandList = new ArrayList<>(wayChunks 322 322 .size()); 323 323 … … 333 333 commandList.add(new ChangeCommand(way, changedWay)); 334 334 335 List<Way> newWays = new ArrayList< Way>();335 List<Way> newWays = new ArrayList<>(); 336 336 // Second, create new ways 337 337 while (chunkIt.hasNext()) { … … 374 374 } 375 375 } 376 List<Node> nodes = new ArrayList< Node>();376 List<Node> nodes = new ArrayList<>(); 377 377 if (via != null) { 378 378 if (via instanceof Node) { … … 512 512 513 513 // remove duplicates, preserving order 514 ways = new LinkedHashSet< Way>(ways);514 ways = new LinkedHashSet<>(ways); 515 515 516 516 // try to build a new way which includes all the combined ways … … 522 522 TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways); 523 523 524 List<Way> reversedWays = new LinkedList< Way>();525 List<Way> unreversedWays = new LinkedList< Way>();524 List<Way> reversedWays = new LinkedList<>(); 525 List<Way> unreversedWays = new LinkedList<>(); 526 526 for (Way w : ways) { 527 527 if ((path.indexOf(w.getNode(0)) + 1) == path.lastIndexOf(w … … 555 555 // reverse their tags 556 556 if (!reversedWays.isEmpty()) { 557 List<Way> unreversedTagWays = new ArrayList< Way>(ways);557 List<Way> unreversedTagWays = new ArrayList<>(ways); 558 558 unreversedTagWays.removeAll(reversedWays); 559 559 ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector(); 560 List<Way> reversedTagWays = new ArrayList< Way>();560 List<Way> reversedTagWays = new ArrayList<>(); 561 561 Collection<Command> changePropertyCommands = null; 562 562 for (Way w : reversedWays) { … … 606 606 } 607 607 608 LinkedList<Command> cmds = new LinkedList< Command>();608 LinkedList<Command> cmds = new LinkedList<>(); 609 609 deletes.addAll(ways); 610 610 deletes.remove(targetWay); … … 653 653 */ 654 654 private boolean duplicateParentRelations(Collection<Way> ways) { 655 Set<Relation> relations = new HashSet< Relation>();655 Set<Relation> relations = new HashSet<>(); 656 656 for (Way w : ways) { 657 657 List<Relation> rs = getParentRelations(w); … … 672 672 */ 673 673 private List<Relation> getParentRelations(Way way) { 674 List<Relation> rels = new ArrayList< Relation>();674 List<Relation> rels = new ArrayList<>(); 675 675 for (Relation r : relations.get(way)) { 676 676 if (newRelations.containsKey(r)) { … … 716 716 */ 717 717 private Set<Relation> getParentRelations(Collection<Way> ways) { 718 HashSet<Relation> ret = new HashSet< Relation>();718 HashSet<Relation> ret = new HashSet<>(); 719 719 for (Way w : ways) { 720 720 ret.addAll(getParentRelations(w)); -
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/hack/MyRelationMemberConflictResolverModel.java
r30712 r30713 80 80 81 81 public MyRelationMemberConflictResolverModel() { 82 decisions = new ArrayList< RelationMemberConflictDecision>();82 decisions = new ArrayList<>(); 83 83 support = new PropertyChangeSupport(this); 84 84 } … … 165 165 references = references == null ? new LinkedList<RelationToChildReference>() : references; 166 166 decisions.clear(); 167 this.relations = new HashSet< Relation>(references.size());167 this.relations = new HashSet<>(references.size()); 168 168 for (RelationToChildReference reference: references) { 169 169 decisions.add(new RelationMemberConflictDecision(reference.getParent(), reference.getPosition())); … … 308 308 */ 309 309 public Set<Relation> getModifiedRelations(OsmPrimitive newPrimitive) { 310 HashSet<Relation> ret = new HashSet< Relation>();310 HashSet<Relation> ret = new HashSet<>(); 311 311 for (Relation relation: relations) { 312 312 if (isChanged(relation, newPrimitive)) { -
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/hack/MyRelationMemberConflictResolverTable.java
r30712 r30713 42 42 getActionMap().put("selectPreviousColumnCell", selectPreviousColumnCellAction); 43 43 44 setRowHeight((int)new JComboBox< Object>().getPreferredSize().getHeight());44 setRowHeight((int)new JComboBox<>().getPreferredSize().getHeight()); 45 45 } 46 46
Note:
See TracChangeset
for help on using the changeset viewer.