Changeset 25898 in osm for applications
- Timestamp:
- 2011-04-25T20:21:45+02:00 (14 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/AddIntersectionsAction.java
r24236 r25898 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.Collection; 10 import java.util.HashSet; 10 11 import java.util.LinkedList; 11 12 import java.util.List; 13 import java.util.Set; 12 14 13 15 import javax.swing.JOptionPane; … … 15 17 import org.openstreetmap.josm.Main; 16 18 import org.openstreetmap.josm.actions.JosmAction; 19 import org.openstreetmap.josm.command.AddCommand; 17 20 import org.openstreetmap.josm.command.Command; 18 21 import org.openstreetmap.josm.command.SequenceCommand; 22 import org.openstreetmap.josm.data.osm.Node; 19 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 24 import org.openstreetmap.josm.data.osm.Way; … … 48 52 if (!cmds.isEmpty()) { 49 53 Main.main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"),cmds)); 54 Set<Node> nodes = new HashSet<Node>(10); 55 // find and select newly added nodes 56 for (Command cmd: cmds) if (cmd instanceof AddCommand){ 57 Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives(); 58 for ( OsmPrimitive p : pp) { // find all affected nodes 59 if (p instanceof Node && p.isNew()) nodes.add((Node)p); 60 } 61 if (!nodes.isEmpty()) { 62 getCurrentDataSet().setSelected(nodes); 63 } 64 } 50 65 } 51 66 } -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java
r25876 r25898 32 32 JMenuItem pasteRelations; 33 33 JMenuItem alignWayNodes; 34 JMenuItem selModifiedNodes; 35 JMenuItem selModifiedWays; 34 36 35 37 public UtilsPlugin2(PluginInformation info) { … … 56 58 intWays = MainMenu.add(selectionMenu, new IntersectedWaysAction()); 57 59 intWaysR = MainMenu.add(selectionMenu, new IntersectedWaysRecursiveAction()); 60 selModifiedNodes = MainMenu.add(selectionMenu, new SelectModNodesAction()); 61 selModifiedWays = MainMenu.add(selectionMenu, new SelectModWaysAction()); 58 62 } 59 63 … … 79 83 intWays.setEnabled(enabled); 80 84 intWaysR.setEnabled(enabled); 85 selModifiedNodes.setEnabled(enabled); 86 selModifiedWays.setEnabled(enabled); 81 87 } 82 88 }
Note:
See TracChangeset
for help on using the changeset viewer.