- I
Remarks
Examples
Typically the NavigationInputMode is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the navigationInputMode property.
const navigationInputMode = mode.navigationInputModeThe NavigationInputMode supports e.g. opening and closing group nodes. These actions can be configured in detail:
// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
// enable expanding and collapsing group nodes
mode.navigationInputMode.allowCollapseGroup = true
mode.navigationInputMode.allowExpandGroup = true
// do not fit the content after expand/collapse
mode.navigationInputMode.fitContentAfterGroupActions = false
// expand/collapse group nodes in a way that their
// top right corner stays at its current coordinates
mode.navigationInputMode.autoGroupNodeAlignmentPolicy =
NodeAlignmentPolicy.TOP_RIGHTIt also reports when groups are opened or collapsed interactively by raising the following events:
// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
mode.navigationInputMode.addEventListener('group-expanding', (evt) => {
const node = evt.item
// do something with the node before it will be expanded
})
mode.navigationInputMode.addEventListener('group-expanded', (evt) => {
const node = evt.item
// do something with the node after it has been expanded
})
mode.navigationInputMode.addEventListener('group-collapsing', () => {
/* same for collapse operations */
})
mode.navigationInputMode.addEventListener('group-collapsed', () => {
/* same for collapse operations */
})See Also
Developer's Guide
Members
Constructors
Parameters
Properties
true.Examples
// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
// enable expanding and collapsing group nodes
mode.navigationInputMode.allowCollapseGroup = true
mode.navigationInputMode.allowExpandGroup = true
// do not fit the content after expand/collapse
mode.navigationInputMode.fitContentAfterGroupActions = false
// expand/collapse group nodes in a way that their
// top right corner stays at its current coordinates
mode.navigationInputMode.autoGroupNodeAlignmentPolicy =
NodeAlignmentPolicy.TOP_RIGHTSee Also
Developer's Guide
API
- collapseGroup, collapseGroupPredicate, FoldingManager
true.Examples
// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
// enable expanding and collapsing group nodes
mode.navigationInputMode.allowCollapseGroup = true
mode.navigationInputMode.allowExpandGroup = true
// do not fit the content after expand/collapse
mode.navigationInputMode.fitContentAfterGroupActions = false
// expand/collapse group nodes in a way that their
// top right corner stays at its current coordinates
mode.navigationInputMode.autoGroupNodeAlignmentPolicy =
NodeAlignmentPolicy.TOP_RIGHTSee Also
Developer's Guide
API
- enterGroupPredicate, FoldingManager
true.Examples
// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
// enable expanding and collapsing group nodes
mode.navigationInputMode.allowCollapseGroup = true
mode.navigationInputMode.allowExpandGroup = true
// do not fit the content after expand/collapse
mode.navigationInputMode.fitContentAfterGroupActions = false
// expand/collapse group nodes in a way that their
// top right corner stays at its current coordinates
mode.navigationInputMode.autoGroupNodeAlignmentPolicy =
NodeAlignmentPolicy.TOP_RIGHTSee Also
Developer's Guide
API
- exitGroupPredicate, FoldingManager
true.Examples
// mode is either an instance of GraphEditorInputMode or GraphViewerInputMode
// enable expanding and collapsing group nodes
mode.navigationInputMode.allowCollapseGroup = true
mode.navigationInputMode.allowExpandGroup = true
// do not fit the content after expand/collapse
mode.navigationInputMode.fitContentAfterGroupActions = false
// expand/collapse group nodes in a way that their
// top right corner stays at its current coordinates
mode.navigationInputMode.autoGroupNodeAlignmentPolicy =
NodeAlignmentPolicy.TOP_RIGHTSee Also
Developer's Guide
API
- expandGroupPredicate, FoldingManager
Examples
navigationMode.autoGroupNodeAlignmentPolicy =
NodeAlignmentPolicy.TOP_RIGHT
graph.groupNodeDefaults.style = new CollapsibleNodeStyleDecorator({
buttonPlacement: InteriorNodeLabelModel.TOP_RIGHT,
})See Also
Developer's Guide
API
- expandGroup, collapseGroup
By default, all supported commands are available
Removing commands from this collection also removes the command bindings registered by this instance.
Add supported commands to make them available in this instance.
Supported commands are
- MOVE_LEFT
- MOVE_RIGHT
- MOVE_UP
- MOVE_DOWN
- MOVE_HIERARCHY_UP
- MOVE_HIERARCHY_DOWN
- MOVE_FOCUS_LEFT
- MOVE_FOCUS_RIGHT
- MOVE_FOCUS_UP
- MOVE_FOCUS_DOWN
- MOVE_FOCUS_HIERARCHY_UP
- MOVE_FOCUS_HIERARCHY_DOWN
- EXTEND_SELECTION_LEFT
- EXTEND_SELECTION_RIGHT
- EXTEND_SELECTION_UP
- EXTEND_SELECTION_DOWN
- EXTEND_SELECTION_HIERARCHY_UP
- EXTEND_SELECTION_HIERARCHY_DOWN
See Also
Developer's Guide
Examples
mode.navigationInputMode.enabled = falseThe value of this property will be delegated to the exclusive property of the controller.
If this mode is marked as exclusive and has the mutex, all other modes added to the same MultiplexingInputMode will be deactivated. Otherwise, it will always run concurrently with all other modes.
Note that collapseGroup and expandGroup only fit the content when autoGroupNodeAlignmentPolicy is NONE.
The default value is false.
Property Value
Property Value
- focusableItems on GraphEditorInputMode or GraphViewerInputMode
- selectableItems on GraphEditorInputMode or GraphViewerInputMode
- selectableItems on this input mode.
Property Value
Examples
Setting nodes and edges as navigable items:
graphComponent.inputMode = new GraphEditorInputMode({
focusableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
selectableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
navigationInputMode: {
selectableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
navigableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
},
})To navigate along the same item type you started with, set the navigablePredicate as follows:
mode.navigationInputMode.navigablePredicate = (item) =>
GraphItemTypes.getItemType(graphComponent.currentItem) ==
GraphItemTypes.getItemType(item)See Also
Examples
mode.navigationInputMode.navigablePredicate = (item) =>
GraphItemTypes.getItemType(graphComponent.currentItem) ==
GraphItemTypes.getItemType(item)null if this mode is currently not installed. Use createInputModeContext to obtain a context that has this IInputMode as the inputMode.Implements
IInputMode.priorityThe selectable items. The default value is NODE.
To modify the items selectable by this mode, you also need to configure the navigableItems accordingly.
Examples
graphComponent.inputMode = new GraphEditorInputMode({
focusableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
selectableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
navigationInputMode: {
selectableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
navigableItems: GraphItemTypes.NODE | GraphItemTypes.EDGE,
},
})Property Value
true if the current item should be used as a fallback; false otherwise, which is the default.If set to true, the direction is interpreted in view coordinates.
Default is true.
Methods
This will be called prior to the uninstalling of this instance and when other input modes temporarily acquire the mutex.
In order to stop an active input mode manually, client code should use the following idiom:
if (!mode.tryStop()) {
mode.cancel()
}Implements
IInputMode.cancelnode argument, as well as an item that belongs to the masterGraph to allow for switching to group nodes which are currently not being displayed in this view.Parameters
- node: INode
- The node that needs to be either part of the current graph, or part of the masterGraph.
See Also
See Also
Parameters
- direction: MoveFocusDirection
- The direction to move the focus and extend the selection.
The default implementation uses the Euclidean distance from the location of the startItem, which is additionally weighted to prefer items in the geometric direction. This method is called by the default implementation of findNextItem when MoveFocusDirection corresponds to an actual direction in the geometric sense. The method will be called at most twice by the default implementation of findNextItem. If it returns null the first time with a smaller set of possible candidates, the default implementation will call it again with more possible candidates.
Note that the default implementation ignores any projection and treats directions to be in world coordinates unless useViewCoordinates is set.
Parameters
- context: IInputModeContext
- The current input mode context.
- startItem: IModelItem
- The currently selected item reference location for the gesture.
- direction: MoveFocusDirection
- The direction for the move action.
- itemsToCheck: IEnumerable<IModelItem>
- The items that should be considered. Note that this will include
startItem, but obviously this should not normally be returned, when other candidates are better matches.
Return Value
- IModelItem
- The nearest item in
directionornullif no suitable item can be determined.
Parameters
- context: IInputModeContext
- The current input mode context.
- direction: MoveFocusDirection
- The direction of the command.
Return Value
- IModelItem
- The next item in
direction, ornull.
Parameters
- item: IModelItem
- The item to get a reference location for.
Return Value
- Point
- The reference location for the given item.
In general a mode can only be installed into a single canvas at all times.
This method is called to initialize this instance. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.
Overriding implementations should call the base implementation first.
Parameters
- context: IInputModeContext
- The context that this instance shall be installed into. The same instance will be passed to this instance during uninstall. A reference to the context may be kept and queried during the time the mode is installed.
- controller: ConcurrencyController
- The controller for this mode.
See Also
API
- uninstall
Implements
IInputMode.installParameters
- direction: MoveFocusDirection
- The direction to move the focus.
Parameters
- direction: MoveFocusDirection
- The direction to move the focus and selection.
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation does nothing.
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- evt: InputModeItemEventArgs<INode>
- The InputModeItemEventArgs<TModelItem> instance containing the event data.
Parameters
- graphComponent: GraphComponent
- The graphComponent to set the current item of.
- item: IModelItem
- The item to set.
Return Value
- boolean
- Whether the operation was actually performed.
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
Parameters
- graphComponent: GraphComponent
- The graphComponent.
- item: IModelItem
- The item to select.
- extendSelection: boolean
- if set to
truethe current selection is extended; otherwise, it is cleared beforehand.
See Also
null.Parameters
- item: IModelItem
- The item to set as the current item.
See Also
This resets the state of any other input mode, unless it currently possesses the mutex.
The value of this method is queried for COLLAPSE_GROUP, EXPAND_GROUP, TOGGLE_EXPANSION_STATE, ENTER_GROUP and EXIT_GROUP.
Return Value
- boolean
- whether the input mode should request the mutex.
This code should clean up all changes made to the canvas in the install method. After a mode has been uninstalled it can be installed again into the same or another canvas.
Overriding implementations should call the base implementation after their own code.
Parameters
- context: IInputModeContext
- The context to deregister from. This is the same instance that had been passed to install during installation.
Implements
IInputMode.uninstallEvents
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Properties of
InputModeItemEventArgs<INode>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.