Package org.openstreetmap.josm.data.osm
Class DataSelectionListener.SelectionToggleEvent
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.DataSelectionListener.AbstractSelectionEvent
-
- org.openstreetmap.josm.data.osm.DataSelectionListener.SelectionToggleEvent
-
- All Implemented Interfaces:
DataSelectionListener.SelectionChangeEvent
- Enclosing interface:
- DataSelectionListener
public static class DataSelectionListener.SelectionToggleEvent extends DataSelectionListener.AbstractSelectionEvent
Toggle the selected state of a primitive- Since:
- 12048
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<OsmPrimitive>
add
private java.util.Set<OsmPrimitive>
current
private java.util.Set<OsmPrimitive>
remove
-
Constructor Summary
Constructors Constructor Description SelectionToggleEvent(DataSet source, java.util.Set<OsmPrimitive> old, java.util.stream.Stream<OsmPrimitive> toToggle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<OsmPrimitive>
getAdded()
Gets the primitives that have been added to the selection.java.util.Set<OsmPrimitive>
getRemoved()
Gets the primitives that have been removed from the selection.java.util.Set<OsmPrimitive>
getSelection()
Gets the new selection.java.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.data.osm.DataSelectionListener.AbstractSelectionEvent
getOldSelection, getSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.osm.DataSelectionListener.SelectionChangeEvent
isNop
-
-
-
-
Field Detail
-
current
private final java.util.Set<OsmPrimitive> current
-
remove
private final java.util.Set<OsmPrimitive> remove
-
add
private final java.util.Set<OsmPrimitive> add
-
-
Constructor Detail
-
SelectionToggleEvent
public SelectionToggleEvent(DataSet source, java.util.Set<OsmPrimitive> old, java.util.stream.Stream<OsmPrimitive> toToggle)
- Parameters:
source
- The source datasetold
- The old primitives that were previously selected. The caller needs to ensure that this set is not modified.toToggle
- The primitives to toggle.
-
-
Method Detail
-
getSelection
public java.util.Set<OsmPrimitive> getSelection()
Description copied from interface:DataSelectionListener.SelectionChangeEvent
Gets the new selection. New elements are added to the end of the collection.This collection cannot be modified and will not change.
- Returns:
- The new selection
-
getRemoved
public java.util.Set<OsmPrimitive> getRemoved()
Description copied from interface:DataSelectionListener.SelectionChangeEvent
Gets the primitives that have been removed from the selection.Those are the primitives contained in
DataSelectionListener.SelectionChangeEvent.getOldSelection()
but not inDataSelectionListener.SelectionChangeEvent.getSelection()
This collection cannot be modified and will not change.
- Returns:
- The primitives that were removed
-
getAdded
public java.util.Set<OsmPrimitive> getAdded()
Description copied from interface:DataSelectionListener.SelectionChangeEvent
Gets the primitives that have been added to the selection.Those are the primitives contained in
DataSelectionListener.SelectionChangeEvent.getSelection()
but not inDataSelectionListener.SelectionChangeEvent.getOldSelection()
This collection cannot be modified and will not change.
- Returns:
- The primitives that were added
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-