Ignore:
Timestamp:
2017-08-26T21:28:34+02:00 (8 years ago)
Author:
zverik
Message:

Upgrade API in imagery_offset_db

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/GetImageryOffsetAction.java

    r33309 r33547  
    2121import org.openstreetmap.josm.data.coor.LatLon;
    2222import org.openstreetmap.josm.data.projection.Projection;
     23import org.openstreetmap.josm.gui.MainApplication;
    2324import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer;
    2425import org.openstreetmap.josm.tools.ImageProvider;
     
    5455    @Override
    5556    public void actionPerformed(ActionEvent e) {
    56         if (Main.map == null || Main.map.mapView == null || !Main.map.isVisible())
     57        if (!MainApplication.isDisplayingMapView() || !MainApplication.getMap().isVisible())
    5758            return;
    58         Projection proj = Main.map.mapView.getProjection();
    59         LatLon center = proj.eastNorth2latlon(Main.map.mapView.getCenter());
     59        Projection proj = MainApplication.getMap().mapView.getProjection();
     60        LatLon center = proj.eastNorth2latlon(MainApplication.getMap().mapView.getCenter());
    6061        AbstractTileSourceLayer layer = ImageryOffsetTools.getTopImageryLayer();
    6162        String imagery = ImageryOffsetTools.getImageryID(layer);
     
    6465
    6566        DownloadOffsetsTask download = new DownloadOffsetsTask(center, layer, imagery);
    66         Main.worker.submit(download);
     67        MainApplication.worker.submit(download);
    6768    }
    6869
     
    7475    protected void updateEnabledState() {
    7576        boolean state = true;
    76         if (Main.map == null || Main.map.mapView == null || !Main.map.isVisible())
     77        if (!MainApplication.isDisplayingMapView() || !MainApplication.getMap().isVisible())
    7778            state = false;
    7879        AbstractTileSourceLayer layer = ImageryOffsetTools.getTopImageryLayer();
Note: See TracChangeset for help on using the changeset viewer.