Ignore:
Timestamp:
2009-07-19T19:04:49+02:00 (15 years ago)
Author:
Gubaer
Message:

removed dependencies to Main.ds, removed Main.ds
removed AddVisitor, NameVisitor, DeleteVisitor - unnecessary double dispatching for these simple cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/MirrorAction.java

    r1722 r1814  
    1414import org.openstreetmap.josm.Main;
    1515import org.openstreetmap.josm.command.Command;
    16 import org.openstreetmap.josm.command.ChangeCommand;
    1716import org.openstreetmap.josm.command.MoveCommand;
    1817import org.openstreetmap.josm.command.SequenceCommand;
    19 import org.openstreetmap.josm.data.coor.EastNorth;
    2018import org.openstreetmap.josm.data.osm.Node;
    2119import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    3432    public MirrorAction() {
    3533        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);
    3836    }
    3937
    4038    public void actionPerformed(ActionEvent e) {
    41         Collection<OsmPrimitive> sel = Main.ds.getSelected();
     39        Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    4240        HashSet<Node> nodes = new HashSet<Node>();
    4341
     
    6664        Collection<Command> cmds = new LinkedList<Command>();
    6765
    68         for (Node n : nodes)
     66        for (Node n : nodes) {
    6967            cmds.add(new MoveCommand(n, 2 * (middle - n.getEastNorth().east()), 0.0));
     68        }
    7069
    7170        Main.main.undoRedo.add(new SequenceCommand(tr("Mirror"), cmds));
Note: See TracChangeset for help on using the changeset viewer.