Changeset 32518 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-07-02T00:22:51+02:00 (8 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

Location:
applications/editors/josm/plugins/wms-turbo-challenge2
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wms-turbo-challenge2/.settings/org.eclipse.jdt.core.prefs

    r30736 r32518  
    8181org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
    8282org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     83org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
    8384org.eclipse.jdt.core.compiler.problem.unusedImport=warning
    8485org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
  • applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/GameWindow.java

    r32322 r32518  
    130130                        new HashMap<String, Object>()));
    131131
    132             ground_view.parent.addLayer(
     132            ground_view.parent.getLayerManager().addLayer(
    133133                    new GpxLayer(data, "Car GPS trace"));
    134134        }
  • applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/WMSRacer.java

    r32322 r32518  
    1616import org.openstreetmap.josm.actions.JosmAction;
    1717import org.openstreetmap.josm.gui.MapFrame;
    18 import org.openstreetmap.josm.gui.MapView;
    19 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    2018import org.openstreetmap.josm.gui.layer.Layer;
     19import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     20import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     21import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     22import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
     23import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
     24import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
    2125import org.openstreetmap.josm.plugins.Plugin;
    2226import org.openstreetmap.josm.plugins.PluginInformation;
    2327
    24 public class WMSRacer extends Plugin implements LayerChangeListener {
     28public class WMSRacer extends Plugin implements LayerChangeListener, ActiveLayerChangeListener {
    2529    public WMSRacer(PluginInformation info) {
    2630        super(info);
     
    4751        }
    4852
     53        @Override
    4954        public void actionPerformed(ActionEvent ev) {
    5055            if (groundLayer == null ||
     
    5560        }
    5661
     62        @Override
    5763        public void updateEnabledState() {
    5864            if (frame == null) {
     
    8086             * horizontal scanlines (lines equidistant from
    8187             * camera eye)) */
    82             for (Layer l : frame.mapView.getAllLayers())
     88            for (Layer l : frame.mapView.getLayerManager().getLayers())
    8389                if (l.isBackgroundLayer()) {
    8490                    groundLayer = l;
     
    94100    protected DriveAction driveAction = new DriveAction();
    95101
     102    @Override
    96103    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    97         if (oldFrame != null)
    98             MapView.removeLayerChangeListener(this);
     104        if (oldFrame != null) {
     105            Main.getLayerManager().removeLayerChangeListener(this);
     106            Main.getLayerManager().removeActiveLayerChangeListener(this);
     107        }
    99108
    100109        driveAction.frame = newFrame;
    101110        driveAction.updateEnabledState();
    102111
    103         if (newFrame != null)
    104             MapView.addLayerChangeListener(this);
     112        if (newFrame != null) {
     113            Main.getLayerManager().addLayerChangeListener(this);
     114            Main.getLayerManager().addActiveLayerChangeListener(this);
     115        }
    105116    }
    106117
    107     /* LayerChangeListener methods */
    108     public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    109         driveAction.currentLayer = newLayer;
     118    @Override
     119    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
     120        driveAction.currentLayer = Main.getLayerManager().getActiveLayer();
    110121        driveAction.updateEnabledState();
    111122    }
    112123
    113     public void layerAdded(Layer newLayer) {
     124    @Override
     125    public void layerAdded(LayerAddEvent e) {
    114126        driveAction.updateEnabledState();
    115127    }
    116128
    117     public void layerRemoved(Layer oldLayer) {
     129    @Override
     130    public void layerRemoving(LayerRemoveEvent e) {
    118131        driveAction.updateEnabledState();
    119132    }
     133
     134    @Override
     135    public void layerOrderChanged(LayerOrderChangeEvent e) {
     136        // Do nothing
     137    }
    120138}
Note: See TracChangeset for help on using the changeset viewer.