SymbolPlaceTool class
Spec 09b D6: places the armed symbol on release.
armed.value == nullis idle: every pointer event is ignored and the cursor is deferred.- A hover (mouse) moves the ghost; a primary press starts a placement and shows the ghost at the press (touch has no hover, F-6); a move while pressed follows; the release places at the snapped release point.
- cancel (a pointer cancel, a tool switch, the layer leaving) drops the press and hides the ghost. The layer still delivers a cancelled press's moves and up (F-6): a pressed move with no live press is ignored, and an up with no live press places nothing.
- It listens to armed: a re-arm while active (a second gallery cell) drops the press, looks up the new ghost path and notifies. The turns and the mirror are kept (Ruling R-B6-2).
- Keys (onKey): R, Shift+R and M turn and mirror the next placement.
- Spec 09c D12: while ghostVisible it listens to the camera, and a
camera change (a wheel zoom, a pan) re-resolves the ghost from the last
pointer's screen point, as
PlacementTooldoes (F-8). The listener goes when the ghost hides, on cancel, on a disarm and on dispose; a re-arm while the ghost is shown listens again and re-resolves the ghost under the pointer. - Spec 09c D6: given the shell's faces, an armed entry tagged
againstWallTag attaches, while object snap is on, to the wall face
WallFaces.attach finds for the raw pointer (capture
kWallAttachPixels / scale, edge snapskSnapAperturePixels / scale): the ghost and the release use the attached transform and the marker is the nearest glyph at the face pointq. While attached,Mmirrors in place andR/Shift+Rchange the turn count only (it applies off the face). After its own commit the tool invalidates the bands, so the next placement sees the one just made as a neighbour. Without faces, nothing attaches: 09b's behaviour.
- Inheritance
-
- Object
- ChangeNotifier
- SymbolPlaceTool
Constructors
-
SymbolPlaceTool(ValueNotifier<
SymbolEntry?> armed, {WallFaces? faces, bool canRotate()?, bool canMirror()?})
Properties
-
armed
→ ValueNotifier<
SymbolEntry?> -
The armed symbol; owned by the shell (spec D8), read here.
final
- canMirror → bool Function()?
-
Whether
Mmirrors the next placement (spec S-9 b, the host'smirror), read at each key and at each use as canRotate; null allows. While it refuses, nothing is placed mirrored, whatever was stored while it allowed (mirrored).final - canRotate → bool Function()?
-
Whether
RandShift+Rturn the next placement (host embedding API spec S-9 b, the host'srotate), read at each key; null allows. A refused key is any other key: it bubbles while armed and is swallowed mid-press. It also bounds the placement: while it refuses, the ghost, the wall attachment and a placement use no turn (quarterTurns keeps the stored one, which returns with the flag; Task 4 review R-1).final - cursor → MouseCursor
-
The pointer's cursor over the layer (spec 03 D5).
InteractionLayerrebuilds itsMouseRegionwhen the tool notifies.no setter - faces → WallFaces?
-
The shell's wall faces (spec 09c D3, D6), or null: no attachment.
final
- ghostAt → Vector2
-
The resolved (snapped) point the ghost's base point sits on, and a
release would place at, while it places freely (attached, spec 09c
D6, ghostAttachment places it instead). Read only; reused.
no setter
- ghostAttachment → WallAttachment?
-
Spec 09c D6: the wall attachment the ghost (and a release) uses, or
null while it places freely.
no setter
- ghostMatrix → GhostMatrix
-
The ghost's reused matrix.
no setter
- ghostPath → Path?
-
The ghost's cached local path, or null while idle.
no setter
- ghostPlacement → Transform2?
-
The ghost's placement transform as last computed on an event, or null
while idle or before the first pointer event.
no setter
- ghostVisible → bool
-
Whether the ghost (and its snap marker) is painted.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isMidShape → bool
-
Spec D6, 12a F-2: true while a press is down.
no setter
- mirrored → bool
-
Whether the next placement is mirrored, as stored; a placement uses it
only while canMirror allows.
no setter
- name → String
-
no setter
- phase → ToolPhase
-
no setter
- quarterTurns → int
-
The rotation, in counter-clockwise quarter turns, of the next placement
as stored; a placement uses it only while canRotate allows.
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 setterinherited
- 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 setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
cancel(
ToolContext ctx) → void - Every cancel path: the press is dropped (its up places nothing) and the ghost hides; the document is never touched. Idempotent: an idle, hidden tool returns before notifying.
-
dispose(
) → void -
Discards any resources used by the object.
override
-
gatesChanged(
) → void - The host's gates may have changed (spec S-9 b): the ghost and its wall attachment are computed again with the turn and the mirror now allowed, so a ghost never shows what a click would not place. The shell calls it when its capabilities change; nothing happens unarmed.
-
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 - Spec D6 Keys, F-12. Idle (nothing armed) every key bubbles.
-
onPointerDown(
ToolPointerEvent e, ToolContext ctx) → void -
onPointerExit(
ToolContext ctx) → void -
onPointerMove(
ToolPointerEvent e, ToolContext ctx) → void -
onPointerUp(
ToolPointerEvent e, ToolContext ctx) → void -
paintOverlay(
Canvas canvas, ViewportTransform camera, Size viewport, PaperPalette paper) → void -
The snap marker, in screen space (
placement_tool.dart's pattern). Attached (spec 09c D6), the nearest glyph at the face pointq. -
paintWorldOverlay(
Canvas canvas, Vector2 origin, double scale, PaperPalette paper) → void -
Spec D6: the cached local path under
translate(−origin) ∘ P, then a cross at the local base point. Allocates no path, transform, matrix or paint:Pis the transform stored on the last event (09c D5, W-15), and the matrix rewrites its linear part only whenPchanged. -
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