Ir al contenido

CommandHandler

Defined in: command/CommandHandler.ts:22

Handles high-level editing commands for a diagram. Provides delete, copy, cut, paste, and select-all operations.

new CommandHandler(diagram): CommandHandler

Defined in: command/CommandHandler.ts:31

Diagram

CommandHandler

align(alignment): boolean

Defined in: command/CommandHandler.ts:408

Align selected nodes (needs at least 2). Returns true if aligned.

AlignDirection

boolean


bringToFront(): boolean

Defined in: command/CommandHandler.ts:551

Bring the selected parts to the front (highest z-order in their layer).

boolean


canCopy(): boolean

Defined in: command/CommandHandler.ts:41

Whether copy/paste is available (there is something selected).

boolean


canCopySelection(): boolean

Defined in: command/CommandHandler.ts:644

boolean


canCutSelection(): boolean

Defined in: command/CommandHandler.ts:648

boolean


canDecreaseZoom(): boolean

Defined in: command/CommandHandler.ts:783

GoJS-compatible: Whether decreaseZoom is possible.

boolean


canDeleteSelection(): boolean

Defined in: command/CommandHandler.ts:640

boolean


canDuplicateSelection(): boolean

Defined in: command/CommandHandler.ts:758

GoJS-compatible: Whether duplicateSelection is possible.

boolean


canGroupSelection(): boolean

Defined in: command/CommandHandler.ts:666

GoJS-compatible: Whether groupSelection is possible (>=1 selected node).

boolean


canIncreaseZoom(): boolean

Defined in: command/CommandHandler.ts:771

GoJS-compatible: Whether increaseZoom is possible.

boolean


canPaste(): boolean

Defined in: command/CommandHandler.ts:46

Whether there is content on the clipboard to paste.

boolean


canPasteSelection(): boolean

Defined in: command/CommandHandler.ts:656

boolean


canSelectAll(): boolean

Defined in: command/CommandHandler.ts:652

boolean


canUngroupSelection(): boolean

Defined in: command/CommandHandler.ts:725

GoJS-compatible: Whether ungroupSelection is possible (>=1 selected group).

boolean


canZoomToFit(): boolean

Defined in: command/CommandHandler.ts:802

GoJS-compatible: Whether the diagram can zoom to fit.

boolean


clearClipboard(): void

Defined in: command/CommandHandler.ts:368

Clear the clipboard.

void


copySelection(): boolean

Defined in: command/CommandHandler.ts:175

Copy the selected parts (and their connected links) to the clipboard.

boolean


cutSelection(): boolean

Defined in: command/CommandHandler.ts:216

Cut the selected parts (copy + delete).

boolean


decreaseZoom(factor?): boolean

Defined in: command/CommandHandler.ts:788

GoJS-compatible: Zoom out by a factor.

number = 1.25

boolean


deleteSelection(): boolean

Defined in: command/CommandHandler.ts:56

Delete the currently selected parts (undoable).

boolean


deleteSelectionNoUndo(): boolean

Defined in: command/CommandHandler.ts:154

Delete the selection without undo support. Returns true if any were removed.

boolean


distributeHorizontally(): boolean

Defined in: command/CommandHandler.ts:485

Distribute selected nodes evenly along the horizontal axis. Returns true if done.

boolean


distributeVertically(): boolean

Defined in: command/CommandHandler.ts:518

Distribute selected nodes evenly along the vertical axis. Returns true if done.

boolean


duplicateSelection(): boolean

Defined in: command/CommandHandler.ts:763

GoJS-compatible: Duplicate the selection at a small offset.

boolean


getClipboard(): object

Defined in: command/CommandHandler.ts:356

Get the current clipboard contents.

object

links: readonly NodeData[]

nodes: readonly NodeData[]


getDiagram(): Diagram

Defined in: command/CommandHandler.ts:36

Get the diagram this handler belongs to.

Diagram


groupSelection(): boolean

Defined in: command/CommandHandler.ts:671

GoJS-compatible: Group the selected nodes into a new Group part.

boolean


increaseZoom(factor?): boolean

Defined in: command/CommandHandler.ts:776

GoJS-compatible: Zoom in by a factor.

number = 1.25

boolean


lower(): boolean

Defined in: command/CommandHandler.ts:617

Lower the selected parts by one z-order step.

boolean


nudgeSelection(dx, dy, scale?): boolean

Defined in: command/CommandHandler.ts:383

GoJS-compatible: Nudge the selected parts by the given deltas (arrow keys).

number

number

number = 1

boolean


pasteClipboard(offset?): boolean

Defined in: command/CommandHandler.ts:223

Paste the clipboard (nodes + links) into the diagram (undoable).

number = 20

boolean


pasteClipboardAt(x, y): boolean

Defined in: command/CommandHandler.ts:228

Paste the clipboard so the first node lands at the given position.

number

number

boolean


pasteSelection(position?): boolean

Defined in: command/CommandHandler.ts:814

GoJS-compatible: Paste the current clipboard at the given position, if any.

number

number

boolean


raise(): boolean

Defined in: command/CommandHandler.ts:612

Raise the selected parts by one z-order step.

boolean


redo(): boolean

Defined in: command/CommandHandler.ts:351

Redo the last operation.

boolean


resetZoom(): boolean

Defined in: command/CommandHandler.ts:795

GoJS-compatible: Reset the zoom to 1.

boolean


selectAll(): boolean

Defined in: command/CommandHandler.ts:321

Select all parts in the diagram.

boolean


selectAllInDiagram(): boolean

Defined in: command/CommandHandler.ts:661

GoJS-compatible: Select all parts in the diagram.

boolean


sendToBack(): boolean

Defined in: command/CommandHandler.ts:582

Send the selected parts to the back (lowest z-order in their layer).

boolean


setClipboard(data): void

Defined in: command/CommandHandler.ts:361

Set the clipboard contents.

NodeData[] | { links: NodeData[]; nodes: NodeData[]; }

void


undo(): boolean

Defined in: command/CommandHandler.ts:346

Undo the last operation.

boolean


ungroupSelection(): boolean

Defined in: command/CommandHandler.ts:730

GoJS-compatible: Ungroup the selected groups, releasing their members.

boolean


zoomToFit(): boolean

Defined in: command/CommandHandler.ts:807

GoJS-compatible: Zoom to fit the entire diagram in the viewport.

boolean