-
- All Implemented Interfaces:
public final class SelectionHelper<T extends Object, P extends Position2D<P>>Manages multi-element selection and click-selection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSelectionHelper.SelectionBoxAllows basic multi-element box selections.
-
Field Summary
Fields Modifier and Type Field Description private BooleanisBoxSelectionInProgressprivate final Rectanglerectangle
-
Constructor Summary
Constructors Constructor Description SelectionHelper()
-
Method Summary
Modifier and Type Method Description final BooleangetIsBoxSelectionInProgress()Returns whether a box selection is currently occurring. final UnitsetIsBoxSelectionInProgress(Boolean isBoxSelectionInProgress)final RectanglegetRectangle()final SelectionHelper<T, P>begin(Point point)Begins a new selection at the given point. final SelectionHelper<T, P>update(Point point)Updates the selection with a new point. final Unitclose()Closes the selection. final Pair<Node<T>, P>clickSelection(Map<Node<T>, P> nodes, Wormhole2D<P> wormhole)Retrieves the element selected by clicking. final Map<Node<T>, P>boxSelection(Map<Node<T>, P> nodes, Wormhole2D<P> wormhole)Retrieves the elements selected by box selection, thus possibly empty. -
-
Method Detail
-
getIsBoxSelectionInProgress
final Boolean getIsBoxSelectionInProgress()
Returns whether a box selection is currently occurring.
-
setIsBoxSelectionInProgress
final Unit setIsBoxSelectionInProgress(Boolean isBoxSelectionInProgress)
-
getRectangle
final Rectangle getRectangle()
-
begin
final SelectionHelper<T, P> begin(Point point)
Begins a new selection at the given point.
-
update
final SelectionHelper<T, P> update(Point point)
Updates the selection with a new point.
-
clickSelection
final Pair<Node<T>, P> clickSelection(Map<Node<T>, P> nodes, Wormhole2D<P> wormhole)
Retrieves the element selected by clicking. If selection was not done by clicking, null.
-
-
-
-