| Package | com.yworks.graph.input |
| Class | public class CreateBendInputMode |
| Inheritance | CreateBendInputMode StateMachineInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
IInputMode used for creating bends at edges
in an IGraph displayed in a CanvasComponent.
| Property | Defined by | ||
|---|---|---|---|
| beginHitTestable : IHitTestable
Gets or sets the
IHitTestable that determines where bends may be created. | CreateBendInputMode | ||
![]() | canceledState : State
Returns the canceled state of the state machine.
| StateMachineInputMode | |
| cancelRecognizer : Function
Gets or sets the property that determines cancel events.
| CreateBendInputMode | ||
![]() | canvas : CanvasComponent
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
The event recognizer that recognizes the initial dragging gesture that
is used to initiate the creation after the preparation.
| CreateBendInputMode | ||
![]() | enabled : Boolean
Gets or sets the enabled state of this input mode.
| AbstractConcurrentInputMode | |
| graph : IGraph | CreateBendInputMode | ||
| graphCanvas : GraphCanvasComponent
[read-only]
Gets the GraphCanvasComponent this mode is working on or
null. | CreateBendInputMode | ||
![]() | inputModeContext : IInputModeContext
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | |
![]() | installed : Boolean
Whether this mode is currently installed, i.e.
| AbstractInputMode | |
![]() | lastMouseEvent : CanvasMouseEvent
Returns the last mouse event.
| StateMachineInputMode | |
| location : IPoint
[read-only]
Gets the location where the bend creation gesture was initialized.
| CreateBendInputMode | ||
![]() | 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.
| CreateBendInputMode | ||
| releasedRecognizer : Function
Gets or sets the "released" recognizer.
| CreateBendInputMode | ||
![]() | startState : State
Returns the start state of the state machine.
| StateMachineInputMode | |
![]() | stateMachine : StateMachine
Gets the state machine.
| StateMachineInputMode | |
![]() | stoppedState : State
Returns the stopped state of the state machine.
| StateMachineInputMode | |
| Method | Defined by | ||
|---|---|---|---|
|
CreateBendInputMode(graph:IGraph)
Creates a new instance of this mode.
| CreateBendInputMode | ||
![]() |
cancel():void
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.
| CreateBendInputMode | ||
|
install(context:IInputModeContext):void
Installs this mode into the given canvas.
| CreateBendInputMode | ||
![]() |
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
Runs the machine using a special stop event.
| StateMachineInputMode | |
![]() |
uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas.
| StateMachineInputMode | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
canRequestMutex():Boolean
Determines whether this instance can request the
InputMutex. | AbstractConcurrentInputMode | |
|
Creates the bend.
| CreateBendInputMode | ||
![]() |
Factory method that creates a canceled
State
for the given machine. | StateMachineInputMode | |
![]() |
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 | |
![]() |
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, cancelledState:State, stoppedState:State, finishedState:State):void
Called to initialize the state machine.
| CreateBendInputMode | ||
![]() |
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(args:Event):Boolean
Determines whether the current location and event is valid to begin a bend creation gesture.
| CreateBendInputMode | ||
|
onBendCreated(bend:IBend):void
Triggers the
BendCreated event. | CreateBendInputMode | ||
![]() |
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. | CreateBendInputMode | ||
![]() |
onMachineReset():void
| StateMachineInputMode | |
![]() |
onMutexObtained():void
Runs the state machine using a mutex obtained event.
| StateMachineInputMode | |
![]() |
onMutexReleased():void
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 | |
| CreateBendInputMode | |||
|
setGraphCanvas(graphCanvas:GraphCanvasComponent):void
Sets the
GraphCanvasComponent that is associated with this instance. | CreateBendInputMode | ||
![]() |
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 | |
![]() |
uninstallListeners():void
Uninstalls all listeners, this instance has installed on calling
intallListeners()
| StateMachineInputMode | |
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when a new bend has been created | CreateBendInputMode | |||
![]() | Dispatched when the default cursor changed. | AbstractConcurrentInputMode | ||
| beginHitTestable | property |
beginHitTestable:IHitTestable [read-write]
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 [read-write]Gets or sets the property that determines cancel events.
Implementation public function get cancelRecognizer():Function
public function set cancelRecognizer(value:Function):void
See also
| draggedRecognizer | property |
draggedRecognizer:Function [read-write]The event recognizer that recognizes the initial dragging gesture that is used to initiate the creation after the preparation.
Implementation public function get draggedRecognizer():Function
public function set draggedRecognizer(value:Function):void
See also
| graph | property |
graph:IGraph [read-write]Implementation
public function get graph():IGraph
public function set graph(value:IGraph):void
| graphCanvas | property |
graphCanvas:GraphCanvasComponent [read-only]
Gets the GraphCanvasComponent this mode is working on or null.
This property is set by setGraphControl which is
triggered if this mode is installed in
a GraphCanvasComponent.
public function get graphCanvas():GraphCanvasComponent
| location | property |
location:IPoint [read-only]Gets the location where the bend creation gesture was initialized.
Implementation public function get location():IPoint
| pressedRecognizer | property |
pressedRecognizer:Function [read-write]Gets or sets the "pressed" state recognizer.
This recognizer instance will be used to determine when the user begins to move the selection.
Implementation public function get pressedRecognizer():Function
public function set pressedRecognizer(value:Function):void
| releasedRecognizer | property |
releasedRecognizer:Function [read-write]Gets or sets the "released" recognizer.
This instance determines when the user has finished the move.
Implementation public function get releasedRecognizer():Function
public function set releasedRecognizer(value:Function):void
| CreateBendInputMode | () | constructor |
public function CreateBendInputMode(graph:IGraph)Creates a new instance of this mode.
Parametersgraph:IGraph — The graph to work on.
|
| createBend | () | method |
protected function createBend(hitEdge:IEdge, x:Number, y:Number):IBendCreates the bend.
The bend is created using the hit edge's IBendCreator implementation,
as obtained from the edge's ILookup.Lookup.
hitEdge:IEdge — The hit edge.
|
|
x:Number — The x coordinate of the hit.
|
|
y:Number — The y coordinate of the hit.
|
IBend —
The created bend or null.
|
| getEdge | () | method |
public function getEdge(x:Number, y:Number):IEdgeFinds the edge at the given coordinate.
Parametersx:Number — The x coordinate.
|
|
y:Number — The y coordinate.
|
IEdge —
The edge, if one was found, or null
|
| initializeStateMachine | () | method |
protected override function initializeStateMachine(machine:StateMachine, startState:State, cancelledState:State, stoppedState:State, finishedState:State):voidCalled to initialize the state machine.
Parametersmachine:StateMachine — The machine to initialize and configure
|
|
startState:State — The start state to use.
|
|
cancelledState:State — The cancelled state to use.
|
|
stoppedState:State — The stopped state to use.
|
|
finishedState:State — The finished state to use.
|
| install | () | method |
public override function install(context:IInputModeContext):voidInstalls this mode into the given canvas.
Subclasses should override this method and call super.install(canvas), first.
One-time initialization should be performed in the initialize method.
The install method will call the initialize method the first
time this mode gets installed.
This implementation calls installListeners.
context:IInputModeContext — The canvas to install this mode into
|
| isValidBegin | () | method |
protected function isValidBegin(args:Event):BooleanDetermines whether the current location and event is valid to begin a bend creation gesture.
Parametersargs:Event — the Event
|
Boolean — true, whether the Event is valid
|
| onBendCreated | () | method |
protected function onBendCreated(bend:IBend):void
Triggers the BendCreated event.
bend:IBend — The bend, which was created.
|
| onGraphChanged | () | method |
protected function onGraphChanged(oldGraph:IGraph, newGraph:IGraph):void
Called when the graph property changes.
oldGraph:IGraph — The old graph instance.
|
|
newGraph:IGraph — The new graph instance.
|
| setGraph | () | method |
| setGraphCanvas | () | method |
protected function setGraphCanvas(graphCanvas:GraphCanvasComponent):void
Sets the GraphCanvasComponent that is associated with this instance.
This will register a listener for the graphChanged event to upgrade the graph property accordingly.
graphCanvas:GraphCanvasComponent — the control to set.
|
| bendCreated | event |
com.yworks.graph.input.BendCreatedEvent
Dispatched when a new bend has been created