C

OverviewInputMode

An IInputMode that can be used for an overview CanvasComponent.
ImplementsInheritance Hierarchy

Remarks

This mode will add navigation capabilities to the control it is installed in.

The viewport rectangle rendered by the viewportRectangleRenderer is using the yfiles-overview-viewport-template CSS class.

See Also

An example of how to style the viewport rectangle with CSS is given in CSS Styling of Overview Viewport Rectangle .

Developer's Guide

API

canvasComponent, handleInputMode, moveInputMode, keyboardInputMode, clickInputMode

Members

Show:

Constructors

Creates a new instance.

Parameters

Properties

Gets or sets whether the canvas this mode is installed in should automatically be invalidated if the client canvas gets invalidated.

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.

final
Gets the list of commands that are available in this instance.

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

readonlyfinal
Gets or sets the canvas this canvas should use to navigate.
Gets the clickInputMode.

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.

readonlyfinal
Gets and sets the margins in view coordinates that should be used by the updateVisibleArea operation.
This influences the amount of visible whitespace in the view coordinate system around the graph after the contentBounds of the canvasComponent have changed. The default value is (5,5,5,5).
conversionfinal
Gets the installed controller.
protectedreadonlyfinal
Gets or sets the cursor to use whenever no child mode prefers a different cursor.
The default is null
conversionfinal

See Also

Developer's Guide
API
adjustCursor
Gets or sets the enabled state of this input mode.
Clients can use this property to disable or reenable this instance. This will set the enabled property of the installed controller so a disabled instance should never try to acquire the input mutex.
Gets or sets a value indicating whether this mode will be the only one running when it has the mutex.

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.

final
Gets the HandleInputMode.

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.

readonlyfinal
Gets or sets a predicate that is queried by createKeyboardInputMode to determine whether a built-in Command should be installed.
The default value always returns true.
final

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.

readonlyfinal
Gets or sets the behavior of the mouse wheel.

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's viewport.

conversionfinal
Gets the MoveInputMode.

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.

readonlyfinal
Gets the IInputMode that currently owns the mutex.
readonlyfinal

Property Value

The IInputMode that currently owns the mutex or null.
Retrieves the IInputModeContext this mode has been installed in.
The value will be null if this mode is currently not installed. Use createInputModeContext to obtain a context that has this IInputMode as the inputMode.
protectedreadonlyfinal
Gets the priority of this input mode.
The priority will influence the order in which the modes will be installed into the CanvasComponent. The lower the priority value, the earlier it will be installed. If two modes are using the same priority value, the first one to be registered will be installed earlier.
final
Gets or sets the IObjectRenderer<IRectangle> that visualizes the viewport rectangle.
When queried for an IVisualCreator to obtain the visualizations for the viewport rectangle, this renderer is passed instances of IRectangle as render tag.
final

Property Value

The renderer for the viewport rectangle.

See Also

Developer's Guide

Methods

Adds the given mode.

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 cannot and will not be deactivated if another IInputMode acquires the mutex.

final

Parameters

mode: IInputMode
The input mode to add to this mode.

Throws

Exception ({ name: 'ArgumentError' })
If the same mode 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)
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.
This method will set defaultCursor as the current cursor if no other preferredCursor has been specified.
Cancels all modes.
Called by the child context's lookup method.
protected

Parameters

type: Constructor
The type argument passed to lookup.

Return Value

any
The result of the lookup query, or null.

See Also

API
createInputModeContext
Factory method for the clickInputMode property.
This method will be called upon first access to the clickInputMode property.
protected

Return Value

ClickInputMode
a new instance of ClickInputMode
Factory method for the handleInputMode property.
This method will be called upon first access to the handleInputMode property.
protected

Return Value

HandleInputMode
a new instance of HandleInputMode
Yields an IInputModeContext for the child modes of this mode.
This method is called during installation to create a new context for the child modes and can be used by client code to obtain a suitable context object. The parentInputModeContext property is already set when this method is called. lookup calls for the created context will be resolved by this instance's childInputModeContextLookup method.

Return Value

IInputModeContext
A new instance that delegates to the parent's context.
Helper method that yields a suitably configured InputModeEventArgs for this input mode.
protected

Parameters

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.

Return Value

InputModeEventArgs
An input mode event argument that is configured for this instance.
Factory method for the keyboardInputMode property.
This method will be called upon first access to the keyboardInputMode property.
protected

Return Value

KeyboardInputMode
a new instance of KeyboardInputMode.
Factory method for the moveInputMode property.
This method will be called upon first access to the moveInputMode property.
protected

Return Value

MoveInputMode
a new instance of MoveInputMode
Returns a list of all modes managed by this instance sorted by their priority.
final

Return Value

IList<IInputMode>
A list of the modes.
Performs one-time initialization of this instance.

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 parentInputModeContext 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.

protected
Installs this mode into the given context that is provided by the canvas.

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 ConcurrencyController for this mode.

See Also

API
uninstall
Invalidates the canvas this mode is currently installed in.
Called after the active property of the installed ConcurrencyController has been set to true.
This implementation reenables previously disabled concurrent child modes.
protected
Called after the active property of the installed ConcurrencyController has been set to false.
This implementation sets the preferredCursor property to null and releases the mutex if the mutex is currently owned by this instance. Also, all concurrent child modes will be disabled.
protected
Removes the given mode from this compound mode.
final

Parameters

mode: IInputMode
The mode to remove.
Called when the priority of an installed sub mode has changed.
This implementation uninstalls all sub modes and then re-installs them according to their new priorities.
protectedfinal
Tries to stop all modes.

Return Value

boolean
true if the editing process was successfully stopped, or if there was no edit in progress to stop; otherwise, false.
Uninstalls this mode from the given context.

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.
Updates the zoom and viewPoint of the overview control.
This method is called when the graph bounds of the canvasComponent have changed. The contentMargins should be respected.
protected