FrameShapeTool

See source code
Table of contents

Extends BaseBoxShapeTool.

class FrameShapeTool extends BaseBoxShapeTool {}

Constructor

Constructs a new instance of the StateNode class

Parameters

NameDescription

editor

Editor;

parent


Properties

id

static
static id: string;

initial

static
static initial: string;



children

optional
children?: Record<string, StateNode>;

editor

editor: Editor;

isLockable

isLockable: boolean;

parent

parent: StateNode;

performanceTracker

performanceTracker: PerformanceTracker;

shapeType

shapeType: "frame";

type

type: "branch" | "leaf" | "root";

useCoalescedEvents

useCoalescedEvents: boolean;

Methods

children( )

static
static children(): TLStateNodeConstructor[];

addChild( )

Add a child node to this state node.

addChild(childConstructor: TLStateNodeConstructor): this;

Parameters

NameDescription

childConstructor

Returns

this;

enter( )

enter(info: any, from: string): void;

Parameters

NameDescription

info

any;

from

string;

Returns

void;

exit( )

exit(info: any, to: string): void;

Parameters

NameDescription

info

any;

to

string;

Returns

void;

getCurrent( )

This node's current active child node, if any.

getCurrent(): StateNode | undefined;

getCurrentToolIdMask( )

getCurrentToolIdMask(): string | undefined;

getIsActive( )

Whether this node is active.

getIsActive(): boolean;

getPath( )

This node's path of active state nodes

getPath(): string;

handleEvent( )

handleEvent(info: Exclude<TLEventInfo, TLPinchEventInfo>): void;

Parameters

NameDescription

info

Returns

void;

onCancel( )

optional
onCancel?(info: TLCancelEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onComplete( )

optional
onComplete?(info: TLCompleteEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onCreate( )

onCreate(shape: null | TLShape): void;

Parameters

NameDescription

shape

null | TLShape;

Returns

void;

onDoubleClick( )

optional
onDoubleClick?(info: TLClickEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onEnter( )

optional
onEnter?(info: any, from: string): void;

Parameters

NameDescription

info

any;

from

string;

Returns

void;

onExit( )

optional
onExit?(info: any, to: string): void;

Parameters

NameDescription

info

any;

to

string;

Returns

void;

onInterrupt( )

optional
onInterrupt?(info: TLInterruptEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onKeyDown( )

optional
onKeyDown?(info: TLKeyboardEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onKeyRepeat( )

optional
onKeyRepeat?(info: TLKeyboardEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onKeyUp( )

optional
onKeyUp?(info: TLKeyboardEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onLongPress( )

optional
onLongPress?(info: TLPointerEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onMiddleClick( )

optional
onMiddleClick?(info: TLPointerEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onPointerDown( )

optional
onPointerDown?(info: TLPointerEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onPointerMove( )

optional
onPointerMove?(info: TLPointerEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onPointerUp( )

optional
onPointerUp?(info: TLPointerEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onQuadrupleClick( )

optional
onQuadrupleClick?(info: TLClickEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onRightClick( )

optional
onRightClick?(info: TLPointerEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onTick( )

optional
onTick?(info: TLTickEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onTripleClick( )

optional
onTripleClick?(info: TLClickEventInfo): void;

Parameters

NameDescription

info

Returns

void;

onWheel( )

optional
onWheel?(info: TLWheelEventInfo): void;

Parameters

NameDescription

info

Returns

void;

setCurrentToolIdMask( )

setCurrentToolIdMask(id: string | undefined): void;

Parameters

NameDescription

id

string | undefined;

Returns

void;

transition( )

Transition to a new active child state node.

transition(id: string, info?: any): this;

Example

parentState.transition("childStateA");
parentState.transition("childStateB", { myData: 4 });

Parameters

NameDescription

id

string;

The id of the child state node to transition to.

info

any;

Any data to pass to the onEnter and onExit handlers.

Returns

this;

Prev
EraserTool
Next
FrameShapeUtil