Ignore:
Timestamp:
2018-06-23T13:07:00+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 13959

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java

    r34130 r34346  
    6363import org.openstreetmap.josm.command.Command;
    6464import org.openstreetmap.josm.command.SequenceCommand;
    65 import org.openstreetmap.josm.data.SelectionChangedListener;
     65import org.openstreetmap.josm.data.osm.DataSelectionListener;
     66import org.openstreetmap.josm.data.osm.DataSet;
    6667import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
    6768import org.openstreetmap.josm.data.osm.IPrimitive;
     
    105106 * @author Zverik
    106107 */
    107 public class RelContextDialog extends ToggleDialog implements ActiveLayerChangeListener, ChosenRelationListener, SelectionChangedListener {
     108public class RelContextDialog extends ToggleDialog implements ActiveLayerChangeListener, ChosenRelationListener, DataSelectionListener {
    108109
    109110    public static final String PREF_PREFIX = "reltoolbox";
     
    347348    @Override
    348349    public void showNotify() {
    349         SelectionEventManager.getInstance().addSelectionListener(this, FireMode.IN_EDT_CONSOLIDATED);
     350        SelectionEventManager.getInstance().addSelectionListenerForEdt(this);
    350351        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
    351352        DatasetEventManager.getInstance().addDatasetListener(chosenRelation, FireMode.IN_EDT);
     
    361362            chosenRelationPanel.setVisible(newRelation != null);
    362363        }
    363         if (MainApplication.getLayerManager().getEditDataSet() != null) {
    364             selectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected());
     364        DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     365        if (ds != null) {
     366            doSelectionChanged(ds.getSelected());
    365367        }
    366368        roleBoxModel.update();
     
    368370
    369371    @Override
    370     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
     372    public void selectionChanged(SelectionChangeEvent event) {
     373        doSelectionChanged(event.getSelection());
     374    }
     375
     376    private void doSelectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    371377        if (!isVisible() || relationsData == null)
    372378            return;
     
    413419    private void updateSelection() {
    414420        if (MainApplication.getLayerManager().getEditDataSet() == null) {
    415             selectionChanged(Collections.<OsmPrimitive>emptyList());
     421            doSelectionChanged(Collections.<OsmPrimitive>emptyList());
    416422        } else {
    417             selectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected());
     423            doSelectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected());
    418424        }
    419425    }
Note: See TracChangeset for help on using the changeset viewer.