Changeset 2095 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode
- Timestamp:
- 2009-09-12T06:21:30+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r2031 r2095 17 17 import java.util.LinkedList; 18 18 import java.util.List; 19 import java.util.Set; 19 20 import java.util.TreeSet; 20 21 import java.util.logging.Logger; … … 43 44 import org.openstreetmap.josm.gui.SelectionManager; 44 45 import org.openstreetmap.josm.gui.SelectionManager.SelectionEnded; 46 import org.openstreetmap.josm.gui.dialogs.LayerListDialog.MergeAction; 45 47 import org.openstreetmap.josm.gui.layer.Layer; 46 48 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 489 491 if (nn != null) { 490 492 Node n = nn.iterator().next(); 491 LinkedList<Node> selNodes = new LinkedList<Node>(); 492 for (OsmPrimitive osm : selection) 493 if (osm instanceof Node) { 494 selNodes.add((Node)osm); 495 } 496 if (selNodes.size() > 0) { 497 selNodes.add(n); 498 new MergeNodesAction().mergeNodes(selNodes, n); 493 Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class); 494 if (!selectedNodes.isEmpty()) { 495 selectedNodes.add(n); 496 MergeNodesAction mergeAction = new MergeNodesAction(); 497 Node targetNode = mergeAction.selectTargetNode(selectedNodes); 498 mergeAction.mergeNodes(Main.main.getEditLayer(),selectedNodes, targetNode); 499 499 } 500 500 }
Note:
See TracChangeset
for help on using the changeset viewer.