Ignore:
Timestamp:
2017-08-24T00:15:51+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.map and Main.isDisplayingMapView(). Replacements: gui.MainApplication.getMap() / gui.MainApplication.isDisplayingMapView()

File:
1 edited

Legend:

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

    r12560 r12630  
    1111import org.openstreetmap.josm.Main;
    1212import org.openstreetmap.josm.data.coor.EastNorth;
     13import org.openstreetmap.josm.gui.MainApplication;
     14import org.openstreetmap.josm.gui.MapView;
    1315import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    1416import org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler;
     
    6870    protected EastNorth computePastePosition(ActionEvent e) {
    6971        // default to paste in center of map (pasted via menu or cursor not in MapView)
    70         EastNorth mPosition = Main.map.mapView.getCenter();
     72        MapView mapView = MainApplication.getMap().mapView;
     73        EastNorth mPosition = mapView.getCenter();
    7174        // We previously checked for modifier to know if the action has been trigerred via shortcut or via menu
    7275        // But this does not work if the shortcut is changed to a single key (see #9055)
     
    7477        if (e != null && !getValue(NAME).equals(e.getActionCommand())) {
    7578            final Point mp = MouseInfo.getPointerInfo().getLocation();
    76             final Point tl = Main.map.mapView.getLocationOnScreen();
     79            final Point tl = mapView.getLocationOnScreen();
    7780            final Point pos = new Point(mp.x-tl.x, mp.y-tl.y);
    78             if (Main.map.mapView.contains(pos)) {
    79                 mPosition = Main.map.mapView.getEastNorth(pos.x, pos.y);
     81            if (mapView.contains(pos)) {
     82                mPosition = mapView.getEastNorth(pos.x, pos.y);
    8083            }
    8184        }
Note: See TracChangeset for help on using the changeset viewer.