Packagecom.yworks.graph.model
Classpublic class InputModeController

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
  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 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 interface that is a live composite of all IMovable implementations of the currently unselected items.
InputModeController
Public Methods
 MethodDefined by
  
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  [read-write]

Gets or sets the canvas to use.

Implementation
    public function get canvas():CanvasComponent
    public function set canvas(value:CanvasComponent):void
collectionModelproperty 
collectionModel:ICollectionModel  [read-write]

The collection model this instance acts upon.

Implementation
    public function get collectionModel():ICollectionModel
    public function set collectionModel(value:ICollectionModel):void
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 implementation.

Implementation
    public function get selectedMovableItemsHitTestable():IHitTestable
selectionModelproperty 
selectionModel:ISelectionModel  [read-write]

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  [read-write]

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  [read-write]

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 interface that is a live composite of all IMovable implementations of the currently unselected items.

Implementation
    public function get unselectedMovableItemsHitTestable():IHitTestable
Constructor detail
InputModeController()constructor
public function InputModeController(collectionModel:ICollectionModel)

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

Parameters
collectionModel:ICollectionModel — model to get the entities from.
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(item:IModelItem):Iterable

Returns the IHandles for a given element.

This implementation delegates to getHandleProvider.

Parameters
item:IModelItem — The element to retrieve handles for.

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