| Package | com.yworks.canvas.input |
| Class | public class HandleInputMode |
| Inheritance | HandleInputMode StateMachineInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
IInputMode implementation that can handle a collection
of IHandles.
This mode will render a visual representation of IHandles in
the CanvasComponent and deal with mouse gestures that drag the visual
representations accordingly.
| Property | Defined By | ||
|---|---|---|---|
| active : Boolean
Whether this mode is active. | HandleInputMode | ||
| bridgeUpdateMode : BridgeUpdateMode
Determines whether rendering bridges shall be disabled during the drag. | HandleInputMode | ||
![]() | canceledState : State [read-only]
Returns the canceled state of the state machine. | StateMachineInputMode | |
| cancelRecognizer : Function
The "cancel" state recognizer. | HandleInputMode | ||
![]() | canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | |
| canvasGroupProvider : ICanvasGroupProvider
Gets or sets the canvas object group provider this mode should render the
visual representations of the handles in. | HandleInputMode | ||
![]() | controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | |
| currentHandle : IHandle [read-only]
Gets the handle that is currently being moved or null otherwise. | HandleInputMode | ||
| disableSnappingRecognizer : Function
Gets or sets event recognizer that recognizes when the user temporarily disables snapping. | HandleInputMode | ||
| displayObjectCreator : IDisplayObjectCreator
The IDisplayObjectCreator implementation that creates the
visual representations of the handles. | HandleInputMode | ||
| draggedRecognizer : Function
The "dragged" state recognizer. | HandleInputMode | ||
![]() | enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | |
| enableSnappingRecognizer : Function
Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. | HandleInputMode | ||
| handles : ICollectionModel
Gets or sets the collection of IHandles this mode
manages. | HandleInputMode | ||
![]() | inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | |
![]() | installed : 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 | |
![]() | lastMouseEvent : CanvasMouseEvent [read-only]
Returns the last mouse event. | StateMachineInputMode | |
| preferredCursor : Cursor [override] | HandleInputMode | ||
| pressedRecognizer : Function
The "pressed" state recognizer. | HandleInputMode | ||
| releasedRecognizer : Function
The "released" state recognizer. | HandleInputMode | ||
| snapContext : SnapContext
The SnapContext which manages snapping model items to certain coordinates (e.g. | HandleInputMode | ||
![]() | startState : State [read-only]
Returns the start state of the state machine. | StateMachineInputMode | |
![]() | stateMachine : StateMachine [read-only]
Gets the state machine. | StateMachineInputMode | |
![]() | stoppedState : State [read-only]
Returns the stopped state of the state machine. | StateMachineInputMode | |
| Method | Defined By | ||
|---|---|---|---|
Creates a new mode with no handles initially. | HandleInputMode | ||
Adds a handle to the collection of handles managed by this instance. | HandleInputMode | ||
Factory method that creates and adds
a handle to this mode by wrapping a given MutablePoint
instance. | HandleInputMode | ||
beginDragging(handle:IHandle):void
Method that can be used to initialize the dragging of a given handle by hand. | HandleInputMode | ||
![]() | cancel():void [override]
Runs the machine using the cancel and reset events,
releases the input mutex and returns. | StateMachineInputMode | |
![]() | dispose():void
Disposes this input mode. | AbstractInputMode | |
![]() | install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | |
removeHandle(handle:IHandle):void
Removes a handle from the collection of handles managed by this instance. | HandleInputMode | ||
![]() | resetMachine():void
Runs the machine using a special reset event. | StateMachineInputMode | |
![]() | run(evt:Event):void
Tries to run the virtual machine using the pair of source and event argument
to determine which transition to take. | StateMachineInputMode | |
![]() | stop():Boolean [override]
Runs the machine using a special stop event. | StateMachineInputMode | |
![]() | uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode | |
| Method | Defined By | ||
|---|---|---|---|
arm(evt:StateChangeEvent):void
Transition callback that is invoked when the mouse gets "armed". | HandleInputMode | ||
beginDrag(t:TransitionEvent):void
Called by the state machine if a beginning drag gesture has been recognized. | HandleInputMode | ||
cancelDrag(evt:TransitionEvent):void
Called when the user cancels the dragging of the handle. | HandleInputMode | ||
![]() | canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | |
![]() |
Factory method that creates a canceled State
for the given machine. | StateMachineInputMode | |
Factory method that creates the IDisplayObjectCreator implementation
that creates the handle visualizations. | HandleInputMode | ||
Creates an IInputModeContext for use
with the IHandle interface for the upcoming
drag operation. | HandleInputMode | ||
![]() |
Factory method that creates a start State for the given machine. | StateMachineInputMode | |
![]() |
Factory method that creates the state machine. | StateMachineInputMode | |
![]() |
Factory method that creates a stopped State
for the given machine. | StateMachineInputMode | |
disarm(evt:StateChangeEvent):void
Transition callback that is invoked when the mouse gets "disarmed". | HandleInputMode | ||
endDrag(t:TransitionEvent):void
Called by the state machine once that drag has been finalized. | HandleInputMode | ||
![]() | fireInstalled():void | AbstractInputMode | |
![]() | fireInstalling():void | AbstractInputMode | |
![]() | fireUninstalled():void | AbstractInputMode | |
![]() | fireUninstalling():void | AbstractInputMode | |
getClosestHitHandle(x:Number, y:Number):IHandle
Finds the closest hit handle for the given world coordinate pair. | HandleInputMode | ||
handleDistance(handle:IHandle, x:Number, y:Number):Number
Gets the distance from the mouse to the given handle. | HandleInputMode | ||
![]() | hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | |
initialize():void [override]
Overridden to create the IDisplayObjectCreator that renders the handles. | HandleInputMode | ||
initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void [override]
Initializes the state machine this input mode uses internally to manage its state. | HandleInputMode | ||
installCore(context:IInputModeContext):void [override]
Installs the IDisplayObjectCreator into the canvas at the group provided by canvasGroupProvider. | HandleInputMode | ||
![]() | installListeners():void
Installs all necessary listeners to trigger the run method. | StateMachineInputMode | |
invalidate():void [override]
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | HandleInputMode | ||
![]() | isCancelEvent(evt:Event):Boolean
Method that identifies an event as a cancel event. | StateMachineInputMode | |
![]() | isDisabledEvent(evt:Event):Boolean
Method that identifies an event as a disabled event. | StateMachineInputMode | |
![]() | isEnabledEvent(evt:Event):Boolean
Method that identifies an event as an enabled event. | StateMachineInputMode | |
isHovering(evt:Event):Boolean
Event recognizer callback used to determine whether the mouse is currently hovering
over a handle. | HandleInputMode | ||
![]() | isMutexAquiredEvent(evt:Event):Boolean
Method that identifies an event as a mutexAquired event. | StateMachineInputMode | |
![]() | isMutexLostEvent(evt:Event):Boolean
Method that identifies an event as a mutexLost event. | StateMachineInputMode | |
![]() | isStopEvent(evt:Event):Boolean
Method that identifies an event as a stop event. | StateMachineInputMode | |
![]() | onCancelStateEntered(evt:StateChangeEvent):void
Called when the cancel state has been entered. | StateMachineInputMode | |
![]() | onDisable():void
Runs the state machine using a disable event. | StateMachineInputMode | |
![]() | onDisabled():void
Called when the enabled property changes to false. | AbstractConcurrentInputMode | |
onDrag(t:TransitionEvent):void
Called by the state machine during the drag. | HandleInputMode | ||
onDragCanceled():void
Callback triggered when the drag has been canceled. | HandleInputMode | ||
onDragFinished():void
Callback triggered once the drag has been finalized. | HandleInputMode | ||
onDragStarted():void
Callback triggered when the drag is initialized and has started. | HandleInputMode | ||
onDragStarting():void
Callback triggered when the user starts dragging. | HandleInputMode | ||
![]() | onEnable():void
Runs the state machine using a enable event. | StateMachineInputMode | |
![]() | onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | |
![]() | onMachineReset():void | StateMachineInputMode | |
![]() | onMutexObtained():void [override]
Runs the state machine using a mutex obtained event. | StateMachineInputMode | |
![]() | onMutexReleased():void [override]
Runs the state machine using a mutex lost event. | StateMachineInputMode | |
![]() |
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | |
![]() | onRun(evt:Event):void
Callback method that will be called after the state machine has
been run using the arguments provided. | StateMachineInputMode | |
![]() | onStopStateEntered(evt:StateChangeEvent):void
Called when the cancel state has been entered. | StateMachineInputMode | |
![]() | releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | |
![]() | requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | |
![]() | setLastMouseEvent(evt:CanvasMouseEvent):void | StateMachineInputMode | |
![]() | setPreferredCursorTransition(cursorClass:Class):Function
Factory method that can be used to obtain an listener
implementation that sets the given preferredCursor. | StateMachineInputMode | |
![]() | setResetCursorTransition():Function
Factory method that can be used to obtain a listener implementation
that resets the preferredCursor. | StateMachineInputMode | |
uninstallCore(context:IInputModeContext):void [override]
Removes the IDisplayObjectCreator from the canvas. | HandleInputMode | ||
![]() | uninstallListeners():void
Uninstalls all listeners, this instance has installed on calling intallListeners()
| StateMachineInputMode | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the drag has been canceled. | HandleInputMode | |||
| Dispatched when the drag has been finished. | HandleInputMode | |||
| Dispatched when the drag is initialized and has started. | HandleInputMode | |||
| Dispatched when the drag has started. | HandleInputMode | |||
![]() | Dispatched after the input mode was installed. | AbstractInputMode | ||
![]() | Dispatched before the input mode will be installed. | AbstractInputMode | ||
![]() | Dispatched when the default cursor changed. | AbstractConcurrentInputMode | ||
![]() | Dispatched after the input mode was uninstalled. | AbstractInputMode | ||
![]() | Dispatched before the input mode will be uninstalled. | AbstractInputMode | ||
| active | property |
active:BooleanWhether this mode is active.
If false, no handles will be drawn.
public function get active():Boolean public function set active(value:Boolean):void| bridgeUpdateMode | property |
bridgeUpdateMode:BridgeUpdateModeDetermines whether rendering bridges shall be disabled during the drag.
If no BridgeManager is set as CanvasComponent.bridgeManager
this setting has no effect.
One of the constants defined in class BridgeUpdateMode:
BridgeUpdateMode.ALWAYS: the bridges will be updated during the drag.BridgeUpdateMode.ON_START_AND_END: the bridges will be removed before
and updated after the drag.BridgeUpdateMode.ON_END: the bridges will be updated after the drag.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.
public function get bridgeUpdateMode():BridgeUpdateMode public function set bridgeUpdateMode(value:BridgeUpdateMode):voidSee also
| cancelRecognizer | property |
cancelRecognizer:FunctionThe "cancel" state recognizer.
This recognizer recognizer the cancel during the move.
public function get cancelRecognizer():Function public function set cancelRecognizer(value:Function):void| canvasGroupProvider | property |
canvasGroupProvider:ICanvasGroupProviderGets or sets the canvas object group provider this mode should render the visual representations of the handles in.
public function get canvasGroupProvider():ICanvasGroupProvider public function set canvasGroupProvider(value:ICanvasGroupProvider):void| currentHandle | property |
currentHandle:IHandle [read-only]
Gets the handle that is currently being moved or null otherwise.
public function get currentHandle():IHandle| disableSnappingRecognizer | property |
disableSnappingRecognizer:FunctionGets or sets event recognizer that recognizes when the user temporarily disables snapping.
The default value is EventRecognizers#CTRL_PRESSED.
public function get disableSnappingRecognizer():Function public function set disableSnappingRecognizer(value:Function):void| displayObjectCreator | property |
displayObjectCreator:IDisplayObjectCreator
The IDisplayObjectCreator implementation that creates the
visual representations of the handles.
public function get displayObjectCreator():IDisplayObjectCreator public function set displayObjectCreator(value:IDisplayObjectCreator):void| draggedRecognizer | property |
draggedRecognizer:FunctionThe "dragged" state recognizer.
This recognizer instance will be used to determine when the user is moving a handle.
public function get draggedRecognizer():Function public function set draggedRecognizer(value:Function):void| enableSnappingRecognizer | property |
enableSnappingRecognizer:FunctionGets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping.
The default value is EventRecognizers#CTRL_RELEASED.
public function get enableSnappingRecognizer():Function public function set enableSnappingRecognizer(value:Function):void| handles | property |
handles:ICollectionModel
Gets or sets the collection of IHandles this mode
manages.
public function get handles():ICollectionModel public function set handles(value:ICollectionModel):void| preferredCursor | property |
preferredCursor:Cursor[override] public function get preferredCursor():Cursor public function set preferredCursor(value:Cursor):void| pressedRecognizer | property |
pressedRecognizer:FunctionThe "pressed" state recognizer.
This recognizer instance will be used to determine when the user begins to move a handle.
public function get pressedRecognizer():Function public function set pressedRecognizer(value:Function):void| releasedRecognizer | property |
releasedRecognizer:FunctionThe "released" state recognizer.
This function determines when the user has finished moving the handle.
public function get releasedRecognizer():Function public function set releasedRecognizer(value:Function):void| snapContext | property |
snapContext:SnapContext
The SnapContext which manages snapping model items to certain coordinates (e.g. other items).
If set to null this input mode tries to obtain the SnapContext
from the IInputModeContext.
To explicitly disable snapping, a VoidSnapContext has to be set to this instance.
The default value is .null
public function get snapContext():SnapContext public function set snapContext(value:SnapContext):voidSee also
| HandleInputMode | () | Constructor |
public function HandleInputMode()Creates a new mode with no handles initially.
| addHandle | () | method |
public function addHandle(handle:IHandle):voidAdds a handle to the collection of handles managed by this instance.
Parameters
handle:IHandle — The handle to add.
|
| addPointHandle | () | method |
public function addPointHandle(p:IMutablePoint, cursor:Cursor = null, handleType:uint):IHandle
Factory method that creates and adds
a handle to this mode by wrapping a given MutablePoint
instance.
Parameters
p:IMutablePoint — The point to use as a handle.
| |
cursor:Cursor (default = null) — The cursor to use.
| |
handleType:uint (default = NaN) — the type of the handle to create.
|
IHandle — The added handle.
|
| arm | () | method |
protected function arm(evt:StateChangeEvent):voidTransition callback that is invoked when the mouse gets "armed".
This method will be invoked if the mouse hovers over a handle.
Parameters
evt:StateChangeEvent |
| beginDrag | () | method |
protected function beginDrag(t:TransitionEvent):voidCalled by the state machine if a beginning drag gesture has been recognized.
Parameters
t:TransitionEvent |
| beginDragging | () | method |
public function beginDragging(handle:IHandle):voidMethod that can be used to initialize the dragging of a given handle by hand.
This will simulate the user having initialized a drag of the given handle.
Parameters
handle:IHandle — The handle to be dragged.
|
| cancelDrag | () | method |
protected function cancelDrag(evt:TransitionEvent):voidCalled when the user cancels the dragging of the handle.
Parameters
evt:TransitionEvent |
| createDisplayObjectCreator | () | method |
protected function createDisplayObjectCreator():IDisplayObjectCreator
Factory method that creates the IDisplayObjectCreator implementation
that creates the handle visualizations.
IDisplayObjectCreator — A default implementation.
|
| createHandleInputModeContext | () | method |
protected function createHandleInputModeContext():IInputModeContext
Creates an IInputModeContext for use
with the IHandle interface for the upcoming
drag operation.
IInputModeContext |
| disarm | () | method |
protected function disarm(evt:StateChangeEvent):voidTransition callback that is invoked when the mouse gets "disarmed".
This method will be invoked if the mouse stops hovering over a handle.
Parameters
evt:StateChangeEvent |
| endDrag | () | method |
protected function endDrag(t:TransitionEvent):voidCalled by the state machine once that drag has been finalized.
Parameters
t:TransitionEvent |
| getClosestHitHandle | () | method |
protected function getClosestHitHandle(x:Number, y:Number):IHandleFinds the closest hit handle for the given world coordinate pair.
Parameters
x:Number — The x coordinate in the world coordinate system.
| |
y:Number — The y coordinate in the world coordinate system.
|
IHandle — The closest handle that has been hit or null
|
| handleDistance | () | method |
protected function handleDistance(handle:IHandle, x:Number, y:Number):NumberGets the distance from the mouse to the given handle.
Parameters
handle:IHandle — The handle to check
| |
x:Number — The x world coordinate.
| |
y:Number — The y world coordinate.
|
Number — A distance metric that returns the distance from the mouse
to the handle. If no handle has been hit, the distance is set to Number.MAX_VALUE. |
| initialize | () | method |
override protected function initialize():void
Overridden to create the IDisplayObjectCreator that renders the handles.
| initializeStateMachine | () | method |
override protected function initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):voidInitializes the state machine this input mode uses internally to manage its state.
Parameters
machine:StateMachine — The machine to initialize and configure
| |
startState:State — The start state to use.
| |
canceledState:State — The canceled state to use.
| |
stoppedState:State — The stopped state to use.
| |
finishedState:State — The finished state to use.
|
| installCore | () | method |
override protected function installCore(context:IInputModeContext):void
Installs the IDisplayObjectCreator into the canvas at the group provided by canvasGroupProvider.
Parameters
context:IInputModeContext |
| invalidate | () | method |
override protected function invalidate():voidConvenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
| isHovering | () | method |
protected function isHovering(evt:Event):BooleanEvent recognizer callback used to determine whether the mouse is currently hovering over a handle.
Parameters
evt:Event |
Boolean |
| onDrag | () | method |
protected function onDrag(t:TransitionEvent):voidCalled by the state machine during the drag.
Parameters
t:TransitionEvent |
| onDragCanceled | () | method |
protected function onDragCanceled():voidCallback triggered when the drag has been canceled.
This method dispatches the dragCanceled event.
| onDragFinished | () | method |
protected function onDragFinished():voidCallback triggered once the drag has been finalized.
This method dispatches the dragFinished event.
| onDragStarted | () | method |
protected function onDragStarted():voidCallback triggered when the drag is initialized and has started.
This method dispatches the dragStarted event.
| onDragStarting | () | method |
protected function onDragStarting():voidCallback triggered when the user starts dragging.
This method dispatches the dragStarting event.
| removeHandle | () | method |
public function removeHandle(handle:IHandle):voidRemoves a handle from the collection of handles managed by this instance.
Parameters
handle:IHandle — The handle to remove.
|
| uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):void
Removes the IDisplayObjectCreator from the canvas.
Parameters
context:IInputModeContext — The CanvasComponent this input mode is installed on.
|
| dragCanceled | Event |
com.yworks.canvas.input.DragEventcom.yworks.canvas.input.DragEvent.DRAG_CANCELEDDispatched when the drag has been canceled.
| dragFinished | Event |
com.yworks.canvas.input.DragEventcom.yworks.canvas.input.DragEvent.DRAG_FINISHEDDispatched when the drag has been finished.
| dragStarted | Event |
com.yworks.canvas.input.DragEventcom.yworks.canvas.input.DragEvent.DRAG_STARTEDDispatched when the drag is initialized and has started.
| dragStarting | Event |
com.yworks.canvas.input.DragEventcom.yworks.canvas.input.DragEvent.DRAG_STARTINGDispatched when the drag has started.