Changeset 34346 in osm for applications
- Timestamp:
- 2018-06-23T13:07:00+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/reltoolbox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/build.xml
r34212 r34346 4 4 <property name="commit.message" value="RelToolbox: make natural sort for relation and find relation lists"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="13 807"/>6 <property name="plugin.main.version" value="13959"/> 7 7 8 8 <property name="plugin.author" value="Ilya Zverev"/> -
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
r34130 r34346 63 63 import org.openstreetmap.josm.command.Command; 64 64 import org.openstreetmap.josm.command.SequenceCommand; 65 import org.openstreetmap.josm.data.SelectionChangedListener; 65 import org.openstreetmap.josm.data.osm.DataSelectionListener; 66 import org.openstreetmap.josm.data.osm.DataSet; 66 67 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 67 68 import org.openstreetmap.josm.data.osm.IPrimitive; … … 105 106 * @author Zverik 106 107 */ 107 public class RelContextDialog extends ToggleDialog implements ActiveLayerChangeListener, ChosenRelationListener, SelectionChangedListener {108 public class RelContextDialog extends ToggleDialog implements ActiveLayerChangeListener, ChosenRelationListener, DataSelectionListener { 108 109 109 110 public static final String PREF_PREFIX = "reltoolbox"; … … 347 348 @Override 348 349 public void showNotify() { 349 SelectionEventManager.getInstance().addSelectionListener (this, FireMode.IN_EDT_CONSOLIDATED);350 SelectionEventManager.getInstance().addSelectionListenerForEdt(this); 350 351 MainApplication.getLayerManager().addActiveLayerChangeListener(this); 351 352 DatasetEventManager.getInstance().addDatasetListener(chosenRelation, FireMode.IN_EDT); … … 361 362 chosenRelationPanel.setVisible(newRelation != null); 362 363 } 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()); 365 367 } 366 368 roleBoxModel.update(); … … 368 370 369 371 @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) { 371 377 if (!isVisible() || relationsData == null) 372 378 return; … … 413 419 private void updateSelection() { 414 420 if (MainApplication.getLayerManager().getEditDataSet() == null) { 415 selectionChanged(Collections.<OsmPrimitive>emptyList());421 doSelectionChanged(Collections.<OsmPrimitive>emptyList()); 416 422 } else { 417 selectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected());423 doSelectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected()); 418 424 } 419 425 }
Note:
See TracChangeset
for help on using the changeset viewer.