Changeset 32473 in osm


Ignore:
Timestamp:
2016-06-30T23:43:58+02:00 (9 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java

    r32329 r32473  
    2929
    3030import static org.openstreetmap.josm.tools.I18n.tr;
     31
    3132import java.awt.Point;
    3233import java.awt.event.KeyEvent;
     
    3536import java.util.ArrayList;
    3637import java.util.List;
     38
    3739import javax.swing.JOptionPane;
    3840import javax.swing.SwingUtilities;
     41
    3942import org.openstreetmap.josm.Main;
    4043import org.openstreetmap.josm.data.Bounds;
     
    4447import org.openstreetmap.josm.gui.MapFrame;
    4548import org.openstreetmap.josm.gui.MapView;
    46 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    4749import org.openstreetmap.josm.gui.NavigatableComponent;
    4850import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
    49 import org.openstreetmap.josm.gui.layer.Layer;
     51import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     52import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     53import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     54import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    5055import org.openstreetmap.josm.plugins.Plugin;
    5156import org.openstreetmap.josm.plugins.PluginInformation;
     
    152157            /* add Listeners */
    153158            NavigatableComponent.addZoomChangeListener(this);
    154             MapView.addLayerChangeListener(this);
     159            Main.getLayerManager().addLayerChangeListener(this);
    155160            newMapFrame.mapView.addMouseListener(this);
    156161            /* put username to preferences */
     
    159164            /* if new MapFrame is null, remove listener */
    160165            oldMapFrame.mapView.removeMouseListener(this);
    161             MapView.removeLayerChangeListener(this);
     166            Main.getLayerManager().removeLayerChangeListener(this);
    162167            NavigatableComponent.removeZoomChangeListener(this);
    163168            mapdustGUI.removeObserver(this);
     
    421426    }
    422427
    423     /**
    424      * No need to implement this.
    425      */
    426     @Override
    427     public void activeLayerChange(Layer arg0, Layer arg1) {}
     428    @Override
     429    public void layerOrderChanged(LayerOrderChangeEvent e) {
     430    }
    428431
    429432    /**
     
    432435     * MapDust Service and updates the editor with this new data.
    433436     *
    434      * @param layer The <code>Layer</code> which will be added to the JOSM
    435      * editor
    436      */
    437     @Override
    438     public void layerAdded(Layer layer) {}
     437     * @param e The new added layer event
     438     */
     439    @Override
     440    public void layerAdded(LayerAddEvent e) {}
    439441
    440442    /**
     
    442444     * the MapDust plug-in window.
    443445     *
    444      * @param layer The <code>Layer</code> which will be removed from the JOSM
    445      * editor
    446      */
    447     @Override
    448     public void layerRemoved(Layer layer) {
    449         if (layer instanceof MapdustLayer) {
     446     * @param e The new added layer event
     447     */
     448    @Override
     449    public void layerRemoving(LayerRemoveEvent e) {
     450        if (e.getRemovedLayer() instanceof MapdustLayer) {
    450451            /* remove the layer */
    451452            Main.pref.put("mapdust.pluginState",
    452453                    MapdustPluginState.ONLINE.getValue());
    453454            NavigatableComponent.removeZoomChangeListener(this);
    454             Main.main.removeLayer(layer);
    455455            if (mapdustGUI != null) {
    456456                Main.map.remove(mapdustGUI);
     
    588588                    mapdustLayer = new MapdustLayer("MapDust", mapdustGUI,
    589589                            mapdustBugList);
    590                     Main.main.addLayer(this.mapdustLayer);
     590                    Main.getLayerManager().addLayer(this.mapdustLayer);
    591591                    Main.map.mapView.moveLayer(this.mapdustLayer, 0);
    592592                    Main.map.mapView.addMouseListener(this);
Note: See TracChangeset for help on using the changeset viewer.