Packagecom.yworks.canvas.input
Classpublic class MainInputMode
InheritanceMainInputMode Inheritance MultiplexingInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher
Implements mx.core.IMXMLObject
Subclasses GraphEditorInputMode

A basic input mode implementation that uses multiple minor input modes to handle the basic application needs of a main input mode.

Actionscript:

     var mim:MainInputMode = new MainInputMode();
     graphCanvasComponent.inputMode = mim;
     

MXML SyntaxexpandedHide MXML Syntax
<yworks:GraphCanvasComponent id="graphCanvas"> <yworks:inputMode> <yworks:MainInputMode id="mim"/> </yworks:inputMode> </yworks:GraphCanvasComponent> Further configurations on a mxml created input mode (e.g. setting the moveInputMode property) should be done in an event handler for the installing event. This event will be fired before the input mode is installed.

Note that the properties canvas, collectionModel, and selectionModel are only valid after this input mode is installed. Initialization operations depending on these properties (e.g. adding an event listener to the selectionModel) should be done in a listener for the installed event, which is fired immediately after the input mode is installed.



Public Properties
 PropertyDefined By
  bridgeUpdateMode : BridgeUpdateMode
Determines how bridges shall be rendered during a move or drag.
MainInputMode
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
  clickInputMode : ClickInputMode
The ClickInputMode property.
MainInputMode
  clickModeEnabled : Boolean
Whether the click input mode is enabled.
MainInputMode
  clickModePriority : int
The click mode priority.
MainInputMode
  collectionModel : ICollectionModel
Gets or sets the ICollectionModel of the IModelItem that make up the elements in the view this mode is acting upon.
MainInputMode
  contextMenuInputMode : ContextMenuInputMode
The contextMenuInputMode property.
MainInputMode
  contextMenuModeEnabled : Boolean
Whether the context menu input mode is enabled.
MainInputMode
  contextMenuModePriority : int
The context menu mode priority.
MainInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
 InheriteddefaultCursor : Cursor
The default cursor which is displayed if the active input mode does not have a preferred cursor.
MultiplexingInputMode
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
  handleInputMode : HandleInputMode
The HandleInputMode property.
MainInputMode
  handleModeEnabled : Boolean
Whether the handle input mode is enabled.
MainInputMode
  handleModePriority : int
The handle mode priority.
MainInputMode
  inputModeCanvasGroup : ICanvasObjectGroup
The canvas group that can be used by input modes to add temporary top-level canvas objects to.
MainInputMode
 InheritedinputModeContext : IInputModeContext
[read-only] The context instance this mode is currently installed in or null if this instance is not installed.
AbstractInputMode
 Inheritedinstalled : Boolean
[read-only] Whether this mode is currently installed, i.e if a call to the canvas property will yield a non-null result.
AbstractInputMode
  keyboardInputMode : KeyboardInputMode
The keyboard input mode.
MainInputMode
  keyboardModeEnabled : Boolean
Whether the keyboard input mode is enabled.
MainInputMode
  keyboardModePriority : int
The keyboard mode priority.
MainInputMode
  marqueeSelectionInputMode : MarqueeSelectionInputMode
The MarqueeSelectionInputMode property.
MainInputMode
  marqueeSelectionModeEnabled : Boolean
Whether the marquee selection input mode is enabled.
MainInputMode
  marqueeSelectionModePriority : int
The marquee selection mode priority.
MainInputMode
  moveInputMode : MoveInputMode
The MoveInputMode property.
MainInputMode
  moveModeEnabled : Boolean
Whether the move input mode is enabled.
MainInputMode
  moveModePriority : int
The move mode priority.
MainInputMode
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
  selectionModel : ISelectionModel
Gets or sets the selectionModel property
MainInputMode
  snapContext : SnapContext
The SnapContext instance which handles snapping of moving items to distinct coordinates.
MainInputMode
Protected Properties
 PropertyDefined By
 InheritedchildController : ConcurrencyController
[read-only] The ConcurrencyController that is used to manage the concurrency of the child input modes.
MultiplexingInputMode
  inputModeController : InputModeController
[read-only] Gets or sets the input mode controller helper instance.
MainInputMode
Public Methods
 MethodDefined By
  
MainInputMode(collectionModel:ICollectionModel = null, selectionModel:ISelectionModel = null)
Constructs a new input mode using the given collection of items and a selection model.
MainInputMode
 Inherited
