LayerPanel class
The Layers section (spec 12b D9): a collapsible list of every layer of document, one LayerRow each, with + and delete below.
No copy of the layers. Every build reads document.tables.layers
and drawingLayer(document); the panel rebuilds on
document.commands.changes (every edit is a command) and on
document.tables.changes (a direct table write, which the engine
allows). Both subscriptions are removed on dispose, and moved when the
widget is handed another document.
Each user action is exactly one command through
document.commands.execute; a rename is one SetLayerCommand at
commit, never per keystroke. No widget here writes a table or the
header.
Permissions are read from document.commands.permissions (R-17):
without Capability.structure every control is disabled and nothing is
dispatched (D11, M-12a); the list is still shown, and the header still
collapses it.
Delete is enabled only when the selected row's layer is empty
(layerIsEmpty, D5) — computed for that one row only — with a tooltip
giving the reason otherwise.
editable (host embedding API spec C-5's editLayers, S-9 e) is ANDed
with the permission: false disables every control as a refused
Capability.structure does.
foreground is the paper's foreground, 0xRRGGBB: ACI 7's swatch is
drawn in it, as the style resolver draws the layer.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LayerPanel
Constructors
- LayerPanel({Key? key, required DraftDocument document, int foreground = 0x000000, bool editable = true})
-
const
Properties
- document → DraftDocument
-
final
- editable → bool
-
Whether the host lets the user edit the layers (spec C-5); true is
today's panel.
final
- foreground → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LayerPanel> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited