Ignore:
Timestamp:
2017-08-24T00:15:51+02:00 (9 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/io/remotecontrol/handler/AddNodeHandler.java

    r12620 r12630  
    1414import org.openstreetmap.josm.data.osm.Node;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     16import org.openstreetmap.josm.gui.MainApplication;
     17import org.openstreetmap.josm.gui.MapView;
    1618import org.openstreetmap.josm.gui.util.GuiHelper;
    1719import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
     
    8587        Node node = null;
    8688
    87         if (Main.isDisplayingMapView()) {
    88             Point p = Main.map.mapView.getPoint(ll);
    89             node = Main.map.mapView.getNearestNode(p, OsmPrimitive::isUsable);
     89        if (MainApplication.isDisplayingMapView()) {
     90            MapView mapView = MainApplication.getMap().mapView;
     91            Point p = mapView.getPoint(ll);
     92            node = mapView.getNearestNode(p, OsmPrimitive::isUsable);
    9093            if (node != null && node.getCoor().greatCircleDistance(ll) > Main.pref.getDouble("remotecontrol.tolerance", 0.1)) {
    9194                node = null; // node is too far
     
    103106            AutoScaleAction.autoScale("selection");
    104107        } else {
    105             Main.map.mapView.repaint();
     108            MainApplication.getMap().mapView.repaint();
    106109        }
    107110        // parse parameter addtags=tag1=value1|tag2=vlaue2
Note: See TracChangeset for help on using the changeset viewer.