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/PasteAction.java

    r1750 r1814  
    3131    public PasteAction() {
    3232        super(tr("Paste"), "paste", tr("Paste contents of paste buffer."),
    33             Shortcut.registerShortcut("system:paste", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_V, Shortcut.GROUP_MENU), true);
     33                Shortcut.registerShortcut("system:paste", tr("Edit: {0}", tr("Paste")), KeyEvent.VK_V, Shortcut.GROUP_MENU), true);
    3434        setEnabled(false);
    3535    }
     
    3939    }
    4040
    41     public static void pasteData(DataSet pasteBuffer, Layer source, ActionEvent e) {
     41    public void pasteData(DataSet pasteBuffer, Layer source, ActionEvent e) {
    4242        /* Find the middle of the pasteBuffer area */
    4343        double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100;
     
    6363
    6464        HashMap<OsmPrimitive,OsmPrimitive> map = new HashMap<OsmPrimitive,OsmPrimitive>();
    65           /* temporarily maps old nodes to new so we can do a true deep copy */
     65        /* temporarily maps old nodes to new so we can do a true deep copy */
    6666
    6767        /* do the deep copy of the paste buffer contents, leaving the pasteBuffer unchanged */
     
    6969            Node nnew = new Node(n);
    7070            nnew.id = 0;
    71             if (Main.main.createOrGetEditLayer() == source) {
     71            if (Main.map.mapView.getEditLayer() == source) {
    7272                nnew.setEastNorth(nnew.getEastNorth().add(offsetEast, offsetNorth));
    7373            }
     
    113113
    114114        Main.main.undoRedo.add(new SequenceCommand(tr("Paste"), clist));
    115         Main.ds.setSelected(osms);
     115        getCurrentDataSet().setSelected(osms);
    116116        Main.map.mapView.repaint();
    117117    }
Note: See TracChangeset for help on using the changeset viewer.