public class StandardSelectionHandler extends java.lang.Object implements SelectionHandler
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Figure> |
selectionList
list of all figures currently selected
|
Constructor and Description |
---|
StandardSelectionHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addToSelection(Figure figure)
Adds a figure to the current selection.
|
void |
clearSelection()
Clears the current selection.
|
void |
removeFromSelection(Figure figure)
Removes a figure from the selection.
|
java.util.List<Figure> |
selection()
Get an iterator over all selected figures
|
void |
toggleSelection(Figure figure)
If a figure isn't selected it is added to the selection.
|
protected java.util.List<Figure> selectionList
public java.util.List<Figure> selection()
selection
in interface SelectionHandler
public void addToSelection(Figure figure)
addToSelection
in interface SelectionHandler
figure
- the figure to add to the selectionpublic void removeFromSelection(Figure figure)
removeFromSelection
in interface SelectionHandler
figure
- the figure to removepublic void toggleSelection(Figure figure)
toggleSelection
in interface SelectionHandler
figure
- the figure to togglepublic void clearSelection()
clearSelection
in interface SelectionHandler
From the book: Flexible, Reliable Software, © CRC Press 2010. Author: Henrik B. Christensen, Aarhus University, Denmark