Packagecom.yworks.canvas.input
Classpublic class SimpleInputModeContext
InheritanceSimpleInputModeContext Inheritance Object
Implements IInputModeContext

Simple default implementation of IInputModeContext.



Public Properties
 PropertyDefined By
  canvasComponent : CanvasComponent
[read-only] Yields the CanvasComponent on which the mode currently acts.
SimpleInputModeContext
  parentInputMode : IInputMode
[read-only] Yields the IInputMode which issued the context object.
SimpleInputModeContext
Public Methods
 MethodDefined By
  
Main constructor that initializes the state of this instance.
SimpleInputModeContext
  
[static] Factory method that creates a context that uses the provided parent mode to retrieve the various values from.
SimpleInputModeContext
  
create2(parent:AbstractInputMode, lookupCallback:Function):IInputModeContext
[static] Factory method that creates a context that uses the provided parent mode and lookup decoration callback.
SimpleInputModeContext
  
[static] Factory method that creates a context that uses the provided parent mode, parent context, and lookup decoration callback.
SimpleInputModeContext
  
create4(parent:IInputMode, parentContext:IInputModeContext, lookupCallback:Function):IInputModeContext
[static] Factory method that creates a context that uses the provided parent mode, parent context, and lookup decoration callback.
SimpleInputModeContext
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
SimpleInputModeContext
Public Constants
 ConstantDefined By
  EMPTY : IInputModeContext
[static] An empty context where both the inputmode and the canvas is null.
SimpleInputModeContext
Property Detail
canvasComponentproperty
canvasComponent:CanvasComponent  [read-only]

Yields the CanvasComponent on which the mode currently acts.

This can be null if the mode is used outside the context of a CanvasControl.


Implementation
    public function get canvasComponent():CanvasComponent
parentInputModeproperty 
parentInputMode:IInputMode  [read-only]

Yields the IInputMode which issued the context object.

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


Implementation
    public function get parentInputMode():IInputMode
Constructor Detail
SimpleInputModeContext()Constructor
public function SimpleInputModeContext(canvasComponent:CanvasComponent, mode:IInputMode, lookup:ILookup)

Main constructor that initializes the state of this instance.

Parameters
canvasComponent:CanvasComponent — The control to use, may not be null.
 
mode:IInputMode — The mode to set as the parent. This may be null for the canvas' context.
 
lookup:ILookup — The lookup to use.
Method Detail
create1()method
public static function create1(parent:AbstractInputMode, lookup:ILookup = null):IInputModeContext

Factory method that creates a context that uses the provided parent mode to retrieve the various values from. If a lookup is passed, it is used as a lookup decoration.

Parameters

parent:AbstractInputMode
 
lookup:ILookup (default = null)

Returns
IInputModeContext
create2()method 
public static function create2(parent:AbstractInputMode, lookupCallback:Function):IInputModeContext

Factory method that creates a context that uses the provided parent mode and lookup decoration callback.

Parameters

parent:AbstractInputMode
 
lookupCallback:Function

Returns
IInputModeContext
create3()method 
public static function create3(parent:IInputMode, parentContext:IInputModeContext, lookup:ILookup):IInputModeContext

Factory method that creates a context that uses the provided parent mode, parent context, and lookup decoration callback.

Parameters

parent:IInputMode
 
parentContext:IInputModeContext
 
lookup:ILookup

Returns
IInputModeContext
create4()method 
public static function create4(parent:IInputMode, parentContext:IInputModeContext, lookupCallback:Function):IInputModeContext

Factory method that creates a context that uses the provided parent mode, parent context, and lookup decoration callback.

Parameters

parent:IInputMode
 
parentContext:IInputModeContext
 
lookupCallback:Function

Returns
IInputModeContext
lookup()method 
public function lookup(type:Class):Object

Returns an instance that implements the given type or null.

Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile time constraints. An instance implementing this method is not required to return non-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.

Parameters

type:Class — the type for which an instance shall be returned

Returns
Object — an instance that is assignable to type or null
Constant Detail
EMPTYConstant
public static const EMPTY:IInputModeContext

An empty context where both the inputmode and the canvas is null. The lookup always yields null, also.