add(inputMode:IInputMode, priority:int = 0):void
Adds an input mode using the given priority to this compound mode.
MultiplexingInputMode
 Inherited
addConcurrent(inputMode:IConcurrentInputMode, priority:int):void
Adds an input mode as a concurrent mode using the given priority to this compound mode.
MultiplexingInputMode
 Inherited
Adjusts the cursor of the CanvasControl according to the current input mutex owner or the first mode in the list that returns a non-null preferredCursor.
MultiplexingInputMode
 Inherited
cancel():void
[override] Cancels all modes.
MultiplexingInputMode
  
Clears the selection on the current selectionModel.
MainInputMode
 Inherited
Callback that creates the IInputModeContext for the child modes of this mode.
MultiplexingInputMode
  
createMoveUnselectedInputMode(modifierRecognizer:Function = null):MoveInputMode
Factory method which creates and configures a MoveInputMode which can move items without selecting them first.
MainInputMode
  
disableAll():void
Disables all submodes.
MainInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
  
Returns an ICanvasGroupProvider instance for this input mode
MainInputMode
 Inherited
Finds the IConcurrentInputMode that currently owns the mutex or null.
MultiplexingInputMode
  
initialized(document:Object, id:String):void
Called automatically by the MXML compiler when the instance is created using an MXML tag.
MainInputMode
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
  
marqueeSelect(marqueeRectangle:IRectangle, items:ICollectionModel):void
Selects the given elements in the editor inside the provided marquee selection rectangle.
MainInputMode
  
marqueeSelectElements(marqueeRectangle:IRectangle):void
Callback that selects the elements in the editor inside the marquee selection rectangle.
MainInputMode
 Inherited
remove(mode:IInputMode):void
Removes the given mode from this compound mode.
MultiplexingInputMode
  
setSelected(item:IModelItem, selected:Boolean):void
Uses the selectionModel to select the given item.
MainInputMode
 Inherited
Returns a list of all modes managed by this instance in sorted order.
MultiplexingInputMode
 Inherited
stop():Boolean
[override] Tries to stop all modes.
MultiplexingInputMode
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
  
childInputModeContextLookup(type:Class):Object
[override] Callback lookup method that will be used by the child IInputModeContext
MainInputMode
 Inherited
Create the ConcurrencyController that is used to manage the concurrency of the child input modes.
MultiplexingInputMode
  
Factory method for the ClickInputMode property.
MainInputMode
  
Factory method for the contextMenuInputMode property.
MainInputMode
  
Factory method for the HandleInputMode property.
MainInputMode
  
Creates the inputModeController that will be used to coordinate the selection and the handles, etc.
MainInputMode
  
Factory method that creates the keyboard input mode instance.
MainInputMode
  
Factory method for the marqueeSelectionInputMode property.
MainInputMode
  
Factory method for the MoveInputMode property.
MainInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
  
initialize():void
[override]
MainInputMode
  
[override] Installs this mode into the given context.
MainInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
  
onClickInputModeChanged(oldClickInputMode:ClickInputMode, newClickInputMode:ClickInputMode):void
Called when the clickInputMode property value changes and after initialization of the field.
MainInputMode
  
Callback that is triggered once clickInputMode triggers the ClickInputMode.CLICK event.
MainInputMode
  
onCollectionModelChanged(oldCollectionModel:ICollectionModel, newCollectionModel:ICollectionModel):void
Callback that gets triggered once the collectionModel property changes.
MainInputMode
  
onContextMenuInputModeChanged(oldContextMenuInputMode:ContextMenuInputMode, newContextMenuInputMode:ContextMenuInputMode):void
Called when the contextMenuInputMode property value changes
MainInputMode
  
Callback that is triggered on a CanvasContextMenuEvent
MainInputMode
 Inherited
onDisabled():void
[override] Called when the AbstractConcurrentInputMode.enabled property changes to false.
MultiplexingInputMode
 Inherited
onEnabled():void
[override] Called when the AbstractConcurrentInputMode.enabled property changes to true.
MultiplexingInputMode
  
onHandleInputModeChanged(oldHandleInputMode:HandleInputMode, newHandleInputMode:HandleInputMode):void
Called when the handleInputMode property value changes and after initialization of the field.
MainInputMode
  
Called when the inputModeCanvasGroup property changes.
MainInputMode
  
onKeyboardInputModeChanged(oldKeyboardInputMode:KeyboardInputMode, newKeyboardInputMode:KeyboardInputMode):void
Called when the keyboard input mode changed.
MainInputMode
  
