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

    r10716 r12630  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.Point;
    76import java.util.ArrayList;
    87import java.util.Arrays;
     
    2322import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2423import org.openstreetmap.josm.data.osm.Way;
     24import org.openstreetmap.josm.gui.MainApplication;
     25import org.openstreetmap.josm.gui.MapView;
    2526import org.openstreetmap.josm.gui.util.GuiHelper;
    2627import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
     
    125126        Node nd = null;
    126127
    127         if (Main.isDisplayingMapView()) {
    128             Point p = Main.map.mapView.getPoint(ll);
    129             nd = Main.map.mapView.getNearestNode(p, OsmPrimitive::isUsable);
     128        if (MainApplication.isDisplayingMapView()) {
     129            MapView mapView = MainApplication.getMap().mapView;
     130            nd = mapView.getNearestNode(mapView.getPoint(ll), OsmPrimitive::isUsable);
    130131            if (nd != null && nd.getCoor().greatCircleDistance(ll) > Main.pref.getDouble("remote.tolerance", 0.1)) {
    131132                nd = null; // node is too far
     
    171172            AutoScaleAction.autoScale("selection");
    172173        } else {
    173             Main.map.mapView.repaint();
     174            MainApplication.getMap().mapView.repaint();
    174175        }
    175176        return way;
Note: See TracChangeset for help on using the changeset viewer.