Ir al contenido

TextEditingTool

Defined in: tool/TextEditingTool.ts:12

Tool for editing text in place (GoJS-compatible). Double-clicking a node with an editable TextBlock in its visual tree shows an HTML input overlay for editing that TextBlock’s text.

new TextEditingTool(): TextEditingTool

TextEditingTool

Tool.constructor

get diagram(): Diagram | null

Defined in: tool/Tool.ts:13

Get the diagram this tool belongs to.

Diagram | null

set diagram(value): void

Defined in: tool/Tool.ts:18

Set the diagram this tool belongs to.

Diagram | null

void

ZoomingTool.diagram


get editingNode(): Node | null

Defined in: tool/TextEditingTool.ts:24

Get the node currently being edited.

Node | null


get editingTextBlock(): TextBlock | null

Defined in: tool/TextEditingTool.ts:29

Get the TextBlock currently being edited, or null.

TextBlock | null


get isActive(): boolean

Defined in: tool/Tool.ts:23

Check if this tool is currently active.

boolean

Tool.isActive


get isEditing(): boolean

Defined in: tool/TextEditingTool.ts:19

Whether text editing is currently active.

boolean


get isEnabled(): boolean

Defined in: tool/Tool.ts:28

Check if this tool is enabled.

boolean

set isEnabled(value): void

Defined in: tool/Tool.ts:33

Enable or disable this tool.

boolean

void

ZoomingTool.isEnabled


get textBlock(): TextBlock | null

Defined in: tool/TextEditingTool.ts:34

GoJS-compatible: The TextBlock currently being edited, or null.

TextBlock | null

cancelEditing(): void

Defined in: tool/TextEditingTool.ts:148

Cancel editing without committing.

void


canStart(_toolName, _e): boolean

Defined in: tool/Tool.ts:105

GoJS-compatible: Determines whether this tool should start given the current event. Override in subclasses to return true when this tool should handle the event.

string

MouseEvent

boolean

Tool.canStart


doActivate(): void

Defined in: tool/Tool.ts:38

Called when the tool becomes the active tool.

void

Tool.doActivate


doClick(_e): void

Defined in: tool/Tool.ts:78

Called when a click event occurs.

MouseEvent

void

Tool.doClick


doDeactivate(): void

Defined in: tool/TextEditingTool.ts:231

Called when the tool is deactivated.

void

Tool.doDeactivate


doDoubleClick(e): void

Defined in: tool/TextEditingTool.ts:222

Begin editing the node under the cursor on double-click.

MouseEvent

void

Tool.doDoubleClick


doKeyDown(_e): void

Defined in: tool/Tool.ts:68

Called when a key down event occurs.

KeyboardEvent

void

Tool.doKeyDown


doKeyUp(_e): void

Defined in: tool/Tool.ts:73

Called when a key up event occurs.

KeyboardEvent

void

Tool.doKeyUp


doMouseDown(_e): void

Defined in: tool/Tool.ts:48

Called when a mouse down event occurs.

MouseEvent

void

Tool.doMouseDown


doMouseMove(_e): void

Defined in: tool/Tool.ts:53

Called when a mouse move event occurs.

MouseEvent

void

Tool.doMouseMove


doMouseUp(_e): void

Defined in: tool/Tool.ts:58

Called when a mouse up event occurs.

MouseEvent

void

Tool.doMouseUp


doMouseWheel(_e): void

Defined in: tool/Tool.ts:63

Called when a mouse wheel event occurs.

WheelEvent

void

Tool.doMouseWheel


doStart(_e): void

Defined in: tool/Tool.ts:90

GoJS-compatible: Called when a tool operation starts (after canStart returns true).

MouseEvent

void

Tool.doStart


doStop(): void

Defined in: tool/Tool.ts:97

GoJS-compatible: Called when a tool operation stops.

void

Tool.doStop


editNode(node): void

Defined in: tool/TextEditingTool.ts:59

Start editing the text of a node (its editable TextBlock or its label).

Node

void


findEditableTextBlock(node): TextBlock | null

Defined in: tool/TextEditingTool.ts:39

Find the first editable TextBlock in a node’s visual tree.

Node

TextBlock | null


findPartAt(x, y): Part | null

Defined in: tool/Tool.ts:110

Find a part at the given diagram coordinates.

number

number

Part | null

Tool.findPartAt


getDiagramPoint(e): object

Defined in: tool/Tool.ts:116

Get the mouse position in diagram coordinates.

MouseEvent

object

x: number

y: number

Tool.getDiagramPoint


stopEditing(commit?): void

Defined in: tool/TextEditingTool.ts:80

Stop editing and commit the current value.

boolean = true

void