Packagecom.yworks.graph.input
Classpublic class EdgeDragInputModeBase
InheritanceEdgeDragInputModeBase Inheritance StateMachineInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher
Subclasses CreateBendInputMode

A base class IInputMode that can be used to detect mouse drags on IEdges.

See also

CreateBendInputMode
IInputModeContext
IEdge


Public Properties
 PropertyDefined By
  beginHitTestable : IHitTestable
Gets or sets the IHitTestable that determines where bends may be created.
EdgeDragInputModeBase
 InheritedcanceledState : State
[read-only] Returns the canceled state of the state machine.
StateMachineInputMode
  cancelRecognizer : Function
Gets or sets the "cancel" recognizer.
EdgeDragInputModeBase
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
  draggedRecognizer : Function
Gets or sets the "dragged" recognizer.
EdgeDragInputModeBase
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
  graph : IGraph
Gets the Graph this mode is acting upon.
EdgeDragInputModeBase
 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
 InheritedlastMouseEvent : CanvasMouseEvent
[read-only] Returns the last mouse event.
StateMachineInputMode
  location : IPoint
[read-only] Gets the location where the bend creation gesture was initialized.
EdgeDragInputModeBase
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
  pressedRecognizer : Function
Gets or sets the "pressed" state recognizer.
EdgeDragInputModeBase
  releasedRecognizer : Function
Gets or sets the "released" recognizer.
EdgeDragInputModeBase
 InheritedstartState : State
[read-only] Returns the start state of the state machine.
StateMachineInputMode
 InheritedstateMachine : StateMachine
[read-only] Gets the state machine.
StateMachineInputMode
 InheritedstoppedState : State
[read-only] Returns the stopped state of the state machine.
StateMachineInputMode
Protected Properties
 PropertyDefined By
  _beginHitTestable : IHitTestable
EdgeDragInputModeBase
  _cancelRecognizer : Function
EdgeDragInputModeBase
  _draggedRecognizer : Function
EdgeDragInputModeBase
  _firstPoint : YPoint
EdgeDragInputModeBase
  _graph : IGraph
EdgeDragInputModeBase
 Inherited_lastEvent : Event
The last Event that has been delivered to this instance.
StateMachineInputMode
 Inherited_lastMouseEvent : CanvasMouseEvent
The last MouseEvent that has been delivered to this instance.
StateMachineInputMode
  _pressedRecognizer : Function
EdgeDragInputModeBase
  _releasedRecognizer : Function
EdgeDragInputModeBase
 InheritedstopEventRecognizer : Function
[read-only] An event recognizer for the state machine that is triggered if this mode has been stoppped.
StateMachineInputMode
Public Methods
 MethodDefined By
  
Creates a new instance using the given graph to create the bends in.
EdgeDragInputModeBase
 Inherited
cancel():void
[override] Runs the machine using the cancel and reset events, releases the input mutex and returns.
StateMachineInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
  
getEdge(x:Number, y:Number):IEdge
Finds the edge at the given coordinate.
EdgeDragInputModeBase
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
 Inherited
Runs the machine using a special reset event.
StateMachineInputMode
 Inherited
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
 Inherited
stop():Boolean
[override] Runs the machine using a special stop event.
StateMachineInputMode
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
 Inherited
Factory method that creates a canceled State for the given machine.
StateMachineInputMode
  
Creates an IInputModeContext for use in CreateBendInputMode#createBend.
EdgeDragInputModeBase
 Inherited
Factory method that creates a start State for the given machine.
StateMachineInputMode
 Inherited
Factory method that creates the state machine.
StateMachineInputMode
 Inherited
Factory method that creates a stopped State for the given machine.
StateMachineInputMode
  
dragEdgeSegment(edge:IEdge, dragLocation:IPoint):void
Callback method to be implemented by subclasses that is invoked whenever a drag gesture has been recognized by this mode.
EdgeDragInputModeBase
  
Callback that is triggered when a drag on an edge segment has been recognized.
EdgeDragInputModeBase
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void
[override] Called to initialize the state machine.
EdgeDragInputModeBase
 Inherited
[override] Installs this mode into the given canvas.
StateMachineInputMode
 Inherited
