Changeset 34288 in osm for applications


Ignore:
Timestamp:
2018-06-13T18:46:07+02:00 (7 years ago)
Author:
donvip
Message:

fix deprecation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/TurnLanesDialog.java

    r34146 r34288  
    1919
    2020import org.openstreetmap.josm.actions.JosmAction;
    21 import org.openstreetmap.josm.data.SelectionChangedListener;
    22 import org.openstreetmap.josm.data.osm.DataSet;
     21import org.openstreetmap.josm.data.osm.DataSelectionListener;
    2322import org.openstreetmap.josm.data.osm.Node;
    2423import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    3130import org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent;
    3231import org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent;
     32import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    3333import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
    3434import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
     
    4040import org.openstreetmap.josm.plugins.turnlanes.model.ModelContainer;
    4141
    42 public class TurnLanesDialog extends ToggleDialog implements ActiveLayerChangeListener, SelectionChangedListener {
     42public class TurnLanesDialog extends ToggleDialog implements ActiveLayerChangeListener, DataSelectionListener {
    4343    private class EditAction extends JosmAction {
    4444        private static final long serialVersionUID = 4114119073563457706L;
     
    148148
    149149        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
    150         DataSet.addSelectionListener(this);
     150        SelectionEventManager.getInstance().addSelectionListener(this);
    151151
    152152        final JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 4, 4));
     
    202202
    203203    @Override
    204     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    205         if (selected.equals(new HashSet<>(newSelection))) {
     204    public void selectionChanged(SelectionChangeEvent event) {
     205        if (selected.equals(new HashSet<>(event.getSelection()))) {
    206206            return;
    207207        }
    208208        selected.clear();
    209         selected.addAll(newSelection);
     209        selected.addAll(event.getSelection());
    210210
    211211        refresh();
     
    216216        super.destroy();
    217217        MainApplication.getLayerManager().removeActiveLayerChangeListener(this);
    218         DataSet.removeSelectionListener(this);
     218        SelectionEventManager.getInstance().removeSelectionListener(this);
    219219        editAction.destroy();
    220220        validateAction.destroy();
Note: See TracChangeset for help on using the changeset viewer.