The Commands
class exposes a standard set of IGraph-related editing and navigation constants.
Remarks
true
.Type Details
- yFiles module
- view
See Also
Constants
Adds another label to an ILabelOwner.
Remarks
If the parameter to this command is an ILabelOwner instance, then we will use that item. If the parameter is null
and there is exactly one selected ILabelOwner, then we will use the selected item.
The default shortcut for this command is Shift+F2.
See Also
Adjusts the size of the selected group nodes.
Remarks
If the parameter to this command is null
, the sizes of the currently selected group nodes are adjusted. If the parameter is an INode instance, the size of that group node will be adjusted. If the parameter is an IEnumerable<T> instance, then the sizes of all group nodes in that enumeration are adjusted.
The default shortcut for this command is Ctrl-Shift-G.
See Also
Starts edge creation via installed CreateEdgeInputMode instances.
Remarks
Collapses the group node specified by the parameter.
Remarks
If the parameter to this command is null
, the currently selected group nodes are collapsed. If the parameter is an INode instance, that group node will be collapsed. If the parameter is an IEnumerable<T> instance, then all group nodes in that enumeration are collapsed.
The default shortcut for this command is Alt+Left.
See Also
Gets the delete command.
Remarks
Deletes the selected graph items as in the method deleteSelection.
The default shortcut for this command is the Delete key.
Property Value
Clears the selection.
Remarks
See Also
Deselects an item.
Remarks
See Also
Duplicate items of the current IGraph.
Remarks
Remarks
We first determine the item to edit: If the parameter to this command is an IModelItem instance, then we will use that item. If the parameter is null
and there is exactly one selected item, then we will use the selected item.
Then we determine the label to edit from the given item: If the item is an ILabel instance, then that label will be edited. If the item is an ILabelOwner instance with an editable label, then that label will be edited. If the item is an ILabelOwner instance with no editable label, then a new label will be added and edited.
The default shortcut for this command is F2.
See Also
Switches the local root of the current IFoldingView view to the given group node.
Remarks
If the parameter to this command is null
, the currently selected group node is entered. If the parameter is an INode instance that is a group node, that group node will be entered.
The default shortcut for this command is Alt+Down.
See Also
Exits the current local root of the current IFoldingView view to the given parent view.
Remarks
See Also
Expand the group node specified by the parameter.
Remarks
If the parameter to this command is null
, the currently selected group nodes are expanded. If the parameter is an INode instance, that node will be expanded. If the parameter is an IEnumerable<T> instance, then all group nodes in that enumeration are expanded.
The default shortcut for this command is Alt+Right.
See Also
Extend selection down command.
Remarks
Extends the selection downwards.
The default shortcut for this command is Shift+Down.
Extend the selection one level down in the hierarchy.
Remarks
Extends the selection one level down in the hierarchy. This typically adds a child of the currently focused group node to the selection.
The default shortcut for this command is Ctrl+Shift+PageDown.
Property Value
Extend the selection to an element higher up in the hierarchy.
Remarks
Extends the selection one level up in the hierarchy. This typically extends the selection to a child of the currently selected element.
The default shortcut for this command is Ctrl+Shift+PageUp.
Extend selection left command.
Remarks
Extends the selection to the left.
The default shortcut for this command is Shift+Left.
Extend selection right command.
Remarks
Extends the selection to the right.
The default shortcut for this command is Shift+Right.
Extend selection up command.
Remarks
Extends the selection upwards.
The default shortcut for this command is Shift+Up.
Invokes fitContent when executed.
Calls FIT_GRAPH_BOUNDS.
Remarks
The parameter can be either an Insets or convertible that will be used to create an appropriately sized Insets object from.
This command considers margins defined by contentMargins. The margins define the visible whitespace around the actual contentBounds.
The default shortcut for this command is Alt+1
Groups the currently selected items.
Remarks
See Also
Lowers the visual representations of IModelItems one step back.
Remarks
Lowers the main render tree element of IModelItems in their parent group one step back.
GraphEditorInputMode can execute this command if it is installed in a GraphComponent and. As parameter, the following values are accepted:
null
, in which case the selection is lowered or the currentItem if useCurrentItemForCommands is set.- a single IModelItem that shall be lowered.
- an IEnumerable<IModelItem> which shall be lowered.
See Also
Move focus one level down in the hierarchy command.
Remarks
Moves the focus downwards in the hierarchy. This is used for moving the focus from a group node to its children.
The default shortcut for this command is Ctrl+PageDown.
Property Value
Move focus up in the hierarchy command.
Remarks
Moves the focus upwards in the hierarchy. This is used for moving the focus from a node to its containing group node.
The default shortcut for this command is Ctrl+PageUp.
Property Value
Raises the visual representations of IModelItems one step to the front.
Remarks
Raises the main render tree element of IModelItems in their parent group one step to the front.
GraphEditorInputMode can execute this command if it is installed in a GraphComponent. As parameter the following values are accepted:
null
, in which case the selection is raised or the currentItem if useCurrentItemForCommands is set.- a single IModelItem that shall be raised.
- an IEnumerable<IModelItem> which shall be raised.
See Also
Gets the redo command.
Remarks
Redoes the last undone operation using redo.
The default shortcut for this command is Ctrl+Y.
Property Value
Reverses the direction of edges.
Remarks
GraphEditorInputMode can execute this command if it is installed in a GraphComponent. The parameter specifies the edges to be reversed and can be an IEdge, an IEnumerable<IEdge> or null
. If the parameter is null
the currently selected edges will be reversed.
The default shortcut for this command is Ctrl+R.
See Also
Scroll page down.
Remarks
Scrolls the CanvasComponent one page down.
The default shortcut for this command is PageDown.
Property Value
Scroll page left.
Remarks
Scrolls the CanvasComponent one page left.
The default shortcut for this command is Shift+PageUp.
Property Value
Scroll page right.
Remarks
Scrolls the CanvasComponent one page right.
The default shortcut for this command is Shift+PageDown.
Property Value
Scroll page up.
Remarks
Scrolls the CanvasComponent one page up.
The default shortcut for this command is PageUp.
Property Value
Gets the "select all" command.
Remarks
Selects all graph elements as supported by selectAll.
The default shortcut for this command is Ctrl+A.
Property Value
Selects an item.
Remarks
See Also
Sets the currentItem when executed.
Brings the visual representations of IModelItems to the back.
Remarks
Brings the main render tree element of IModelItems in their parent group to the back.
GraphEditorInputMode can execute this command if it is installed in a GraphComponent. As parameter, the following values are accepted:
null
, in which case the selection is brought to the back or the currentItem if useCurrentItemForCommands is set.- a single IModelItem that shall be brought to the back.
- an IEnumerable<IModelItem> which shall be brought to the back.
See Also
Brings the visual representations of IModelItems to the front.
Remarks
Brings the main render tree element of IModelItems in their parent group to the front.
GraphEditorInputMode can execute this command if it is installed in a GraphComponent. As parameter the following values are accepted:
null
, in which case the selection is brought to the front or the currentItem if useCurrentItemForCommands is set.- a single IModelItem that shall be brought to the front.
- an IEnumerable<IModelItem> which shall be brought to the front.
See Also
Toggles the collapsed/expanded state of the currently selected group nodes.
Remarks
If the parameter to this command is null
, the currently selected group nodes are toggled. If the parameter is an INode instance, that group node will be toggled. If the parameter is an IEnumerable<T> instance, then all group nodes in that enumeration are toggled.
The default shortcuts for this command are Alt+Shift+Left and Alt+Shift+Right.
See Also
Toggles the selection state of an item.
Remarks
If the parameter to this command is an IModelItem instance, then the selection state of that item will be toggled. Otherwise, if there is a current item, its selection state will be toggled.
The default shortcut for this command is Ctrl+Space.
See Also
Gets the undo command.
Remarks
Undoes the last operation using undo.
The default shortcut for this command is Ctrl+Z.
Property Value
Ungroups the currently selected items.
Remarks
See Also
Invokes updateContentBounds when executed.
Sets the zoom and the viewPoint in an animated fashion such that the currentItem becomes fully visible.
Remarks
This command considers margins defined by contentMargins. The margins define the visible whitespace around the rectangle in which the respective item is centered. This way it is also possible to get asymmetric whitespace around the item.
If a viewportLimiter is enabled, its bounds are respected such that it may also happen that the item is not fully visible.
Sets the zoom and the viewPoint in an animated fashion such that all items in the selection become fully visible.
Remarks
This command considers margins defined by contentMargins. The margins define the visible whitespace around the rectangle in which the respective items are centered. This way it is also possible to get asymmetric whitespace around the items.
If a viewportLimiter is enabled, its bounds are respected such that it may also happen that the items are not fully visible.
The default shortcut for this command is Alt+2
Static Methods
Converts the given argument to an enum constant of this enum type.
Returns the name of the given enum constant.
Parameters
A map of options to pass to the method.
- value - Command
- The numeric value of an enum constant.
Returns
- ↪string
- The name of the enum constant.
Throws
- Exception({ name: 'Error' })
- If this type is a flags enums, and the provided value doesn't correspond to a single enum constant, or if this enum type contains no constant of the given numeric value.