Changeset 34494 in osm for applications


Ignore:
Timestamp:
2018-08-18T03:01:14+02:00 (6 years ago)
Author:
donvip
Message:

fix deprecation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/buildings_tools/src/buildings_tools/DrawBuildingAction.java

    r34026 r34494  
    2424import org.openstreetmap.josm.actions.mapmode.MapMode;
    2525import org.openstreetmap.josm.data.Bounds;
    26 import org.openstreetmap.josm.data.SelectionChangedListener;
    2726import org.openstreetmap.josm.data.coor.EastNorth;
    28 import org.openstreetmap.josm.data.osm.DataSet;
     27import org.openstreetmap.josm.data.osm.DataSelectionListener;
    2928import org.openstreetmap.josm.data.osm.Node;
    3029import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3130import org.openstreetmap.josm.data.osm.Way;
     31import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    3232import org.openstreetmap.josm.data.preferences.NamedColorProperty;
    3333import org.openstreetmap.josm.gui.MainApplication;
     
    4343import org.openstreetmap.josm.tools.Shortcut;
    4444
    45 @SuppressWarnings("serial")
    46 public class DrawBuildingAction extends MapMode implements MapViewPaintable, SelectionChangedListener,
     45public class DrawBuildingAction extends MapMode implements MapViewPaintable, DataSelectionListener,
    4746        KeyPressReleaseListener, ModifierExListener {
    4847    private enum Mode {
     
    143142        map.keyDetector.addKeyListener(this);
    144143        map.keyDetector.addModifierExListener(this);
    145         DataSet.addSelectionListener(this);
     144        SelectionEventManager.getInstance().addSelectionListener(this);
    146145        updateSnap(getLayerManager().getEditDataSet().getSelected());
    147146    }
     
    156155        map.keyDetector.removeKeyListener(this);
    157156        map.keyDetector.removeModifierExListener(this);
    158         DataSet.removeSelectionListener(this);
     157        SelectionEventManager.getInstance().removeSelectionListener(this);
    159158        if (mode != Mode.None)
    160159            map.mapView.repaint();
     
    491490
    492491    @Override
    493     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    494         updateSnap(newSelection);
     492    public void selectionChanged(SelectionChangeEvent event) {
     493        updateSnap(event.getSelection());
    495494    }
    496495}
Note: See TracChangeset for help on using the changeset viewer.