Packagecom.yworks.graph.input
Classpublic class CreateBendInputMode
InheritanceCreateBendInputMode Inheritance StateMachineInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher

A specialized IInputMode used for creating bends at edges in an IGraph displayed in a CanvasComponent.



Public Properties
 PropertyDefined by
  beginHitTestable : IHitTestable
Gets or sets the IHitTestable that determines where bends may be created.
CreateBendInputMode
 InheritedcanceledState : State
Returns the canceled state of the state machine.
StateMachineInputMode
  cancelRecognizer : Function
Gets or sets the property that determines cancel events.
CreateBendInputMode
 Inheritedcanvas : CanvasComponent
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
The event recognizer that recognizes the initial dragging gesture that is used to initiate the creation after the preparation.
CreateBendInputMode
 Inheritedenabled : 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
 InheritedinputModeContext : IInputModeContext
The context instance this mode is currently installed in or null if this instance is not installed.
AbstractInputMode
 Inheritedinstalled : Boolean
Whether this mode is currently installed, i.e.
AbstractInputMode
 InheritedlastMouseEvent : CanvasMouseEvent
Returns the last mouse event.
StateMachineInputMode
  location : IPoint
[read-only] Gets the location where the bend creation gesture was initialized.
CreateBendInputMode
 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.
CreateBendInputMode
  releasedRecognizer : Function
Gets or sets the "released" recognizer.
CreateBendInputMode
 InheritedstartState : State
Returns the start state of the state machine.
StateMachineInputMode
 InheritedstateMachine : StateMachine
Gets the state machine.
StateMachineInputMode
 InheritedstoppedState : State
Returns the stopped state of the state machine.
StateMachineInputMode
Protected Properties
 PropertyDefined by
 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
 InheritedstopEventRecognizer : Function
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 of this mode.
CreateBendInputMode
 Inherited
cancel():void
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.
CreateBendInputMode
  
install(context:IInputModeContext):void
Installs this mode into the given canvas.
CreateBendInputMode
 Inherited
resetMachine():void
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
Runs the machine using a special stop event.
StateMachineInputMode
 Inherited
Uninstalls this mode from the canvas.
StateMachineInputMode
Protected Methods
 MethodDefined by
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
  
createBend(hitEdge:IEdge, x:Number, y:Number):IBend
Creates the bend.
CreateBendInputMode
 Inherited
Factory method that creates a canceled State for the given machine.
StateMachineInputMode
 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
 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, cancelledState:State, stoppedState:State, finishedState:State):void
Called to initialize the state machine.
CreateBendInputMode
 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(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
 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.
CreateBendInputMode
 Inherited
StateMachineInputMode
 Inherited
Runs the state machine using a mutex obtained event.
StateMachineInputMode
 Inherited
Runs the state machine using a mutex lost event.
StateMachineInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
 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
releaseMutex():void
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
requestMutex():void
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
setGraph(newGraph:IGraph):void
CreateBendInputMode
  
Sets the GraphCanvasComponent that is associated with this instance.
CreateBendInputMode
 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
Uninstalls all listeners, this instance has installed on calling intallListeners()
StateMachineInputMode
Events
 EventSummaryDefined by
   Dispatched when a new bend has been created CreateBendInputMode
 Inherited Dispatched when the default cursor changed.AbstractConcurrentInputMode
Public Constants
 ConstantDefined by
 InheritedPREFERRED_CURSOR_CHANGED : String = "preferredCursorChanged"
[static]
AbstractConcurrentInputMode
Property detail
beginHitTestableproperty
beginHitTestable:IHitTestable  [read-write]

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  [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

draggedRecognizerproperty 
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

graphproperty 
graph:IGraph  [read-write]Implementation
    public function get graph():IGraph
    public function set graph(value:IGraph):void
graphCanvasproperty 
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.

Implementation
    public function get graphCanvas():GraphCanvasComponent
locationproperty 
location:IPoint  [read-only]

Gets the location where the bend creation gesture was initialized.

Implementation
    public function get location():IPoint
pressedRecognizerproperty 
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
releasedRecognizerproperty 
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
Constructor detail
CreateBendInputMode()constructor
public function CreateBendInputMode(graph:IGraph)

Creates a new instance of this mode.

Parameters
graph:IGraph — The graph to work on.
Method detail
createBend()method
protected function createBend(hitEdge:IEdge, x:Number, y:Number):IBend

Creates the bend.

The bend is created using the hit edge's IBendCreator implementation, as obtained from the edge's ILookup.Lookup.

Parameters
hitEdge:IEdge — The hit edge.
 
x:Number — The x coordinate of the hit.
 
y:Number — The y coordinate of the hit.

Returns
IBend — The created bend or null.
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 
protected override function initializeStateMachine(machine:StateMachine, startState:State, cancelledState: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.
 
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):void

Installs 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.

Parameters
context:IInputModeContext — The canvas to install this mode into
isValidBegin()method 
protected function isValidBegin(args:Event):Boolean

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

Parameters
args:Event — the Event

Returns
Boolean — true, whether the Event is valid
onBendCreated()method 
protected function onBendCreated(bend:IBend):void

Triggers the BendCreated event.

Parameters
bend:IBend — The bend, which was created.
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.
setGraph()method 
protected function setGraph(newGraph:IGraph):voidParameters
newGraph:IGraph
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.

Parameters
graphCanvas:GraphCanvasComponent — the control to set.
Event detail
bendCreatedevent 
Event object type: com.yworks.graph.input.BendCreatedEvent

Dispatched when a new bend has been created