C

InputModeContext

An implementation of the IInputModeContext for use within the scope of IInputModes.

Remarks

IInputModes act within an IInputModeContext themselves, the root context being provided by inputModeContext. However, each action performed within the context of these input modes again itself creates a new, nested context. This class serves as base implementation of a nested IInputModeContext. It provides convenience methods to modify the lookup and properly wires up the delegation to the enclosing context.

Members

Show:

Constructors

Creates a new instance of a context that is nested within the parentInputModeContext.

The lookup behavior of this instance will by default delegate all queries to the parentInputModeContext, unless the provided IInputModeContext implements the requested type, already. Then, the input mode instance will be returned.

Use the getDecoratorFor method to add additional lookup behavior to this instance.

Parameters

parentInputModeContext: IInputModeContext
The enclosing context to which lookup calls will be delegated to that will not be answered by this instance.
inputMode?: IInputMode
The optional IInputMode that establishes this nested context. This will be set as the inputMode property, when specified. When omitted, the parentInputModeContext's property will be returned, instead.

Properties

Gets the Canvas that is associated with this context.
readonlyfinal
Tries to retrieve an IGraph instance from an IInputModeContext.
This will use the ILookup and if this yields nothing, it will use the ILookup of the canvasComponent or finally test if it is a GraphComponent to obtain the graph from.
readonly
Gets the radius for hit tests and marquee selection tests in world coordinates.

In the default implementations, this property automatically distinguishes between different radii depending on the last interaction event type.

This value already takes the zoom level into account.

readonlyfinal
Gets the IInputMode which this context conceptually has been created for.

This can be null if this instance is used outside the context of an IInputMode.

When an IInputMode triggers an event, performs an action or invokes a callback that expects an IInputModeContext, typically that context will provide the invoking mode via this property.

readonlyfinal
Gets the current zoom level that is the ratio of world coordinates to screen pixels.
readonlyfinal

Methods

Creates a LookupDecorator<IInputModeContext, TInterface> for this instance that can be used to modify the lookup behavior of this instance.
final

Parameters

interfaceType: Constructor<TInterface>

Return Value

LookupDecorator<IInputModeContext, TInterface>
A helper class to decorate the lookup.
Adds an element to the defs section of the document, if it has not been added yet.
final

Parameters

defsSupport: ISvgDefsCreator
The instance that is used to create and update the element and to query if the element is still referenced

Return Value

string
The id of the element with which it can be referenced using an url reference.
Tries to call invalidateDisplays on the graph obtained from the IInputModeContext.
If the graph instance cannot be found, invalidate will be called instead.
Implements the ILookup interface for this class.
This will delegate to the enclosing IInputModeContext that was specified during construction time, except for any modifications applied to this instance via the getDecoratorFor. By default, any lookup request for a type that the IInputMode passed to the constructor of this instance implements, will yield the input mode instance.
final

Parameters

type: Constructor<T>
The type to request an implementation for.

Return Value

T
An implementation or null

See Also

API
getDecoratorFor

Implements

ILookup.lookup