Installs all necessary listeners to trigger the run method.
StateMachineInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
 Inherited
isCancelEvent(evt:Event):Boolean
Method that identifies an event as a cancel event.
StateMachineInputMode
 Inherited
isDisabledEvent(evt:Event):Boolean
Method that identifies an event as a disabled event.
StateMachineInputMode
 Inherited
isEnabledEvent(evt:Event):Boolean
Method that identifies an event as an enabled event.
StateMachineInputMode
 Inherited
isMutexAquiredEvent(evt:Event):Boolean
Method that identifies an event as a mutexAquired event.
StateMachineInputMode
 Inherited
isMutexLostEvent(evt:Event):Boolean
Method that identifies an event as a mutexLost event.
StateMachineInputMode
 Inherited
isStopEvent(evt:Event):Boolean
Method that identifies an event as a stop event.
StateMachineInputMode
  
isValidBegin(evt:Event):Boolean
Determines whether the current location and event is valid to begin a bend creation gesture.
EdgeDragInputModeBase
  
Callback that is triggered when a drag on an edge segment has been canceled.
EdgeDragInputModeBase
 Inherited
Called when the cancel state has been entered.
StateMachineInputMode
 Inherited
onDisable():void
Runs the state machine using a disable event.
StateMachineInputMode
 Inherited
onDisabled():void
Called when the enabled property changes to false.
AbstractConcurrentInputMode
 Inherited
onEnable():void
Runs the state machine using a enable event.
StateMachineInputMode
 Inherited
onEnabled():void
Called when the enabled property changes to true.
AbstractConcurrentInputMode
  
onGraphChanged(oldGraph:IGraph, newGraph:IGraph):void
Called when the graph property changes.
EdgeDragInputModeBase
 Inherited
StateMachineInputMode
 Inherited
[override] Runs the state machine using a mutex obtained event.
StateMachineInputMode
 Inherited
[override] Runs the state machine using a mutex lost event.
StateMachineInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
  
Callback that is triggered when a drag on an edge segment has been released.
EdgeDragInputModeBase
 Inherited
onRun(evt:Event):void
Callback method that will be called after the state machine has been run using the arguments provided.
StateMachineInputMode
 Inherited
Called when the cancel state has been entered.
StateMachineInputMode
 Inherited
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
setGraph(newGraph:IGraph):void
Sets a new graph for this mode.
EdgeDragInputModeBase
 Inherited
StateMachineInputMode
 Inherited
setPreferredCursorTransition(cursorClass:Class):Function
Factory method that can be used to obtain an listener implementation that sets the given preferredCursor.
StateMachineInputMode
 Inherited
Factory method that can be used to obtain a listener implementation that resets the preferredCursor.
StateMachineInputMode
 Inherited
[override] Uninstalls this mode from the canvas.
StateMachineInputMode
 Inherited
Uninstalls all listeners, this instance has installed on calling intallListeners()
StateMachineInputMode
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
_beginHitTestableproperty
protected var _beginHitTestable:IHitTestable

_cancelRecognizerproperty 
protected var _cancelRecognizer:Function

_draggedRecognizerproperty 
protected var _draggedRecognizer:Function

_firstPointproperty 
protected var _firstPoint:YPoint

_graphproperty 
protected var _graph:IGraph

_pressedRecognizerproperty 
protected var _pressedRecognizer:Function

_releasedRecognizerproperty 
protected var _releasedRecognizer:Function

beginHitTestableproperty 
beginHitTestable:IHitTestable

Gets or sets the IHitTestable that determines where bends may be created.


Implementation
    public function get beginHitTestable():IHitTestable
    public function set beginHitTestable(value:IHitTestable):void
cancelRecognizerproperty 
cancelRecognizer:Function

Gets or sets the "cancel" recognizer. This recognizer recognizes a cancel action during the move.

The default value is com.yworks.canvas.input.EventRecognizers#ESCAPE_PRESSED.


Implementation
    public function get cancelRecognizer():Function
    public function set cancelRecognizer(value:Function):void
draggedRecognizerproperty 
draggedRecognizer:Function

Gets or sets the "dragged" recognizer. This recognizer instance determines when the user is moving the selection.

