Changeset 33830 in osm


Ignore:
Timestamp:
2017-11-17T21:25:12+01:00 (7 years ago)
Author:
donvip
Message:

fix deprecation warnings

Location:
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsLayer.java

    r33493 r33830  
    1111import javax.swing.Icon;
    1212
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.actions.JosmAction;
    1514import org.openstreetmap.josm.data.osm.DataSet;
     15import org.openstreetmap.josm.gui.MainApplication;
    1616import org.openstreetmap.josm.gui.layer.Layer;
    1717import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     
    5656
    5757    private static final JosmAction[] ACTIONS_TO_DISABLE = new JosmAction[] {
    58         Main.main.menu.download,
    59         Main.main.menu.downloadPrimitive,
    60         Main.main.menu.downloadReferrers,
    61         Main.main.menu.upload,
    62         Main.main.menu.uploadSelection,
    63         Main.main.menu.update,
    64         Main.main.menu.updateModified,
    65         Main.main.menu.updateSelection,
    66         Main.main.menu.openLocation
     58        MainApplication.getMenu().download,
     59        MainApplication.getMenu().downloadPrimitive,
     60        MainApplication.getMenu().downloadReferrers,
     61        MainApplication.getMenu().upload,
     62        MainApplication.getMenu().uploadSelection,
     63        MainApplication.getMenu().update,
     64        MainApplication.getMenu().updateModified,
     65        MainApplication.getMenu().updateSelection,
     66        MainApplication.getMenu().openLocation
    6767    };
    6868
     
    8585    public XmlBoundsLayer(DataSet data, String name, File associatedFile) {
    8686        super(data, name, associatedFile);
    87         Main.getLayerManager().addLayerChangeListener(this);
    88         Main.getLayerManager().addActiveLayerChangeListener(this);
     87        MainApplication.getLayerManager().addLayerChangeListener(this);
     88        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
    8989    }
    9090
     
    106106    @Override
    107107    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
    108         Layer newLayer = Main.getLayerManager().getActiveLayer();
     108        Layer newLayer = MainApplication.getLayerManager().getActiveLayer();
    109109        Layer oldLayer = e.getPreviousActiveLayer();
    110110        if (newLayer == this && !(oldLayer instanceof XmlBoundsLayer)) {
     
    132132    @Override
    133133    public void layerRemoving(LayerRemoveEvent e) {
    134         if (Main.getLayerManager().getEditLayer() instanceof XmlBoundsLayer) {
     134        if (MainApplication.getLayerManager().getEditLayer() instanceof XmlBoundsLayer) {
    135135            for (JosmAction action : ACTIONS_TO_DISABLE) {
    136136                action.setEnabled(false);
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java

    r33496 r33830  
    2323import javax.swing.AbstractAction;
    2424
    25 import org.openstreetmap.josm.Main;
    2625import org.openstreetmap.josm.data.coor.LatLon;
    2726import org.openstreetmap.josm.data.osm.BBox;
     
    3736import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsConstants;
    3837import org.openstreetmap.josm.tools.ImageProvider;
     38import org.openstreetmap.josm.tools.Logging;
    3939
    4040/**
     
    201201            }
    202202        } catch(IOException e) {
    203                 Main.warn(e);
     203                Logging.warn(e);
    204204        }
    205205        StringBuilder result = new StringBuilder(256);
     
    412412    @Override
    413413    public void actionPerformed(ActionEvent e) {
    414         if (Main.isDebugEnabled()) {
    415             Main.debug(getXml());
     414        if (Logging.isDebugEnabled()) {
     415            Logging.debug(getXml());
    416416        }
    417417    }
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java

    r33493 r33830  
    1212import javax.swing.event.ListSelectionListener;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.actions.JosmAction;
    1615import org.openstreetmap.josm.data.imagery.ImageryInfo;
     16import org.openstreetmap.josm.gui.MainApplication;
    1717import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel;
    1818import org.openstreetmap.josm.gui.util.GuiHelper;
     
    5555                XmlBoundsConverter.convertImageryEntries(entries));
    5656        GuiHelper.runInEDT(() -> {
    57                     Main.getLayerManager().addLayer(layer);
     57                    MainApplication.getLayerManager().addLayer(layer);
    5858                    layer.onPostLoadFromFile();
    5959                });
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java

    r33493 r33830  
    66import java.util.concurrent.Future;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
    109import org.openstreetmap.josm.data.Bounds;
     10import org.openstreetmap.josm.gui.MainApplication;
    1111import org.openstreetmap.josm.gui.layer.Layer;
    1212import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    3535        // We need submit instead of execute so we can wait for it to finish and get the error
    3636        // message if necessary. If no one calls getErrorMessage() it just behaves like execute.
    37         return Main.worker.submit(downloadTask);
     37        return MainApplication.worker.submit(downloadTask);
    3838    }
    3939
     
    7272        protected int getNumDataLayers() {
    7373            int count = 0;
    74             if (!Main.isDisplayingMapView()) return 0;
    75             for (Layer layer : Main.getLayerManager().getLayers()) {
     74            if (!MainApplication.isDisplayingMapView()) return 0;
     75            for (Layer layer : MainApplication.getLayerManager().getLayers()) {
    7676                if (layer instanceof XmlBoundsLayer) {
    7777                    count++;
     
    8383        @Override
    8484        protected OsmDataLayer getFirstDataLayer() {
    85             if (!Main.isDisplayingMapView()) return null;
    86             for (Layer layer : Main.getLayerManager().getLayers()) {
     85            if (!MainApplication.isDisplayingMapView()) return null;
     86            for (Layer layer : MainApplication.getLayerManager().getLayers()) {
    8787                if (layer instanceof XmlBoundsLayer)
    8888                    return (XmlBoundsLayer) layer;
Note: See TracChangeset for help on using the changeset viewer.