SeparatorTool class
Spec 10 D20: the Separator tool (S). A PlacementTool of two clicks
per separator, not chained (R-20): after the second click it waits for
a new first click. Escape cancels a pending start, then returns to the
select tool.
- Points resolve through the drawing tools' chain and mask (05 D4,
kDragSnapMask), as the Line tool's do: decision 17's "existing snaps". - Band trimming (R-21): the second click stores what trimSeparator makes of the two resolved points, over the shell's RoomInputs, with F3's object snap. Nothing when it makes nothing (both ends in one band, or too short): the start stays pending.
- The commit: one
CompoundCommand, the separator's group at the identity and its SeparatorParams, needing structure, components and geometry: one undo step. A refused commit places nothing. - The rubber band is the segment from the start to the hover point, as trimSeparator would store it: computed per pointer move, painted per frame from two stored points.
The inputs are invalidated at every second click, before the trim, and right after the commit (Ruling 10-11): the document's change stream delivers after the current task.
- Inheritance
-
- Object
- ChangeNotifier
- SeparatorTool
Constructors
- SeparatorTool(RoomInputs inputs)
Properties
- acceptingSelf ↔ bool
-
True only while
acceptruns on a self-snap's stored point (Ruling 05-4).getter/setter pairinherited - band → Path
-
Spec 05 D12: reset each frame, never reallocated.
bandPaint's colour and width are set bypaintWorldOverlaybefore it callspaintRubberBand(dark theme spec D5).finalinherited - bandPaint → Paint
-
finalinherited
- cursor → MouseCursor
-
The pointer's cursor over the layer (spec 03 D5).
InteractionLayerrebuilds itsMouseRegionwhen the tool notifies.no setterinherited - debugBand → (Vector2, Vector2)?
-
The rubber band's two points, or null when none is drawn.
no setter
-
fill
→ ValueListenable<
bool> ? -
Spec 05 D13: the shell's Fill toggle. Null, or false: outlines only.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hoverKind → SnapKind?
-
no setterinherited
- hoverPoint → Vector2
-
no setterinherited
- hoverVisible → bool
-
no setterinherited
- inputs → RoomInputs
-
The shell's document adapter, shared with the Room tool and the
separator grips (Ruling 10-11). The tool never disposes it.
final
- isMidShape → bool
-
Spec 12a D6: a point placed and the shape not yet finished. The paths
that change
pointshere (onPointerDown, Enter and Escape inonKey,cancel) each notify.no setterinherited - isPending → bool
-
no setterinherited
- markerPoint → Vector2
-
Where
paintOverlaydraws the snap marker: the resolved hover point. A tool that places its shape somewhere derived from that point overrides it (spec 08 D15, Ruling 08-14: an opening tool marks the point projected onto its host's centreline). Read per frame: an override returns a stored point and allocates nothing.no setterinherited - name → String
-
no setter
- orthoBase → Vector2?
-
Spec 05 D4: the last placed point, or none.
no setterinherited
- phase → ToolPhase
-
no setterinherited
-
points
→ List<
Vector2> -
The placed points, as exact world values (invariant 1).
finalinherited
- 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
-
How a finger's press reaches this tool (spec 14t R-1).
TouchPress.liftunless the tool's down and itscancelexecute nothing.no setterinherited
Methods
-
accept(
Vector2 point, ToolContext ctx) → void -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
cancel(
ToolContext ctx) → void -
Every cancel path (Escape,
ToolController.activate, the layer's deactivate and dispose) drops the pending shape and never touches the document (invariant 3).inherited -
clearShape(
) → void -
commit(
ToolContext ctx, DraftCommand build(), {Set< Capability> needs = const {Capability.geometry}}) → bool -
Ruling 05-3: the permission check runs before
build, so a denied shape allocates no handle.needsis every capability the built command will need (spec 06 D13, Ruling 06-10); 05's shapes need geometry alone. Returns whether the command ran.inherited -
commitShape(
ToolContext ctx, EntityKind kind, GeometryPayload payload, {bool fillable = false}) → bool -
Spec 05 D13: with Fill on and a
fillableshape, one region when the boundary can fill, and the plain boundary when it cannot.inherited -
dispose(
) → void -
Discards any resources used by the object.
inherited
-
finish(
ToolContext ctx) → void - Enter while a shape is pending.
-
hovered(
Vector2 raw) → void -
Runs after every hover's resolution, so
hoverPointis the resolved point. With no start pending there is no rubber band. -
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 -
inherited
-
onPointerDown(
ToolPointerEvent e, ToolContext ctx) → void -
inherited
-
onPointerExit(
ToolContext ctx) → void -
The shape stays: placement is click by click, not a drag.
inherited
-
onPointerMove(
ToolPointerEvent e, ToolContext ctx) → void -
onPointerUp(
ToolPointerEvent e, ToolContext ctx) → void -
inherited
-
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.inherited -
paintRubberBand(
Canvas canvas, Vector2 origin, double scale) → void - The pending separator, trimmed as it would be stored.
-
paintWorldOverlay(
Canvas canvas, Vector2 origin, double scale, PaperPalette paper) → void -
Paints under the overlay's rebased world matrix,
worldToScreen ∘ translate(origin), so coordinates handed tocanvasmust beworld − origin(Ruling 03-3).scaleis the camera's, for stroke widths. Colours come frompaper, as in paintOverlay.inherited -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
selfSnap(
Vector2 raw, double apertureWorld) → Vector2? -
A stored placed point this raw point should land on exactly, or null.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited