An IInputMode that can be used for an overview CanvasComponent.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.OverviewInputMode
See Also
Constructors
Creates a new instance.
Parameters
A map of options to pass to the method.
- autoInvalidate - boolean
Whether the canvas this mode is installed in should automatically be invalidated if the client canvas gets invalidated. This option sets the autoInvalidate property on the created object.
- canvasComponent - CanvasComponent
The canvas this canvas should use to navigate. This option sets the canvasComponent property on the created object.
- template - IVisualTemplate
The template that is used for the visualization of the marquee rectangle. This option sets the template property on the created object.
- mouseWheelBehavior - MouseWheelBehaviors
The behavior of the mouse wheel. This option sets the mouseWheelBehavior property on the created object.
- margins - Insets
The insets in view coordinates that should be used by the updateVisibleArea operation. This option sets the margins property on the created object.
- exclusive - boolean
A value indicating whether this mode will be the only one running when it has the mutex. This option sets the exclusive property on the created object.
- enabled - boolean
The enabled state of this input mode. This option sets the enabled property on the created object.
- priority - number
- defaultCursor - Cursor
The cursor to use whenever no child mode prefers a different cursor. This option sets the defaultCursor property on the created object.
Properties
Gets or sets whether the canvas this mode is installed in should automatically be invalidated if the client canvas gets invalidated.
Remarks
Automatic invalidation will be deferred to avoid too frequent updates of the overview.
To manually update the overview when this property is false
, call the invalidate method on the GraphOverviewComponent.
Gets the list of commands that are available in this instance.
Remarks
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
Gets or sets the canvas this canvas should use to navigate.
See Also
Gets the clickInputMode.
Remarks
If the field has not yet been initialized upon first access, the factory method createClickInputMode will be called.
By default this input mode has a priority of 0
.
Gets the installed controller.
Defined in
Gets or sets the cursor to use whenever no child mode prefers a different cursor.
Remarks
null
See Also
Defined in
Gets or sets the enabled state of this input mode.
Remarks
Defined in
Gets or sets a value indicating whether this mode will be the only one running when it has the mutex.
Remarks
The 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.
Defined in
Gets the HandleInputMode.
Remarks
This mode is responsible for handling the single handle that allows to resize the viewport rectangle.
If the field has not yet been initialized upon first access, the factory method createHandleInputMode will be called.
By default this input mode has a priority of 10
.
Gets the context instance this mode is currently installed in or null
if this instance is not installed.
Remarks
Implements
Gets the KeyboardInputMode.
Remarks
This mode handles all keyboard interaction gestures with the overview control.
If the field has not yet been initialized upon first access, the factory method createKeyboardInputMode will be called.
By default this input mode has a priority of 0
.
Gets and sets the insets in view coordinates that should be used by the updateVisibleArea operation.
Remarks
(5,5,5,5)
.Gets or sets the behavior of the mouse wheel.
Remarks
The behavior can be switched between ZOOM, SCROLL, and NONE. Additionally, this property can be configured to perform the action only when the control is focused.
The configured behavior affects the canvasComponent' viewport.
Gets the MoveInputMode.
Remarks
This mode is responsible for moving the viewport rectangle.
If the field has not yet been initialized upon first access, the factory method createMoveInputMode will be called.
By default this input mode has a priority of 20
.
Gets the IInputMode that currently owns the mutex.
Defined in
Gets the priority of this input mode.
Remarks
See Also
Implements
Gets the tapInputMode.
Remarks
If the field has not yet been initialized upon first access, the factory method createTapInputMode will be called.
By default this input mode has a priority of 30
.
Gets or sets the template that is used for the visualization of the marquee rectangle.
See Also
Methods
Adds the given mode
.
Remarks
The input modes will be ordered according to their priority: Input modes with lower priority will be installed earlier.
Input modes will run exclusively if the exclusive property of their installed controller is set to true
. Otherwise they can not and will not be deactivated if another IInputMode acquires the mutex.
Parameters
A map of options to pass to the method.
- mode - IInputMode
- The input mode to add to this mode.
Throws
- Exception({ name: 'ArgumentError' })
- If the same
mode
has is already added to this instance.
Examples
const multiplexingInputMode = new MultiplexingInputMode()
const waitInputMode = new WaitInputMode()
waitInputMode.priority = 0
multiplexingInputMode.add(waitInputMode)
const moveInputMode = new MoveViewportInputMode()
moveInputMode.priority = 5
multiplexingInputMode.add(moveInputMode)
graphComponent.inputMode = multiplexingInputMode
const mode = new GraphEditorInputMode()
const customInputMode = new CustomInputMode()
customInputMode.priority = 10
mode.add(customInputMode)
Defined in
Adjusts the cursor of the CanvasComponent according to the current input mutex owner or the first mode in the list whose ConcurrencyController returns a non-null preferredCursor.
Remarks
Defined in
Cancels all modes.
Implements
Called by the child context's lookup method.
Parameters
A map of options to pass to the method.
Returns
- ↪any
- The result of the lookup query, or
null
.
See Also
Defined in
Yields an IInputModeContext for the child modes of this mode.
Remarks
Returns
- ↪IInputModeContext
- A new instance that delegates to the parent's context.
Defined in
Factory method for the clickInputMode property.
Remarks
Returns
- ↪ClickInputMode
- a new instance of ClickInputMode
Factory method for the handleInputMode property.
Remarks
Returns
- ↪HandleInputMode
- a new instance of HandleInputMode
Helper method that yields a suitably configured InputModeEventArgs for this input mode.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
An input mode context that is available in the InputModeEventArgs.
Can be
null
in which case a new context for this instance is created automatically.
Returns
- ↪InputModeEventArgs
- An input mode event argument that is configured for this instance.
Defined in
Factory method for the keyboardInputMode property.
Remarks
Returns
- ↪KeyboardInputMode
- a new instance of KeyboardInputMode.
Factory method for the moveInputMode property.
Remarks
Returns
- ↪MoveInputMode
- a new instance of MoveInputMode
Factory method for the tapInputMode property.
Remarks
Returns
- ↪TapInputMode
- a new instance of TapInputMode
Returns a list of all modes managed by this instance in sorted order.
Performs one-time initialization of this instance.
Remarks
This method should not be invoked by subclasses. This will be done automatically upon first installation of this mode.
This code will be executed only once per instance. The inputModeContext property will be null
when this code is executed. This method should not be used to install this mode into a specific canvas. Subclasses should always call base.Initialize()
first.
See Also
Overrides
Installs this mode into the given context that is provided by the canvas.
Remarks
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
A map of options to pass to the method.
- 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 ConcurrencyController for this mode.
See Also
Overrides
Invalidates the canvas this mode is currently installed in.
Defined in
Called after the active property of the installed ConcurrencyController has been set to true
.
Remarks
Defined in
Called after the active property of the installed ConcurrencyController has been set to false
.
Remarks
null
and releases the mutex if the mutex is currently owned by this instance. Also, all concurrent child modes will be disabled.Defined in
Removes the given mode from this compound mode.
Parameters
A map of options to pass to the method.
- mode - IInputMode
- The mode to remove.
Defined in
Called by createKeyboardInputMode to determine which of the built-in ICommands to install.
Remarks
true
, subclasses may override this method to adjust the behavior.Parameters
A map of options to pass to the method.
- command - ICommand
- The command to install.
Returns
- ↪boolean
- Whether to install this command.
Called when the priority of an installed sub mode has changed.
Remarks
Defined in
Tries to stop all modes.
Returns
- ↪boolean
true
if and only if the editing has been stopped or there was no edit in progress
See Also
Implements
Uninstalls this mode from the given context.
Remarks
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
A map of options to pass to the method.
- context - IInputModeContext
- The context to deregister from. This is the same instance that had been passed to install during installation.
Overrides
Updates the zoom and viewpoint of the overview control.
Remarks
Constants
A resource key that should yield a IVisualTemplate that will be used by this mode render the viewport.
Remarks
When explicitly setting a template, this key will not be used. This is only a fallback if template is null
.
The default template has the yfiles-overview-viewport-template
CSS class. It renders the viewport using the secondaryColor of the set theme as stroke and a semi-transparent version of the secondaryColor as fill color.