- Timestamp:
- 2017-06-09T21:31:00+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r12297 r12373 43 43 import org.openstreetmap.josm.data.osm.event.DatasetEventManager; 44 44 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 45 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 45 46 import org.openstreetmap.josm.gui.SideButton; 46 47 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager; … … 113 114 // let the model for changesets in the current selection listen to various events 114 115 ChangesetCache.getInstance().addChangesetCacheListener(inSelectionModel); 115 Main.getLayerManager().addActiveLayerChangeListener(inSelectionModel); 116 DataSet.addSelectionListener(inSelectionModel); 116 SelectionEventManager.getInstance().addSelectionListener(inSelectionModel); 117 117 118 118 // let the model for changesets in the current layer listen to various … … 140 140 // remove the list model for the changesets in the current selection as 141 141 // listener 142 // 143 Main.getLayerManager().removeActiveLayerChangeListener(inSelectionModel); 144 DataSet.removeSelectionListener(inSelectionModel); 142 SelectionEventManager.getInstance().removeSelectionListener(inSelectionModel); 143 ChangesetCache.getInstance().removeChangesetCacheListener(inSelectionModel); 145 144 } 146 145 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetInSelectionListModel.java
r12371 r12373 2 2 package org.openstreetmap.josm.gui.dialogs.changeset; 3 3 4 import java.util.Collection;5 6 4 import javax.swing.DefaultListSelectionModel; 7 5 8 import org.openstreetmap.josm.data.SelectionChangedListener; 9 import org.openstreetmap.josm.data.osm.DataSet; 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 12 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 6 import org.openstreetmap.josm.data.osm.DataSelectionListener; 13 7 14 8 /** 15 9 * A table of changesets that displays the ones that are used by the primitives in the current selection. 16 10 */ 17 public class ChangesetInSelectionListModel extends ChangesetListModel implements SelectionChangedListener, ActiveLayerChangeListener {11 public class ChangesetInSelectionListModel extends ChangesetListModel implements DataSelectionListener { 18 12 19 13 /** … … 26 20 27 21 /* ---------------------------------------------------------------------------- */ 28 /* Interface SelectionChangeListener*/22 /* Interface DataSelectionListener */ 29 23 /* ---------------------------------------------------------------------------- */ 24 30 25 @Override 31 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 32 initFromPrimitives(newSelection); 33 } 34 35 /* ---------------------------------------------------------------------------- */ 36 /* Interface LayerChangeListener */ 37 /* ---------------------------------------------------------------------------- */ 38 @Override 39 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 40 DataSet newData = e.getSource().getEditDataSet(); 41 if (newData == null) { 42 setChangesets(null); 43 } else { 44 initFromPrimitives(newData.getAllSelected()); 45 } 26 public void selectionChanged(SelectionChangeEvent event) { 27 initFromPrimitives(event.getSelection()); 46 28 } 47 29 }
Note:
See TracChangeset
for help on using the changeset viewer.