The default value is com.yworks.canvas.input.EventRecognizers#CANVAS_MOUSE_DRAGGED.


Implementation
    public function get draggedRecognizer():Function
    public function set draggedRecognizer(value:Function):void
graphproperty 
graph:IGraph

Gets the Graph this mode is acting upon.


Implementation
    public function get graph():IGraph
    public function set graph(value:IGraph):void
locationproperty 
location:IPoint  [read-only]

Gets the location where the bend creation gesture was initialized.


Implementation
    public function get location():IPoint
pressedRecognizerproperty 
pressedRecognizer:Function

Gets or sets the "pressed" state recognizer.

This recognizer instance will be used to determine when the user begins to move the selection.

The default value is com.yworks.canvas.input.EventRecognizers#CANVAS_MOUSE_DOWN.


Implementation
    public function get pressedRecognizer():Function
    public function set pressedRecognizer(value:Function):void
releasedRecognizerproperty 
releasedRecognizer:Function

Gets or sets the "released" recognizer.

This instance determines when the user has finished the move.

The default value is com.yworks.canvas.input.EventRecognizers#CANVAS_MOUSE_UP.


Implementation
    public function get releasedRecognizer():Function
    public function set releasedRecognizer(value:Function):void
Constructor Detail
EdgeDragInputModeBase()Constructor
public function EdgeDragInputModeBase(graph:IGraph = null)

Creates a new instance using the given graph to create the bends in. It is recommended to omit the graph parameter in which case the instance retrieves the graph instance from the context.

Parameters
graph:IGraph (default = null) — The graph to create the bends in and query the edges from.

See also

Method Detail
createInputModeContext()method
protected function createInputModeContext():IInputModeContext

Creates an IInputModeContext for use in CreateBendInputMode#createBend.

Returns
IInputModeContext — An instance of IInputModeContext.

See also

dragEdgeSegment()method 
protected function dragEdgeSegment(edge:IEdge, dragLocation:IPoint):void

Callback method to be implemented by subclasses that is invoked whenever a drag gesture has been recognized by this mode.

Parameters

edge:IEdge — The edge that has been dragged.
 
dragLocation:IPoint — The location of the drag start.

dragSegment()method 
protected function dragSegment(te:TransitionEvent):void

Callback that is triggered when a drag on an edge segment has been recognized. This method delegates to dragEdgeSegment.

Parameters

te:TransitionEvent — The TransitionEvent.

See also

getEdge()method 
public function getEdge(x:Number, y:Number):IEdge

Finds the edge at the given coordinate.

Parameters

x:Number — The x coordinate.
 
y:Number — The y coordinate.

Returns
IEdge — The edge, if one was found, or null
initializeStateMachine()method 
override protected function initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void

Called to initialize the state machine.

Parameters

machine:StateMachine — The machine to initialize and configure
 
startState:State — The start state to use.
 
canceledState:State — The cancelled state to use.
 
stoppedState:State — The stopped state to use.
 
finishedState:State — The finished state to use.

isValidBegin()method 
protected function isValidBegin(evt:Event):Boolean

Determines whether the current location and event is valid to begin a bend creation gesture.

Parameters

evt:Event — the Event

Returns
Boolean — true, whether the Event is valid
onCancel()method 
protected function onCancel(te:TransitionEvent):void

Callback that is triggered when a drag on an edge segment has been canceled. This implementation does nothing.

Parameters

te:TransitionEvent — The TransitionEvent.

onGraphChanged()method 
protected function onGraphChanged(oldGraph:IGraph, newGraph:IGraph):void

Called when the graph property changes.

Parameters

oldGraph:IGraph — The old graph instance.
 
newGraph:IGraph — The new graph instance.

onReleased()method 
protected function onReleased(te:TransitionEvent):void

Callback that is triggered when a drag on an edge segment has been released. This implementation does nothing.

Parameters

te:TransitionEvent — The TransitionEvent.

setGraph()method 
protected function setGraph(newGraph:IGraph):void

Sets a new graph for this mode. Normally the graph is retrieved from this instance's inputModeContext. If the instance needs to be overridden, this method can be used. Triggers onGraphChanged.

Parameters

newGraph:IGraph — The new graph.

See also