Packagecom.yworks.graph.model
Classpublic class InputModeController
InheritanceInputModeController Inheritance Object

A utility class that offers various implementations of interfaces that can be used by different IInputMode implementations.



Public Properties
 PropertyDefined By
  canvas : CanvasComponent
Gets or sets the canvas to use.
InputModeController
  collectionModel : ICollectionModel
The collection model this instance acts upon.
InputModeController
  inputModeContext : IInputModeContext
The IInputModeContext that is used by this instance.
InputModeController
  itemHitTestable : IHitTestable
[read-only] Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the items contained in the model.
InputModeController
  selectedItemsHandles : ICollectionModel
[read-only] Gets a live collection over the IHandle implementations that have been obtained from the selected items in the collection.
InputModeController
  selectedItemsMovable : IMovable
[read-only] Gets an implementation of the interface that is a live composite of all IMovable implementations of the currently selected items.
InputModeController
  selectedItemsPositionHandler : IPositionHandler
[read-only] Gets an implementation of the IPositionHandler interface that is a live composite of all position handler interfaces provided by the currently selected items.
InputModeController
  selectedMovableItemsHitTestable : IHitTestable
[read-only] Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently selected items that also provide a PositionHandler or IMovable implementation.
InputModeController
  selectionModel : ISelectionModel
The selection model, that will be used by all implementations that use the selection state of an item.
InputModeController
  shouldBeMovableFunction : Function
A Function that is called to determine whether a given selected model item should be movable.
InputModeController
  shouldShowHandlesFunction : Function
A Function that is called to determine whether reshape handles are to be shown for a given selected model item.
InputModeController
  unselectedItemsHitTestable : IHitTestable
[read-only] Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently unselected items.
InputModeController
  unselectedMovableItemsHitTestable : IHitTestable
[read-only] Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently unselected items that also provide a PositionHandler or IMovable implementation.
InputModeController
Public Methods
 MethodDefined By
  
InputModeController(collectionModel:ICollectionModel, inputModeContext:IInputModeContext)
Creates an instance that can be used for the given collection model.
InputModeController
  
dispose():void
Disposes this instance.
InputModeController
  
Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently selected items.
InputModeController
Protected Methods
 MethodDefined By
  
Gets the IHandleProvider for a given item.
InputModeController
  
Returns the IHandles for a given element.
InputModeController
Property Detail
canvasproperty
canvas:CanvasComponent

Gets or sets the canvas to use.


Implementation
    public function get canvas():CanvasComponent
    public function set canvas(value:CanvasComponent):void
collectionModelproperty 
collectionModel:ICollectionModel

The collection model this instance acts upon.


Implementation
    public function get collectionModel():ICollectionModel
    public function set collectionModel(value:ICollectionModel):void
inputModeContextproperty 
inputModeContext:IInputModeContext

The IInputModeContext that is used by this instance.


Implementation
    public function get inputModeContext():IInputModeContext
    public function set inputModeContext(value:IInputModeContext):void

See also

itemHitTestableproperty 
itemHitTestable:IHitTestable  [read-only]

Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the items contained in the model.


Implementation
    public function get itemHitTestable():IHitTestable
selectedItemsHandlesproperty 
selectedItemsHandles:ICollectionModel  [read-only]

Gets a live collection over the IHandle implementations that have been obtained from the selected items in the collection.


Implementation
    public function get selectedItemsHandles():ICollectionModel
selectedItemsMovableproperty 
selectedItemsMovable:IMovable  [read-only]

Gets an implementation of the interface that is a live composite of all IMovable implementations of the currently selected items.


Implementation
    public function get selectedItemsMovable():IMovable
selectedItemsPositionHandlerproperty 
selectedItemsPositionHandler:IPositionHandler  [read-only]

Gets an implementation of the IPositionHandler interface that is a live composite of all position handler interfaces provided by the currently selected items.


Implementation
    public function get selectedItemsPositionHandler():IPositionHandler
selectedMovableItemsHitTestableproperty 
selectedMovableItemsHitTestable:IHitTestable  [read-only]

Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently selected items that also provide a PositionHandler or IMovable implementation.


Implementation
    public function get selectedMovableItemsHitTestable():IHitTestable
selectionModelproperty 
selectionModel:ISelectionModel

The selection model, that will be used by all implementations that use the selection state of an item.


Implementation
    public function get selectionModel():ISelectionModel
    public function set selectionModel(value:ISelectionModel):void
shouldBeMovableFunctionproperty 
shouldBeMovableFunction:Function

A Function that is called to determine whether a given selected model item should be movable.

The implementation has to accept one parameter of type IModelItem and return a Boolean value: function shouldBeMovable( item:IModelItem ):Boolean { .. return true; }

The default value is null.


Implementation
    public function get shouldBeMovableFunction():Function
    public function set shouldBeMovableFunction(value:Function):void

See also

shouldShowHandlesFunctionproperty 
shouldShowHandlesFunction:Function

A Function that is called to determine whether reshape handles are to be shown for a given selected model item.

The implementation has to accept one parameter of type IModelItem and return a Boolean value: function shouldShowHandles( item:IModelItem ):Boolean { .. return true; }

The default value is null.


Implementation
    public function get shouldShowHandlesFunction():Function
    public function set shouldShowHandlesFunction(value:Function):void

See also

unselectedItemsHitTestableproperty 
unselectedItemsHitTestable:IHitTestable  [read-only]

Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently unselected items.


Implementation
    public function get unselectedItemsHitTestable():IHitTestable
unselectedMovableItemsHitTestableproperty 
unselectedMovableItemsHitTestable:IHitTestable  [read-only]

Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently unselected items that also provide a PositionHandler or IMovable implementation.


Implementation
    public function get unselectedMovableItemsHitTestable():IHitTestable
Constructor Detail
InputModeController()Constructor
public function InputModeController(collectionModel:ICollectionModel, inputModeContext:IInputModeContext)

Creates an instance that can be used for the given collection model.

Parameters
collectionModel:ICollectionModel — The model to get the entities from.
 
inputModeContext:IInputModeContext — The context to use for queries that require an input mode context.
Method Detail
dispose()method
public function dispose():void

Disposes this instance.

getHandleProvider()method 
protected function getHandleProvider(item:IModelItem):IHandleProvider

Gets the IHandleProvider for a given item.

Parameters

item:IModelItem — The item to query the provider from.

Returns
IHandleProvider — The provider or null.
getHandles()method 
protected function getHandles(context:IInputModeContext, item:IModelItem):Iterable

Returns the IHandles for a given element.

This implementation delegates to getHandleProvider.

Parameters

context:IInputModeContext — The element to retrieve handles for.
 
item:IModelItem

Returns
Iterable — An iterable or null.
selectedItemsHitTestable()method 
public function selectedItemsHitTestable():IHitTestable

Gets an implementation of the IHitTestable interface that is a live composite of all IHitTestable implementations of the currently selected items.

Returns
IHitTestable — A newly created IHitTestable implementation representing the currently selected items.