C

WaitInputMode

An IInputMode implementation that can be used to block user interaction.
ImplementsInheritance Hierarchy

Remarks

Setting the waiting property will try to cancel ongoing edits of the mutexOwner and set the preferred cursor to waitCursor. This mode will try to add itself to the Lookup of the CanvasControl, so that other clients can make use of its functionality.

This mode uses an exclusive controller by default.

Examples

Typically the WaitInputMode is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the waitInputMode property.
Getting the WaitInputMode from its parent input mode
const waitInputMode = mode.waitInputMode
Blocking user interaction during an asynchronous process
graphEditorInputMode.waiting = true
await longRunningAsyncProcess()
graphEditorInputMode.waiting = false

See Also

API

waiting

Members

Show:

Constructors

Creates a new instance of this mode.

Parameters

Properties

Gets the installed controller.
protectedreadonlyfinal
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.

Examples

Disabling the WaitInputMode on its parent input mode
mode.waitInputMode.enabled = false
Retrieves the IInputModeContext this mode has been installed in.
The value will be null if this mode is currently not installed.
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 WaitCursor property.
conversionfinal
Gets or sets the Waiting property.
Setting this property to true will start the waiting process. Setting it to false will end the waiting.
final

Examples

Blocking user interaction during an asynchronous process
const waitInputMode = graphEditorInputMode.waitInputMode
waitInputMode.waiting = true
await longRunningAsyncProcess()
waitInputMode.waiting = false

Methods

Will be called to unconditionally cancel all ongoing edits.

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()
}
Returns if this mode can request the mutex when waiting is set to true.
Called when waiting is finished.
This will reset the preferredCursor and the mutex is released.
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 controller for this mode.

See Also

API
uninstall
Called after cancel has been called.

Can be overridden in subclasses to perform additional actions after the mode has been canceled.

This implementation does nothing.

protected
Called after the active property of the installed ConcurrencyController has been set to true.

Can be overridden in subclasses to perform additional actions after the mode has been activated.

Overriding implementations should call the base implementation.

protected
Called after the active property of the installed ConcurrencyController has been set to false.

Can be overridden in subclasses to perform additional actions after the mode has been deactivated.

Overriding implementations should call the base implementation.

protected
Called after tryStop has been called.

Can be overridden in subclasses to perform additional actions after the mode has been stopped.

This implementation does nothing.

protected
Raises the waiting-ended event.
protected

Parameters

evt: InputModeEventArgs
The InputModeEventArgs instance containing the event data.
Raises the waiting-started event.
protected

Parameters

evt: InputModeEventArgs
The InputModeEventArgs instance containing the event data.
This will initiate the waiting process by trying to requestMutex request the input mutex.
This will set the preferredCursor to waitCursor.
protected
Will be called to request a stop of the current editing progress.
This should stop the current edit, if one is in progress, and possibly commit all pending changes. If stopping is not possible, this method can return false

Return Value

boolean
true if and only if the editing has been stopped or there was no edit in progress
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.

Events

Occurs when the waiting ended.

Properties of

InputModeEventArgs
context: IInputModeContext
Gets the context for the current event.
Occurs when the waiting started.

Properties of

InputModeEventArgs
context: IInputModeContext
Gets the context for the current event.