Changeset 13925 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2018-06-13T00:05:31+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/SelectionChangedListener.java
r12098 r13925 30 30 * Informs the listener that the selection in the dataset has changed. 31 31 * @param newSelection The new selection. 32 * @deprecated use {@link DataSelectionListener} instead 32 33 */ 34 @Deprecated 33 35 void selectionChanged(Collection<? extends OsmPrimitive> newSelection); 34 36 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r13916 r13925 548 548 * themselves for any dataset selection changes that occur, regardless of the current active 549 549 * dataset. (However, the selection does only change in the active layer) 550 */ 550 * @deprecated to be removed 551 */ 552 @Deprecated 551 553 private static final Collection<SelectionChangedListener> selListeners = new CopyOnWriteArrayList<>(); 552 554 … … 556 558 * @see #addSelectionListener(DataSelectionListener) 557 559 * @see SelectionEventManager#removeSelectionListener(SelectionChangedListener) 558 */ 560 * @deprecated Use {@link SelectionEventManager#addSelectionListener(DataSelectionListener)} instead 561 */ 562 @Deprecated 559 563 public static void addSelectionListener(SelectionChangedListener listener) { 560 564 ((CopyOnWriteArrayList<SelectionChangedListener>) selListeners).addIfAbsent(listener); … … 566 570 * @see #removeSelectionListener(DataSelectionListener) 567 571 * @see SelectionEventManager#removeSelectionListener(SelectionChangedListener) 568 */ 572 * @deprecated Use {@link SelectionEventManager#removeSelectionListener(DataSelectionListener)} instead 573 */ 574 @Deprecated 569 575 public static void removeSelectionListener(SelectionChangedListener listener) { 570 576 selListeners.remove(listener); 571 577 } 572 578 579 /** 580 * @deprecated to be removed 581 * @param currentSelection current selection 582 */ 583 @Deprecated 573 584 private static void fireSelectionChange(Collection<? extends OsmPrimitive> currentSelection) { 574 585 for (SelectionChangedListener l : selListeners) { -
trunk/src/org/openstreetmap/josm/data/osm/OsmData.java
r13916 r13925 11 11 import org.openstreetmap.josm.data.DataSource; 12 12 import org.openstreetmap.josm.data.ProjectionBounds; 13 import org.openstreetmap.josm.data.SelectionChangedListener;14 13 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 15 14 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 398 397 /** 399 398 * Sets the current selection to the primitives in <code>selection</code> 400 * and notifies all {@link SelectionChangedListener}.399 * and notifies all {@link DataSelectionListener}. 401 400 * 402 401 * @param selection the selection … … 406 405 /** 407 406 * Sets the current selection to the primitives in <code>osm</code> 408 * and notifies all {@link SelectionChangedListener}.407 * and notifies all {@link DataSelectionListener}. 409 408 * 410 409 * @param osm the primitives to set. <code>null</code> values are ignored for now, but this may be removed in the future. … … 414 413 /** 415 414 * Adds the primitives in <code>selection</code> to the current selection 416 * and notifies all {@link SelectionChangedListener}.415 * and notifies all {@link DataSelectionListener}. 417 416 * 418 417 * @param selection the selection … … 422 421 /** 423 422 * Adds the primitives in <code>osm</code> to the current selection 424 * and notifies all {@link SelectionChangedListener}.423 * and notifies all {@link DataSelectionListener}. 425 424 * 426 425 * @param osm the primitives to add … … 449 448 * @param listener The listener. 450 449 * @see #removeSelectionListener(DataSelectionListener) 451 * @see SelectionEventManager#addSelectionListener(SelectionChangedListener, 452 * org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode) 450 * @see SelectionEventManager#addSelectionListener(DataSelectionListener) 453 451 * To add a global listener. 454 452 */ -
trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
r13434 r13925 48 48 } 49 49 50 /** 51 * @deprecated to be removed 52 */ 53 @Deprecated 50 54 private static class OldListenerInfo implements ListenerInfo { 51 55 private final SelectionChangedListener listener; … … 130 134 * @param fireMode Set this to IN_EDT_CONSOLIDATED if you want the event to be fired in the EDT thread. 131 135 * Set it to IMMEDIATELY if you want the event to fire in the thread that caused the selection update. 132 */ 136 * @deprecated Use {@link #addSelectionListener(DataSelectionListener)} or {@link #addSelectionListenerForEdt(DataSelectionListener)} 137 */ 138 @Deprecated 133 139 public void addSelectionListener(SelectionChangedListener listener, FireMode fireMode) { 134 140 if (fireMode == FireMode.IN_EDT) { … … 163 169 * Unregisters a {@code SelectionChangedListener}. 164 170 * @param listener listener to remove 165 */ 171 * @deprecated use {@link #removeSelectionListener(DataSelectionListener)} 172 */ 173 @Deprecated 166 174 public void removeSelectionListener(SelectionChangedListener listener) { 167 175 remove(new OldListenerInfo(listener)); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java
r13082 r13925 10 10 11 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.data. SelectionChangedListener;12 import org.openstreetmap.josm.data.osm.DataSelectionListener; 13 13 import org.openstreetmap.josm.data.osm.DataSet; 14 14 import org.openstreetmap.josm.data.osm.Node; … … 23 23 import org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent; 24 24 import org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent; 25 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 25 26 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 26 27 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; … … 39 40 * @since 4623 40 41 */ 41 public final class MultipolygonCache implements DataSetListener, LayerChangeListener, ProjectionChangeListener, SelectionChangedListener {42 public final class MultipolygonCache implements DataSetListener, LayerChangeListener, ProjectionChangeListener, DataSelectionListener { 42 43 43 44 private static final MultipolygonCache INSTANCE = new MultipolygonCache(); … … 49 50 private MultipolygonCache() { 50 51 Main.addProjectionChangeListener(this); 51 DataSet.addSelectionListener(this);52 SelectionEventManager.getInstance().addSelectionListener(this); 52 53 MainApplication.getLayerManager().addLayerChangeListener(this); 53 54 } … … 294 295 295 296 @Override 296 public synchronized void selectionChanged( Collection<? extends OsmPrimitive> newSelection) {297 public synchronized void selectionChanged(SelectionChangeEvent event) { 297 298 298 299 for (Iterator<PolyData> it = selectedPolyData.iterator(); it.hasNext();) { … … 303 304 DataSet ds = null; 304 305 Collection<Map<Relation, Multipolygon>> maps = null; 305 for (OsmPrimitive p : newSelection) {306 for (OsmPrimitive p : event.getSelection()) { 306 307 if (p instanceof Way && p.getDataSet() != null) { 307 308 if (ds == null) {
Note:
See TracChangeset
for help on using the changeset viewer.