onMarqueeSelectionInputModeChanged(oldMarqueeSelectionInputMode:MarqueeSelectionInputMode, newMarqueeSelectionInputMode:MarqueeSelectionInputMode):void
Called when the marqueeSelectionInputMode property value changes and after initialization of the field.
MainInputMode
  
Callback used by MarqueeSelectionInputMode if the user has finished creating the marquee selection.
MainInputMode
  
onMoveInputModeChanged(oldMoveInputMode:MoveInputMode, newMoveInputMode:MoveInputMode):void
Called when the moveInputMode property value changes
MainInputMode
  
Callback method that will be triggered when a drag has been finished.
MainInputMode
 Inherited
Called when this instance obtains the InputMutex.
AbstractConcurrentInputMode
 Inherited
Called when this instance released the InputMutex.
AbstractConcurrentInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
  
onSelectionModelChanged(oldSelectionModel:ISelectionModel, newSelectionModel:ISelectionModel):void
Callback that gets triggered once the selectionModel property changes.
MainInputMode
  
onSnapContextChanged(oldSnapContext:SnapContext, newSnapContext:SnapContext):void
MainInputMode
 Inherited
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
Potentially replaces the reported by the current owner's preferredCursor property before it is set on the canvas.
MultiplexingInputMode
 Inherited
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
Callback that determines whether the provided IModelItem should be selected upon marquee selection.
MainInputMode
  
Callback method that is used for InputModeController's shouldBeMovableFunction.
MainInputMode
  
Callback method that is used for InputModeController's shouldShowHandlesFunction.
MainInputMode
 Inherited
[override]
MultiplexingInputMode
Events
 Event Summary Defined By
 InheritedDispatched after the input mode was installed.AbstractInputMode
 InheritedDispatched before the input mode will be installed.AbstractInputMode
 InheritedDispatched when the default cursor changed.AbstractConcurrentInputMode
 InheritedDispatched after the input mode was uninstalled.AbstractInputMode
 InheritedDispatched before the input mode will be uninstalled.AbstractInputMode
Public Constants
 ConstantDefined By
 InheritedINSTALLED : String = installed
[static]
AbstractInputMode
 InheritedINSTALLING : String = installing
[static]
AbstractInputMode
 InheritedPREFERRED_CURSOR_CHANGED : String = preferredCursorChanged
[static]
AbstractConcurrentInputMode
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
bridgeUpdateModeproperty
bridgeUpdateMode:BridgeUpdateMode

Determines how bridges shall be rendered during a move or drag.

Setting this property will update the bridgeUpdateMode property on the current HandleInputMode and MoveInputMode. This property can be overridden by setting the bridgeUpdateMode directly on the submodes. Also, if a new HandleInputMode or MoveInputMode is set after setting this property the new mode's bridgeUpdateMode property won't be changed.

If no BridgeManager is set as CanvasComponent.bridgeManager this setting has no effect.

One of the constants defined in class BridgeUpdateMode:

Note that bridge rendering may dramatically reduce the performance for larger graphs during a move gesture which is why it is disabled per default.

The default value is BridgeUpdateMode.ON_END.


Implementation
    public function get bridgeUpdateMode():BridgeUpdateMode
    public function set bridgeUpdateMode(value:BridgeUpdateMode):void

See also

clickInputModeproperty 
clickInputMode:ClickInputMode

The ClickInputMode property.

If the field has not yet been initialized upon first access, the factory method createClickInputMode will be called. Upon change the onClickInputModeChanged method will be called.

Setting a new ClickInputMode is not allowed after the MainInputMode is installed and will throw an exception.


