Package | com.yworks.graph.input |
Class | public class EdgeDragInputModeBase |
Inheritance | EdgeDragInputModeBase StateMachineInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
Subclasses | CreateBendInputMode |
IInputMode
that can be used to detect mouse drags on IEdge
s.
See also
Property | Defined By | ||
---|---|---|---|
beginHitTestable : IHitTestable
Gets or sets the IHitTestable that determines where bends may be created. | EdgeDragInputModeBase | ||
canceledState : State [read-only]
Returns the canceled state of the state machine. | StateMachineInputMode | ||
cancelRecognizer : Function
Gets or sets the "cancel" recognizer. | EdgeDragInputModeBase | ||
canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | ||
controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | ||
draggedRecognizer : Function
Gets or sets the "dragged" recognizer. | EdgeDragInputModeBase | ||
enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | ||
graph : IGraph
Gets the Graph this mode is acting upon. | EdgeDragInputModeBase | ||
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 | ||
location : IPoint [read-only]
Gets the location where the bend creation gesture was initialized. | EdgeDragInputModeBase | ||
preferredCursor : 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 | ||
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 |
Property | Defined By | ||
---|---|---|---|
_beginHitTestable : IHitTestable | EdgeDragInputModeBase | ||
_cancelRecognizer : Function | EdgeDragInputModeBase | ||
_draggedRecognizer : Function | EdgeDragInputModeBase | ||
_firstPoint : YPoint | EdgeDragInputModeBase | ||
_graph : IGraph | EdgeDragInputModeBase | ||
_lastEvent : Event
The last Event that has been delivered to this instance. | StateMachineInputMode | ||
_lastMouseEvent : CanvasMouseEvent
The last MouseEvent that has been delivered to this instance. | StateMachineInputMode | ||
_pressedRecognizer : Function | EdgeDragInputModeBase | ||
_releasedRecognizer : Function | EdgeDragInputModeBase | ||
stopEventRecognizer : Function [read-only]
An event recognizer for the state machine
that is triggered if this mode has been stoppped. | StateMachineInputMode |
Method | Defined By | ||
---|---|---|---|
EdgeDragInputModeBase(graph:IGraph = null)
Creates a new instance using the given graph to create the bends in. | EdgeDragInputModeBase | ||
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 | ||
Finds the edge at the given coordinate. | EdgeDragInputModeBase | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
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 | ||
---|---|---|---|
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | ||
Factory method that creates a canceled State
for the given machine. | StateMachineInputMode | ||
Creates an IInputModeContext for use in CreateBendInputMode#createBend. | EdgeDragInputModeBase | ||
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 | ||
Callback method to be implemented by subclasses that is invoked whenever a drag gesture has been
recognized by this mode. | EdgeDragInputModeBase | ||
dragSegment(te:TransitionEvent):void
Callback that is triggered when a drag on an edge segment has been recognized. | EdgeDragInputModeBase | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | AbstractInputMode | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
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 | ||
installCore(context:IInputModeContext):void [override]
Installs this mode into the given canvas. | StateMachineInputMode | ||
installListeners():void
Installs all necessary listeners to trigger the run method. | StateMachineInputMode | ||
invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | ||
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 | ||
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 | ||
isValidBegin(evt:Event):Boolean
Determines whether the current location and event is valid to begin a bend creation gesture. | EdgeDragInputModeBase | ||
onCancel(te:TransitionEvent):void
Callback that is triggered when a drag on an edge segment has been canceled. | EdgeDragInputModeBase | ||
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 | ||
onEnable():void
Runs the state machine using a enable event. | StateMachineInputMode | ||
onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | ||
Called when the graph property changes. | EdgeDragInputModeBase | ||
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 | ||
onReleased(te:TransitionEvent):void
Callback that is triggered when a drag on an edge segment has been released. | EdgeDragInputModeBase | ||
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 | ||
Sets a new graph for this mode. | EdgeDragInputModeBase | ||
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]
Uninstalls this mode from the canvas. | StateMachineInputMode | ||
uninstallListeners():void
Uninstalls all listeners, this instance has installed on calling intallListeners()
| StateMachineInputMode |
_beginHitTestable | property |
protected var _beginHitTestable:IHitTestable
_cancelRecognizer | property |
protected var _cancelRecognizer:Function
_draggedRecognizer | property |
protected var _draggedRecognizer:Function
_firstPoint | property |
protected var _firstPoint:YPoint
_graph | property |
protected var _graph:IGraph
_pressedRecognizer | property |
protected var _pressedRecognizer:Function
_releasedRecognizer | property |
protected var _releasedRecognizer:Function
beginHitTestable | property |
beginHitTestable:IHitTestable
Gets or sets the IHitTestable
that determines where bends may be created.
public function get beginHitTestable():IHitTestable
public function set beginHitTestable(value:IHitTestable):void
cancelRecognizer | property |
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
.
public function get cancelRecognizer():Function
public function set cancelRecognizer(value:Function):void
draggedRecognizer | property |
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
.
public function get draggedRecognizer():Function
public function set draggedRecognizer(value:Function):void
graph | property |
graph:IGraph
Gets the Graph this mode is acting upon.
public function get graph():IGraph
public function set graph(value:IGraph):void
location | property |
location:IPoint
[read-only] Gets the location where the bend creation gesture was initialized.
public function get location():IPoint
pressedRecognizer | property |
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
.
public function get pressedRecognizer():Function
public function set pressedRecognizer(value:Function):void
releasedRecognizer | property |
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
.
public function get releasedRecognizer():Function
public function set releasedRecognizer(value:Function):void
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.
Parametersgraph:IGraph (default = null ) — The graph to create the bends in and query the edges from.
|
See also
createInputModeContext | () | method |
protected function createInputModeContext():IInputModeContext
Creates an IInputModeContext
for use in CreateBendInputMode#createBend
.
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.
|
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
|
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