SelectionHelper

class SelectionHelper<T, P : Position2D<P>>

Manages multi-element selection and click-selection.

Constructors

Link copied to clipboard
fun SelectionHelper()

Types

Link copied to clipboard
class SelectionBox(anchorPoint: Point, movingPoint: Point)

Allows basic multi-element box selections.

Functions

Link copied to clipboard
fun begin(point: Point): SelectionHelper<T, P>

Begins a new selection at the given point.

Link copied to clipboard
fun boxSelection(nodes: Map<Node<T>, P>, wormhole: Wormhole2D<P>): Map<Node<T>, P>

Retrieves the elements selected by box selection, thus possibly empty.

Link copied to clipboard
fun clickSelection(nodes: Map<Node<T>, P>, wormhole: Wormhole2D<P>): Pair<Node<T>, P>?

Retrieves the element selected by clicking. If selection was not done by clicking, null.

Link copied to clipboard
fun close()

Closes the selection.

Link copied to clipboard
fun update(point: Point): SelectionHelper<T, P>

Updates the selection with a new point.

Properties

Link copied to clipboard
var isBoxSelectionInProgress: Boolean = false

Returns whether a box selection is currently occurring.

Link copied to clipboard
val rectangle: Rectangle

The rectangle representing the box. If the rectangle's dimensions are (0, 0), the rectangle is to be considered non-existing.