Ignore:
Timestamp:
2016-07-01T09:44:59+02:00 (8 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMode.java

    r30761 r32487  
    2525import org.openstreetmap.josm.actions.mapmode.MapMode;
    2626import org.openstreetmap.josm.gui.MapFrame;
    27 import org.openstreetmap.josm.gui.MapView;
    28 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    29 import org.openstreetmap.josm.gui.layer.Layer;
     27import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     28import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     29import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     30import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    3031
    3132class GPSBlamMode extends MapMode implements LayerChangeListener, MouseWheelListener, AWTEventListener {
     
    5556        }
    5657
    57         MapView.addLayerChangeListener(this);
     58        getLayerManager().addLayerChangeListener(this);
    5859    }
    5960
     
    117118            if(currentBlamLayer == null) {
    118119                currentBlamLayer = new GPSBlamLayer(tr("GPSBlam"));
    119                 Main.main.addLayer(currentBlamLayer);
     120                getLayerManager().addLayer(currentBlamLayer);
    120121            }
    121122            currentBlamLayer.addBlamMarker(new GPSBlamMarker(inputData));
     
    200201
    201202    @Override
    202     public void activeLayerChange(Layer arg0, Layer arg1) {
     203    public void layerOrderChanged(LayerOrderChangeEvent e) {
    203204        // Do nothing
    204205    }
    205206
    206207    @Override
    207     public void layerAdded(Layer arg0) {
     208    public void layerAdded(LayerAddEvent e) {
    208209        // Do nothing
    209210    }
    210211
    211212    @Override
    212     public void layerRemoved(Layer oldLayer) {
    213         if (oldLayer instanceof GPSBlamLayer) {
     213    public void layerRemoving(LayerRemoveEvent e) {
     214        if (e.getRemovedLayer() instanceof GPSBlamLayer) {
    214215            currentBlamLayer = null;
    215216            if(Main.map.mapMode instanceof GPSBlamMode)
     
    221222    public void destroy() {
    222223        super.destroy();
    223         MapView.removeLayerChangeListener(this);
     224        getLayerManager().removeLayerChangeListener(this);
    224225    }
    225226}
Note: See TracChangeset for help on using the changeset viewer.