SelectTool class
Hover, click, shift-click and rubber-band selection (spec 02 D1, D2, D7, D8), Escape and Delete/Backspace (02 D3, D10) — and, since 03, grips:
- press classes;
- move, rotate and reshape drags with object and grid snap;
- one command on release (spec 03 D2, D4, D5).
With gates (host embedding API Slice 4), an application restricts the pick, the band, each drag kind, Delete and the idle keys; without, every gate is open.
- Inheritance
-
- Object
- ChangeNotifier
- Tool
- SelectTool
Constructors
- SelectTool({MoveResolver? moveResolver, SelectGates? gates, MoveAdjuster? moveAdjuster})
Properties
- bandMode → BandMode?
-
Non-null only while a band drag is in progress, for the overlay.
no setter
- bandScreen → Rect?
-
The band rectangle in screen space, for the overlay test.
no setter
- bandStart → Offset?
-
The band's drag-start corner, for the overlay.
no setter
- cursor → MouseCursor
-
The pointer's cursor over the layer (spec 03 D5).
InteractionLayerrebuilds itsMouseRegionwhen the tool notifies.no setteroverride - dragKind → DragKind?
-
The live drag's kind; null unless dragging.
no setter
- gates → SelectGates?
-
What this tool may do, asked live (never captured): the pick at each
press and hover, a drag's gate at the slop and again at the up, the
band at its release, the keys at each key. Null: every gate open, as
SelectGates.all.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isMidShape → bool
-
True while the tool is part-way through a shape; the shell disables
its commands (spec 12a D6). False by default. A tool that changes it
notifies, so a listener on ToolController sees every change.
no setterinherited
- moveAdjuster → MoveAdjuster?
-
Alignment guides spec, C-8: replaces a body move's target after the
snap chain; null: today's move.
final
- moveResolver → MoveResolver?
-
Spec 09c D8: asked during a single-node body drag; null: today's move.
final
- name → String
-
no setteroverride
- phase → ToolPhase
-
no setteroverride
- pressClass → PressClass?
-
What the press landed on; null while idle.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionPreviewTransform → Transform2?
-
The world transform a live move or rotate would apply, for the
overlay's preview (spec 03 D7); null otherwise.
no setteroverride
- touchPress → TouchPress
-
A down only classifies a press and
cancelexecutes nothing, so a finger reaches this tool after the hold-back (spec 14t R-1).no setteroverride
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
cancel(
ToolContext ctx) → void -
Every cancel path — Escape, pointer cancel,
ToolController.activate, the layer's deactivate/dispose — leaves the document byte-identical (spec D5, invariant 2). A selection change made at drag start stands.override -
deleteSelection(
ToolContext ctx) → bool -
Deletes the selection as the idle Delete key does: one command (one
undo step, executed through ToolContext.execute), or none. It acts
only while no gesture runs (idle), is gated by gates'
deletebut not byidleKeys(a command is not a key), and answers whether a command was executed: false mid-gesture, under a closeddelete, with nothing selected, or when every selected object is refused. -
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onKey(
KeyEvent event, ToolContext ctx) → KeyEventResult -
override
-
onPointerDown(
ToolPointerEvent e, ToolContext ctx) → void -
override
-
onPointerExit(
ToolContext ctx) → void -
The host (
InteractionLayer) never forwards an exit while a pointer is captured, so this cancel is unreachable mid-drag (02's amended rule).override -
onPointerMove(
ToolPointerEvent e, ToolContext ctx) → void -
override
-
onPointerUp(
ToolPointerEvent e, ToolContext ctx) → void -
override
-
paintOverlay(
Canvas canvas, ViewportTransform camera, Size viewport, PaperPalette paper) → void -
Paints in screen space, after paintWorldOverlay. Every colour comes
from
paper, the overlay's own set for the paper under it (dark theme spec D5); none is kept in a field initialiser.override -
paintWorldOverlay(
Canvas canvas, Vector2 origin, double scale, PaperPalette paper) → void -
Spec D7: the reshape preview, drawn by the overlay under its rebased
world matrix (Ruling 03-3). One path per frame, independent of the
document and the selection size. An object reshape's preview is its
provider's pieces, in the same one path (07 D11).
override
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited