- Timestamp:
- 2012-06-03T15:16:23+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r5216 r5265 240 240 } 241 241 242 public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode) { 242 public static void doMergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetLocationNode) { 243 if (nodes == null) { 244 return; 245 } 246 Set<Node> allNodes = new HashSet<Node>(nodes); 247 allNodes.add(targetLocationNode); 248 Node target = selectTargetNode(allNodes); 249 250 Command cmd = mergeNodes(layer, nodes, target, targetLocationNode); 251 if (cmd != null) { 252 Main.main.undoRedo.add(cmd); 253 getCurrentDataSet().setSelected(target); 254 } 255 } 256 257 public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetLocationNode) { 243 258 if (nodes == null) { 244 259 return null; 245 260 } 246 261 Set<Node> allNodes = new HashSet<Node>(nodes); 247 allNodes.add(target Node);248 return mergeNodes(layer, nodes, selectTargetNode(allNodes), target Node);262 allNodes.add(targetLocationNode); 263 return mergeNodes(layer, nodes, selectTargetNode(allNodes), targetLocationNode); 249 264 } 250 265 -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r5174 r5265 909 909 Collection<Node> nodesToMerge = new LinkedList<Node>(selNodes); 910 910 nodesToMerge.add(target); 911 Command cmd = MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodesToMerge, target); 912 if (cmd != null) { 913 Main.main.undoRedo.add(cmd); 914 getCurrentDataSet().setSelected(target); 915 } 911 MergeNodesAction.doMergeNodes(Main.main.getEditLayer(), nodesToMerge, target); 916 912 } 917 913
Note:
See TracChangeset
for help on using the changeset viewer.