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

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

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r12620 r12630  
    3535import org.openstreetmap.josm.data.projection.Projection;
    3636import org.openstreetmap.josm.data.projection.Projections;
     37import org.openstreetmap.josm.gui.MainApplication;
     38import org.openstreetmap.josm.gui.MapFrame;
    3739import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3840
     
    553555     */
    554556    public static Area getAreaLatLon(Relation multipolygon) {
    555         final Multipolygon mp = Main.map == null || Main.map.mapView == null
     557        MapFrame map = MainApplication.getMap();
     558        final Multipolygon mp = map == null || map.mapView == null
    556559                ? new Multipolygon(multipolygon)
    557560                : MultipolygonCache.getInstance().get(multipolygon);
     
    693696    public static double multipolygonArea(Relation multipolygon) {
    694697        double area = 0.0;
    695         final Multipolygon mp = Main.map == null || Main.map.mapView == null
     698        MapFrame map = MainApplication.getMap();
     699        final Multipolygon mp = map == null || map.mapView == null
    696700                ? new Multipolygon(multipolygon)
    697701                : MultipolygonCache.getInstance().get(multipolygon);
  • trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java

    r12520 r12630  
    2424
    2525import org.openstreetmap.josm.Main;
     26import org.openstreetmap.josm.gui.MainApplication;
    2627import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
    2728
     
    4243            @Override
    4344            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
    44                 Main.map.statusLine.resetHelpText(STATUS_BAR_ID);
     45                MainApplication.getMap().statusLine.resetHelpText(STATUS_BAR_ID);
    4546            }
    4647
     
    114115                }
    115116                lastAction = null;
    116                 Main.map.statusLine.resetHelpText(STATUS_BAR_ID);
     117                MainApplication.getMap().statusLine.resetHelpText(STATUS_BAR_ID);
    117118                return true;
    118119            }
     
    147148            lastAction = this;
    148149            timer.schedule(new MyTimerTask(lastTimestamp, lastAction), DIALOG_DELAY);
    149             Main.map.statusLine.setHelpText(STATUS_BAR_ID, tr("{0}... [please type its number]", (String) action.getValue(SHORT_DESCRIPTION)));
     150            MainApplication.getMap().statusLine.setHelpText(STATUS_BAR_ID, tr("{0}... [please type its number]", (String) action.getValue(SHORT_DESCRIPTION)));
    150151        }
    151152
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r12620 r12630  
    1515import org.openstreetmap.josm.data.projection.Projection;
    1616import org.openstreetmap.josm.data.projection.Projections;
     17import org.openstreetmap.josm.gui.MainApplication;
     18import org.openstreetmap.josm.gui.MapView;
    1719import org.openstreetmap.josm.gui.util.GuiHelper;
    1820
     
    204206
    205207    private static Dimension getScreenSize() {
    206         if (Main.isDisplayingMapView()) {
    207             return new Dimension(Main.map.mapView.getWidth(), Main.map.mapView.getHeight());
     208        if (MainApplication.isDisplayingMapView()) {
     209            MapView mapView = MainApplication.getMap().mapView;
     210            return new Dimension(mapView.getWidth(), mapView.getHeight());
    208211        } else {
    209212            return GuiHelper.getScreenSize();
Note: See TracChangeset for help on using the changeset viewer.