Changeset 1814 in josm for trunk/src/org/openstreetmap/josm/actions/MirrorAction.java
- Timestamp:
- 2009-07-19T19:04:49+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MirrorAction.java
r1722 r1814 14 14 import org.openstreetmap.josm.Main; 15 15 import org.openstreetmap.josm.command.Command; 16 import org.openstreetmap.josm.command.ChangeCommand;17 16 import org.openstreetmap.josm.command.MoveCommand; 18 17 import org.openstreetmap.josm.command.SequenceCommand; 19 import org.openstreetmap.josm.data.coor.EastNorth;20 18 import org.openstreetmap.josm.data.osm.Node; 21 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 34 32 public MirrorAction() { 35 33 super(tr("Mirror"), "mirror", tr("Mirror selected nodes and ways."), 36 Shortcut.registerShortcut("tools:mirror", tr("Tool: {0}", tr("Mirror")),37 KeyEvent.VK_M, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);34 Shortcut.registerShortcut("tools:mirror", tr("Tool: {0}", tr("Mirror")), 35 KeyEvent.VK_M, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true); 38 36 } 39 37 40 38 public void actionPerformed(ActionEvent e) { 41 Collection<OsmPrimitive> sel = Main.ds.getSelected();39 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 42 40 HashSet<Node> nodes = new HashSet<Node>(); 43 41 … … 66 64 Collection<Command> cmds = new LinkedList<Command>(); 67 65 68 for (Node n : nodes) 66 for (Node n : nodes) { 69 67 cmds.add(new MoveCommand(n, 2 * (middle - n.getEastNorth().east()), 0.0)); 68 } 70 69 71 70 Main.main.undoRedo.add(new SequenceCommand(tr("Mirror"), cmds));
Note:
See TracChangeset
for help on using the changeset viewer.