The interface for the context object that is passed to IInputMode instances during install and uninstall and IDragHandler implementations like IPositionHandler and IHandle to provide additional context for the implementations.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.IInputModeContext
See Also
Properties
Gets the Canvas that is associated with this context.
Remarks
Defined in
Tries to retrieve an IGraph instance from an IInputModeContext.
Remarks
Gets the radius for hit tests and marquee selection tests in world coordinates.
Remarks
In the default implementations this property automatically distinguishes whether to refer to hitTestRadius (for mouse), or hitTestRadiusTouch (for touch).
This value already takes the zoom level into account.
See Also
Defined in
Gets the IInputMode which issued the context object.
Remarks
null
if this context is used outside the context of an IInputMode.Gets the current zoom level that is the ratio of world coordinates to screen pixels.
Defined in
Methods
Adds an element to the defs section of the document, if it has not been added yet.
Parameters
A map of options to pass to the method.
- defsSupport - ISvgDefsCreator
- The instance that is used to create and update the element and to query if the element is still referenced
Returns
- ↪string
- The id of the element with which it can be referenced using an url reference.
Defined in
Tries to call invalidateDisplays on the graph obtains from the IInputModeContext.
Remarks
Returns an instance that implements the given type or null
.
Remarks
null
implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.Type Parameters
- T: any
Parameters
A map of options to pass to the method.
- type - Class<T>
- The type for which an instance shall be returned.
Returns
- ↪T
- an instance that is assignable to type or
null
See Also
$class
property on JavaScript classes inheriting from yFiles classes is only valid once an instance of this subclass was created. Call fixType, first or instantiate the class at least once.Implements
Constants
An empty context where both the input mode and the canvas is null
.
Remarks
Static Methods
Factory method that creates an IInputModeContext that uses the provided parent mode and lookup decoration.
Parameters
A map of options to pass to the method.
- parent - IInputMode
- The input mode this context is created for.
- lookup - ILookup
- The ILookup implementation which is used for this context's lookup method. If one is provided it is used exclusively, i.e. the lookup method returns null if
lookup
returnsnull
. If none is provided, theparent
's inputModeContext's lookup is queried.
createInputModeContext
(parent: IInputMode, lookupCallback: function(Object, Class):Object) : IInputModeContextFactory method that creates an IInputModeContext that uses the provided parent mode and lookup decoration.
Parameters
A map of options to pass to the method.
- parent - IInputMode
- The input mode this context is created for.
- lookupCallback - function(Object, Class):Object
- Callback which is used by this context's lookup method. The callback is used exclusively, i.e. the lookup method returns null if the callback returns
null
.Signature Details
function(subject: any, type: Class) : Object
Callback delegate that can be used to query results of a virtual lookup call on objects that don't necessarily implementILookup
.Parameters
- subject - any
- the subject for which a lookup shall be made
- type - Class
- the type to look up
Returns
- Object
- an instance that can be assigned to type or
null
createInputModeContext
(parent: IInputMode, parentContext: IInputModeContext, lookup: ILookup) : IInputModeContextFactory method that creates an IInputModeContext that uses the provided parent mode, parent context, and lookup decoration.
Parameters
A map of options to pass to the method.
- parent - IInputMode
- The input mode this context is created for.
- parentContext - IInputModeContext
- A wrapped IInputModeContext. This implementation delegates to to this context.
- lookup - ILookup
createInputModeContext
(parent: IInputMode, parentContext: IInputModeContext, lookupCallback: function(Object, Class):Object) : IInputModeContextFactory method that creates an IInputModeContext that uses the provided parent mode, parent context, and lookup decoration.
Parameters
A map of options to pass to the method.
- parent - IInputMode
- The input mode this context is created for.
- parentContext - IInputModeContext
- A wrapped IInputModeContext. This implementation delegates to to this context.
- lookupCallback - function(Object, Class):Object
- A callback which is used for this context's lookup method. The context's lookup will query
lookupCallback
first. If it returnsnull
, theparentContext
's lookup will be queried, then.Signature Details
function(subject: any, type: Class) : Object
Callback delegate that can be used to query results of a virtual lookup call on objects that don't necessarily implementILookup
.Parameters
- subject - any
- the subject for which a lookup shall be made
- type - Class
- the type to look up
Returns
- Object
- an instance that can be assigned to type or
null
createInputModeContext
(canvas: CanvasComponent, parent?: IInputMode, lookup?: ILookup) : IInputModeContextFactory method that creates an IInputModeContext that uses the provided values.
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The CanvasComponent to use, may not be
null
. - parent - IInputMode
- The mode to set as the parent. This may be
null
for the canvas' context. - lookup - ILookup
- The lookup to use.