Implementation
    public function get clickInputMode():ClickInputMode
    public function set clickInputMode(value:ClickInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the MainInputMode is installed.
clickModeEnabledproperty 
clickModeEnabled:Boolean

Whether the click input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get clickModeEnabled():Boolean
    public function set clickModeEnabled(value:Boolean):void
clickModePriorityproperty 
clickModePriority:int

The click mode priority.

The default value is 10.


Implementation
    public function get clickModePriority():int
    public function set clickModePriority(value:int):void
collectionModelproperty 
collectionModel:ICollectionModel

Gets or sets the ICollectionModel of the IModelItem that make up the elements in the view this mode is acting upon.


Implementation
    public function get collectionModel():ICollectionModel
    public function set collectionModel(value:ICollectionModel):void
contextMenuInputModeproperty 
contextMenuInputMode:ContextMenuInputMode

The contextMenuInputMode property.

If the field has not yet been initialized upon first access, the factory method createContextMenuInputMode will be called. Upon change the onContextMenuInputModeChanged method will be called.

Setting a new ContextMenuInputMode is not allowed after the MainInputMode is installed and will throw an exception.


Implementation
    public function get contextMenuInputMode():ContextMenuInputMode
    public function set contextMenuInputMode(value:ContextMenuInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the MainInputMode is installed.
contextMenuModeEnabledproperty 
contextMenuModeEnabled:Boolean

Whether the context menu input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get contextMenuModeEnabled():Boolean
    public function set contextMenuModeEnabled(value:Boolean):void
contextMenuModePriorityproperty 
contextMenuModePriority:int

The context menu mode priority.


Implementation
    public function get contextMenuModePriority():int
    public function set contextMenuModePriority(value:int):void
handleInputModeproperty 
handleInputMode:HandleInputMode

The HandleInputMode property.

If the field has not yet been initialized upon first access, the factory method createHandleInputMode will be called. Upon change the onHandleInputModeChanged method will be called.

Setting a new HandleInputMode is not allowed after the MainInputMode is installed and will throw an exception.


Implementation
    public function get handleInputMode():HandleInputMode
    public function set handleInputMode(value:HandleInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the MainInputMode is installed.
handleModeEnabledproperty 
handleModeEnabled:Boolean

Whether the handle input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get handleModeEnabled():Boolean
    public function set handleModeEnabled(value:Boolean):void
handleModePriorityproperty 
handleModePriority:int

The handle mode priority.

The default value is 0.


Implementation
    public function get handleModePriority():int
    public function set handleModePriority(value:int):void
inputModeCanvasGroupproperty 
inputModeCanvasGroup:ICanvasObjectGroup

The canvas group that can be used by input modes to add temporary top-level canvas objects to.

This group should be placed in front of the content elements in the canvas object tree.


Implementation
    public function get inputModeCanvasGroup():ICanvasObjectGroup
    public function set inputModeCanvasGroup(value:ICanvasObjectGroup):void
inputModeControllerproperty 
inputModeController:InputModeController  [read-only]

Gets or sets the input mode controller helper instance.

The input mode controller is an helper object that collects IHandle and provides meta-IMovable, IReshapeable, and IHitTestable instances that depend on the current selection and collection model.


Implementation
    protected function get inputModeController():InputModeController
keyboardInputModeproperty 
keyboardInputMode:KeyboardInputMode

The keyboard input mode.

Setting a new KeyboardInputMode is not allowed after the MainInputMode is installed and will throw an exception.


Implementation
    public function get keyboardInputMode():KeyboardInputMode
    public function set keyboardInputMode(value:KeyboardInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the MainInputMode is installed.
keyboardModeEnabledproperty 
keyboardModeEnabled:Boolean

Whether the keyboard input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get keyboardModeEnabled():Boolean
    public function set keyboardModeEnabled(value:Boolean):void
keyboardModePriorityproperty 
keyboardModePriority:int

The keyboard mode priority.

The default value is 0.


Implementation
    public function get keyboardModePriority():int
    public function set keyboardModePriority(value:int):void
marqueeSelectionInputModeproperty 
marqueeSelectionInputMode:MarqueeSelectionInputMode

The MarqueeSelectionInputMode property.

If the field has not yet been initialized upon first access, the factory method createMarqueeSelectionInputMode will be called. Upon change the onMarqueeSelectionInputModeChanged method will be called.

Setting a new MarqueeSelectionInputMode is not allowed after the MainInputMode is installed and will throw an exception.


Implementation
    public function get marqueeSelectionInputMode():MarqueeSelectionInputMode
    public function set marqueeSelectionInputMode(value:MarqueeSelectionInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the MainInputMode is installed.
marqueeSelectionModeEnabledproperty 
marqueeSelectionModeEnabled:Boolean

Whether the marquee selection input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get marqueeSelectionModeEnabled():Boolean
    public function set marqueeSelectionModeEnabled(value:Boolean):void
marqueeSelectionModePriorityproperty 
marqueeSelectionModePriority:int

The marquee selection mode priority.

The default value is 50.


Implementation
    public function get marqueeSelectionModePriority():int
    public function set marqueeSelectionModePriority(value:int):void
moveInputModeproperty 
moveInputMode:MoveInputMode

The MoveInputMode property.

If the field has not yet been initialized upon first access, the factory method createMoveInputMode will be called. Upon change the onMoveInputModeChanged method will be called.

Setting a new MoveInputMode is not allowed after the MainInputMode is installed and will throw an exception.


Implementation
    public function get moveInputMode():MoveInputMode
    public function set moveInputMode(value:MoveInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the MainInputMode is installed.
moveModeEnabledproperty 
moveModeEnabled:Boolean

Whether the move input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get moveModeEnabled():Boolean
    public function set moveModeEnabled(value:Boolean):void
moveModePriorityproperty 
moveModePriority:int

The move mode priority.

The default value is 40.


Implementation
    public function get moveModePriority():int
    public function set moveModePriority(value:int):void
selectionModelproperty 
selectionModel:ISelectionModel

Gets or sets the selectionModel property


Implementation
    public function get selectionModel():ISelectionModel
    public function set selectionModel(value:ISelectionModel):void
snapContextproperty 
snapContext:SnapContext

The SnapContext instance which handles snapping of moving items to distinct coordinates. Setting this property to SnapContext.voidInstance will disable snapping, whereas setting it to null will make the child modes use the context from their IInputModeContexts, if available. Upon change the onSnapContextChanged method is called, which will as a side effect configure the snap context to display the SnapResults in the CanvasComponent.

The default value is null.


Implementation
    public function get snapContext():SnapContext
    public function set snapContext(value:SnapContext):void

See also

SnapContext.voidInstance
IInputModeContext
onSnapContextChanged
SnapResult
CanvasComponent
Constructor Detail
MainInputMode()Constructor
public function MainInputMode(collectionModel:ICollectionModel = null, selectionModel:ISelectionModel = null)

Constructs a new input mode using the given collection of items and a selection model.

When no collection and no selection model is provided, they will be set when the input mode is installed on a GraphCanvasComponent.

Parameters
collectionModel:ICollectionModel (default = null) — The collection of the items in the control.
 
selectionModel:ISelectionModel (default = null) — The selection model for the items.
Method Detail
childInputModeContextLookup()method
override protected function childInputModeContextLookup(type:Class):Object

Callback lookup method that will be used by the child IInputModeContext

Parameters

type:Class — The class to lookup

Returns
Object — An implementation of the given type, or null
clearSelection()method 
public function clearSelection():void

Clears the selection on the current selectionModel.

This implementation may be overridden for customizations. All it does is call selectionModel.clear.

createClickInputMode()method 
protected function createClickInputMode():ClickInputMode

Factory method for the ClickInputMode property. This method will be called upon first access to the clickInputMode property.

Returns
ClickInputMode — A new instance of ClickInputMode
createContextMenuInputMode()method 
protected function createContextMenuInputMode():ContextMenuInputMode

Factory method for the contextMenuInputMode property. This method will be called upon first access to the contextMenuInputMode property.

Returns
ContextMenuInputMode — a new instance of ContextMenuInputMode
createHandleInputMode()method 
protected function createHandleInputMode():HandleInputMode

Factory method for the HandleInputMode property. This method will be called upon first access to the handleInputMode property.

Returns
HandleInputMode — A new instance of HandleInputMode
createInputModeController()method 
protected function createInputModeController():InputModeController

Creates the inputModeController that will be used to coordinate the selection and the handles, etc.

The input mode controller is an helper object that collects IHandle and provides meta-IMovable, IReshapeable, and IHitTestable instances that depend on the current selection and collection model.

Returns
InputModeController — An instance of InputModeController
createKeyboardInputMode()method 
protected function createKeyboardInputMode():KeyboardInputMode

Factory method that creates the keyboard input mode instance.

Returns
KeyboardInputMode — A new instance of KeyboardInputMode
createMarqueeSelectionInputMode()method 
protected function createMarqueeSelectionInputMode():MarqueeSelectionInputMode

Factory method for the marqueeSelectionInputMode property. This method will be called upon first access to the marqueeSelectionInputMode property.

Returns
MarqueeSelectionInputMode — a new instance of MarqueeSelectionInputMode
createMoveInputMode()method 
protected function createMoveInputMode():MoveInputMode

Factory method for the MoveInputMode property.

This method will be called upon first access to the MoveInputMode property.

Returns
MoveInputMode — A new instance of MoveInputMode.
createMoveUnselectedInputMode()method 
public function createMoveUnselectedInputMode(modifierRecognizer:Function = null):MoveInputMode

Factory method which creates and configures a MoveInputMode which can move items without selecting them first.

This input mode cannot be set with the moveInputMode but has to be added via the addConcurrent() method:

The following code adds the created input mode such that pressing the shift key will deactivate the input mode and thus restore the default behaviour (create edge on drag, move only selected items):

         var mr:Function = function( event:Event ):Boolean {
                     return event is CanvasMouseEvent && !CanvasMouseEvent(event).shiftKey;
                 };
         var moveMode:MoveInputMode = mainInputMode.createMoveUnselectedInputMode(mr);
         mainInputMode.addConcurrent(moveMode, mainInputMode.moveModePriority - 10);
         
By default, this input mode is always active.

If the created input mode should only be active when the shift key is set, set the modifierRecognizer to EventRecognizers.MOUSE_SHIFT_DOWN

Parameters

modifierRecognizer:Function (default = null) — A function with the signature function( event:Event ):Boolean which returns true when this input mode should be active.

Returns
MoveInputMode

See also

disableAll()method 
public function disableAll():void

Disables all submodes.

This method disables the submodes

getCanvasGroupProvider()method 
public function getCanvasGroupProvider():ICanvasGroupProvider

Returns an ICanvasGroupProvider instance for this input mode

Returns
ICanvasGroupProvider — An ICanvasGroupProvider instance for this input mode
initialize()method 
override protected function initialize():void

initialized()method 
public function initialized(document:Object, id:String):void

Called automatically by the MXML compiler when the instance is created using an MXML tag.

This implementation does nothing.

Parameters

document:Object — The MXML document containing this instance.
 
id:String — The id of this instance.

installCore()method 
override protected function installCore(context:IInputModeContext):void

Installs this mode into the given context.

Installation ususally means registering some event listeners on the canvasComponent or on canvasComponent.root.

Parameters

context:IInputModeContext — the graph canvas that this instance shall be installed into

marqueeSelect()method 
public function marqueeSelect(marqueeRectangle:IRectangle, items:ICollectionModel):void

Selects the given elements in the editor inside the provided marquee selection rectangle.

This implementation iterates over the items and queries them for an implementation of IMarqueeTestable using their ILookup.lookup. This instance will be used to determine whether the item should be selected.

Parameters

marqueeRectangle:IRectangle — The rectangle in world coordinates.
 
items:ICollectionModel — The items to iterate over.

marqueeSelectElements()method 
public function marqueeSelectElements(marqueeRectangle:IRectangle):void

Callback that selects the elements in the editor inside the marquee selection rectangle.

This implementation iterates over all items in the CollectionModel and queries them for an implementation of IMarqueeTestable using their ILookup.lookup. This instance will be used to determine whether the item should be selected.

Parameters

marqueeRectangle:IRectangle — The rectangle in world coordinates.

onClickInputModeChanged()method 
protected function onClickInputModeChanged(oldClickInputMode:ClickInputMode, newClickInputMode:ClickInputMode):void

Called when the clickInputMode property value changes and after initialization of the field.

Parameters

oldClickInputMode:ClickInputMode — the old value
 
newClickInputMode:ClickInputMode — the new value

onClickInputModeClicked()method 
protected function onClickInputModeClicked(evt:ClickEvent):void

Callback that is triggered once clickInputMode triggers the ClickInputMode.CLICK event.

Parameters

evt:ClickEvent

onCollectionModelChanged()method 
protected function onCollectionModelChanged(oldCollectionModel:ICollectionModel, newCollectionModel:ICollectionModel):void

Callback that gets triggered once the collectionModel property changes.

This implementation sets the new collectionModel on the inputModeController

Parameters

oldCollectionModel:ICollectionModel
 
newCollectionModel:ICollectionModel

onContextMenuInputModeChanged()method 
protected function onContextMenuInputModeChanged(oldContextMenuInputMode:ContextMenuInputMode, newContextMenuInputMode:ContextMenuInputMode):void

Called when the contextMenuInputMode property value changes

Parameters

oldContextMenuInputMode:ContextMenuInputMode — the old value
 
newContextMenuInputMode:ContextMenuInputMode — the new value

onContextMenuInputModeMenuSelect()method 
protected function onContextMenuInputModeMenuSelect(evt:CanvasContextMenuEvent):void

Callback that is triggered on a CanvasContextMenuEvent

Parameters

evt:CanvasContextMenuEvent

onHandleInputModeChanged()method 
protected function onHandleInputModeChanged(oldHandleInputMode:HandleInputMode, newHandleInputMode:HandleInputMode):void

Called when the handleInputMode property value changes and after initialization of the field.

Parameters

oldHandleInputMode:HandleInputMode — The old input mode.
 
newHandleInputMode:HandleInputMode — The new input mode.

onInputModeCanvasGroupChanged()method 
protected function onInputModeCanvasGroupChanged(oldGroup:ICanvasObjectGroup, newGroup:ICanvasObjectGroup):void

Called when the inputModeCanvasGroup property changes.

Parameters

oldGroup:ICanvasObjectGroup — The old value.
 
newGroup:ICanvasObjectGroup — The new value.

onKeyboardInputModeChanged()method 
protected function onKeyboardInputModeChanged(oldKeyboardInputMode:KeyboardInputMode, newKeyboardInputMode:KeyboardInputMode):void

Called when the keyboard input mode changed.

Parameters

oldKeyboardInputMode:KeyboardInputMode — The old keyboard input mode.
 
newKeyboardInputMode:KeyboardInputMode — The new keyboard input mode.

onMarqueeSelectionInputModeChanged()method 
protected function onMarqueeSelectionInputModeChanged(oldMarqueeSelectionInputMode:MarqueeSelectionInputMode, newMarqueeSelectionInputMode:MarqueeSelectionInputMode):void

Called when the marqueeSelectionInputMode property value changes and after initialization of the field.

Parameters

oldMarqueeSelectionInputMode:MarqueeSelectionInputMode — the old value, which may be null the first time
 
newMarqueeSelectionInputMode:MarqueeSelectionInputMode — the new value

onMarqueeSelectionInputModeMarqueeSelected()method 
protected function onMarqueeSelectionInputModeMarqueeSelected(evt:Event):void

Callback used by MarqueeSelectionInputMode if the user has finished creating the marquee selection.

This method delegats its work to marqueeSelectElements( IRectangle )

Parameters

evt:Event

onMoveInputModeChanged()method 
protected function onMoveInputModeChanged(oldMoveInputMode:MoveInputMode, newMoveInputMode:MoveInputMode):void

Called when the moveInputMode property value changes

Parameters

oldMoveInputMode:MoveInputMode — the old value
 
newMoveInputMode:MoveInputMode — the new value

onMoveInputModeDragFinished()method 
protected function onMoveInputModeDragFinished(evt:Event):void

Callback method that will be triggered when a drag has been finished.

Parameters

evt:Event — An event of type com.yworks.canvas.input.MoveInputMode.DRAG_FINISHED

onSelectionModelChanged()method 
protected function onSelectionModelChanged(oldSelectionModel:ISelectionModel, newSelectionModel:ISelectionModel):void

Callback that gets triggered once the selectionModel property changes.

This implementation sets the new selectionModel on the inputModeController

Parameters

oldSelectionModel:ISelectionModel — The old value
 
newSelectionModel:ISelectionModel — The new value

onSnapContextChanged()method 
protected function onSnapContextChanged(oldSnapContext:SnapContext, newSnapContext:SnapContext):void

Parameters

oldSnapContext:SnapContext
 
newSnapContext:SnapContext

setSelected()method 
public function setSelected(item:IModelItem, selected:Boolean):void

Uses the selectionModel to select the given item.

Parameters

item:IModelItem — The item to set the selection state on.
 
selected:Boolean — The new selection state.

shouldBeMarqueeSelectable()method 
protected function shouldBeMarqueeSelectable(item:IModelItem):Boolean

Callback that determines whether the provided IModelItem should be selected upon marquee selection.

This implementation always returns true.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether to select the item.
shouldBeMovable()method 
protected function shouldBeMovable(item:IModelItem):Boolean

Callback method that is used for InputModeController's shouldBeMovableFunction.

This implementation always yields true.

Parameters

item:IModelItem — The item to check

Returns
Boolean — Whether to make the object movable.
shouldShowHandles()method 
protected function shouldShowHandles(item:IModelItem):Boolean

Callback method that is used for InputModeController's shouldShowHandlesFunction.

This implementation always yields true.

Parameters

item:IModelItem — The item to check

Returns
Boolean — Whether to show the handles for the given item

See also