Changeset 32465 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-06-30T20:00:35+02:00 (8 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

Location:
applications/editors/josm/plugins/routing
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java

    r32349 r32465  
    4242import org.openstreetmap.josm.gui.IconToggleButton;
    4343import org.openstreetmap.josm.gui.MapFrame;
    44 import org.openstreetmap.josm.gui.MapView;
    45 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    4644import org.openstreetmap.josm.gui.layer.Layer;
     45import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     46import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     47import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     48import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    4749import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    4850import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     
    6567 * @version 0.3
    6668 */
    67 public class RoutingPlugin extends Plugin implements LayerChangeListener,DataSetListenerAdapter.Listener {
     69public class RoutingPlugin extends Plugin implements LayerChangeListener, DataSetListenerAdapter.Listener {
    6870    /**
    6971     * Logger
     
    152154        menu = new RoutingMenu();
    153155        // Register this class as LayerChangeListener
    154         MapView.addLayerChangeListener(this);
     156        Main.getLayerManager().addLayerChangeListener(this);
    155157        DatasetEventManager.getInstance().addDatasetListener(datasetAdapter, FireMode.IN_EDT_CONSOLIDATED);
    156158        logger.debug("Finished loading plugin");
     
    228230    }
    229231
    230     public void layerAdded(Layer newLayer) {
     232    @Override
     233    public void layerOrderChanged(LayerOrderChangeEvent e) {
     234        // Do nothing
     235    }
     236
     237    @Override
     238    public void layerAdded(LayerAddEvent evt) {
     239        Layer newLayer = evt.getAddedLayer();
    231240        // Add button(s) to the tool bar when the routing layer is added
    232241        if (newLayer instanceof RoutingLayer) {
     
    238247    }
    239248
    240     public void layerRemoved(Layer oldLayer) {
     249    @Override
     250    public void layerRemoving(LayerRemoveEvent evt) {
     251        Layer oldLayer = evt.getRemovedLayer();
    241252        if ((oldLayer instanceof RoutingLayer) & (layers.size()==1)) {
    242253            // Remove button(s) from the tool bar when the last routing layer is removed
     
    269280    }
    270281
     282    @Override
    271283    public void processDatasetEvent(AbstractDatasetChangedEvent event){
    272284
Note: See TracChangeset for help on using the changeset viewer.