Packagecom.yworks.graph.input
Classpublic class CreateEdgeInputMode
InheritanceCreateEdgeInputMode Inheritance StateMachineInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher

A specialized IInputMode used for creating edges between nodes in an IGraph displayed in a CanvasControl.

This class provides factory methods and callbacks, as well as a couple of options to tweak the edge gesture creation.
This class uses IPortCandidateProvider instances found in the ILookup.lookup of the INodes in the graph to display port candidates and to finally create the edges.



Public Properties
 PropertyDefined by
  beginHitTestable : IHitTestable
Gets or sets an IHitTestable that determines whether it is valid to start an edge creation gesture here.
CreateEdgeInputMode
  bendCreationAllowed : Boolean
Determines whether or not to allow the creation of bends.
CreateEdgeInputMode
 InheritedcanceledState : State
Returns the canceled state of the state machine.
StateMachineInputMode
  cancelRecognizer : Function
Gets or sets the property that determines cancel events.
CreateEdgeInputMode
 Inheritedcanvas : CanvasComponent
The canvas instance this mode is currently installed in or null
AbstractInputMode
  connectToCandidatesOnly : Boolean
Gets or sets a property that determines whether this mode allows connecting to IPortCandidates only.
CreateEdgeInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
  controlPointList : IMutableControlPoints
[read-only] Gets or sets the control points used by the mode during the edge creation.
CreateEdgeInputMode
  controlPoints : IMutableControlPoints
[write-only]
CreateEdgeInputMode
  createBendRecognizer : Function
The event recognizer that recognizes the creation of a bend.
CreateEdgeInputMode
  draggedRecognizer : Function
The event recognizer that recognizes the initial dragging gesture that is used to initiate the creation after the preparation.
CreateEdgeInputMode
  dragPoint : IMutablePoint
[read-only] Gets the dragging point for the edge creation.
CreateEdgeInputMode
  dummyEdge : IEdge
Gets or sets the dummy edge instance that will be used to render a preview of the edge to be created.
CreateEdgeInputMode
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
  endHitTestable : IHitTestable
Gets or sets an IHitTestable that determines whether it is valid to finish an edge creation gesture here.
CreateEdgeInputMode
  finishRecognizer : Function
The event recognizer that recognizes the finishing gesture that is used to end the edge creation on the target node.
CreateEdgeInputMode
  forceSnapToCandidate : Boolean
Gets or sets a property that determines whether the mouse should be forced to snap to the nearest valid port candidate if the mouse hovers over a target node.
CreateEdgeInputMode
  graph : IGraph
CreateEdgeInputMode
  graphCanvas : GraphCanvasComponent
[read-only] Gets the GraphCanvasComponent this mode is working on or null.
CreateEdgeInputMode
 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
  movedOrDraggedRecognizer : Function
The event recognizer that recognizes the movement of the end point of the edge.
CreateEdgeInputMode
  nodeComparisonFunction : Function
Gets or sets the comparison function that is used in getNode to determine the hit order and which node is hit first.
CreateEdgeInputMode
  paintable : IPaintable
[read-only] Gets the paintable that paints the edge and port candidates.
CreateEdgeInputMode
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
  prepareRecognizer : Function
The event recognizer that recognizes the starting gesture that is used to prepare the edge creation on the target node.
CreateEdgeInputMode
  removeBendRecognizer : Function
Gets or sets the property that determines bend removal events.
CreateEdgeInputMode
  selfloopCreationAllowed : Boolean
Determines whether or not to allow the creation of self loops.
CreateEdgeInputMode
  showPortCandidates : Boolean
Determines whether or not to display possible port candidates during the creation of the edge.
CreateEdgeInputMode
  snapDistance : Number
Gets or sets the distance in the view coordinate system that determines how far the mouse should be snapped to a port candidate if snapToTargetCandidate is enabled.
CreateEdgeInputMode
  snapToTargetCandidate : Boolean
Determines whether or not the edge's end point should snap to the current target port candidate during the creation of the edge.
CreateEdgeInputMode
  snapToTargetCandidateOwner : Boolean
Determines whether or not the edge's port should snap to the current target port candidate owner during the creation of the edge.
CreateEdgeInputMode
  startPoint : IMutablePoint
[read-only] Gets the starting point for the edge creation.
CreateEdgeInputMode
 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
  targetPortCandidate : IPortCandidate
[read-only] Gets the candidate for the IEdge.targetPort of the edge to be created.
CreateEdgeInputMode
  useHitNodeTargetCandidatesOnly : Boolean
Gets or sets a property that determines whether this mode should use only the target port candidates of the node the mouse currently hovers over.
CreateEdgeInputMode
  validBeginCursor : Cursor
Sets the cursor that indicates a valid place to begin an edge creation.
CreateEdgeInputMode
  validBendCursor : Cursor
Sets the cursor that indicates a valid place to create a bend.
CreateEdgeInputMode
  validBendHitTestable : IHitTestable
Gets or sets an IHitTestable that determines whether it is valid to create a bend here.
CreateEdgeInputMode
  validEndCursor : Cursor
Sets the cursor that indicates a valid place to finish creation.
CreateEdgeInputMode
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
  sourcePortCandidate : IPortCandidate
Gets or sets the candidate for the IEdge.sourcePort of the edge to be created.
CreateEdgeInputMode
 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 using the given graph.
CreateEdgeInputMode
  
cancel():void
CreateEdgeInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
  
install(context:IInputModeContext):void
Installs this mode into the given canvas.
CreateEdgeInputMode
  
Updates the visual representation and port candidates.
CreateEdgeInputMode
  
paintTargetPortCandidates(g:YGraphics, ctx:IPaintContext, candidates:Iterable):void
Draws representations of the IPortCandidates for the target port of the edge to create.
CreateEdgeInputMode
 Inherited
resetMachine():void
Runs the machine using a special reset event.
StateMachineInputMode
  
run(evt:Event):void
CreateEdgeInputMode
 Inherited
stop():Boolean
Runs the machine using a special stop event.
StateMachineInputMode
  
Uninstalls this mode from the canvas.
CreateEdgeInputMode
Protected Methods
 MethodDefined by
  
assignBends(theGraph:IGraph, edge:IEdge, pointList:IControlPoints):void
Assigns the given bend points to the newly created edge.
CreateEdgeInputMode
  
Assigns the style to the edge to use during the gesture.
CreateEdgeInputMode
  
assignPortPosition(node:INode, startPoint:IPoint):void
Assigns the port position and owner to the dummyEdge.
CreateEdgeInputMode
  
Transition that cleans up everything that has been built until now.
CreateEdgeInputMode
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
  
Adds another bend to the edge's path.
CreateEdgeInputMode
  
createBendAt(x:Number, y:Number):void
Actually creates the bend at the given location.
CreateEdgeInputMode
 Inherited
Factory method that creates a canceled State for the given machine.
StateMachineInputMode
  
Creates the control points used for the edge and during the edge creation.
CreateEdgeInputMode
  
Factory method for the dragPoint property.
CreateEdgeInputMode
  
Creates the dummy edge that will be displayed by the input mode during the creation.
CreateEdgeInputMode
  
Factory method that initially creates the dummy node that will be used to drag around the dummy edge's end.
CreateEdgeInputMode
  
Callback at the end of the edge creation process.
CreateEdgeInputMode
  
createEdgeBetweenCandidates(theGraph:IGraph, sourcePortCandidate:IPortCandidate, targetPortCandidate:IPortCandidate):IEdge
Callback used by createEdge if both sourcePortCandidate and targetPortCandidate habe been set.
CreateEdgeInputMode
  
createEdgeBetweenNodes(theGraph:IGraph, sourceNode:INode, targetNode:INode):IEdge
Callback that creates the edge if no targetPortCandidate and sourcePortCandidate have been determined but a source node and a target node.
CreateEdgeInputMode
  
Creates an IInputModeContext for us with the port candidates queries for the upcoming edge creation operation.
CreateEdgeInputMode
  
Creates a paintable that draws the DummyEdge and the port candidates.
CreateEdgeInputMode
  
Factory method for the StartPoint property.
CreateEdgeInputMode
 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
  
Returns the input mode context for edge creation that is used for the port candidate queries.
CreateEdgeInputMode
  
Finds the closest valid candidate given a number of IPortCandidates and a location in world coordinates.
CreateEdgeInputMode
  
Finds the closest candidate given a number of IPortCandidates and a location in world coordinates.
CreateEdgeInputMode
  
Finds the closest target candidate given a number of IPortCandidates and a location in world coordinates.
CreateEdgeInputMode
  
Retrieves the node at a given position in world coordinates.
CreateEdgeInputMode
  
getSourceNode(sourcePoint:IPoint):INode
Finds the source node for a given point in world coordinates.
CreateEdgeInputMode
  
Finds the best matching source port IPortCandidate given a provider and the current location.
CreateEdgeInputMode
  
Retrieves the port candidate provider instance given a source node.
CreateEdgeInputMode
  
getTargetNode(targetPoint:IPoint):INode
Finds the target node for a given point in world coordinates.
CreateEdgeInputMode
  
Retrieves the port candidate provider instance given a source port candidate and a possible target node.
CreateEdgeInputMode
  
Retrieves the IPortCandidateProvider instance that provides the possible candidates for the target of the edge given the current source candidate.
CreateEdgeInputMode
  
Retrieves the target port candidates for a given location in world coordinates.
CreateEdgeInputMode
 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.
CreateEdgeInputMode
 Inherited
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.
CreateEdgeInputMode
  
Callback that decides whether at the current state of the gesture the user wants to enforce the creation of a bend rather than finish the edge creation.
CreateEdgeInputMode
 Inherited
isCancelEvent(evt:Event):Boolean
Method that identifies an event as a cancel event.
StateMachineInputMode
  
isCancelGesture(evt:Event):Boolean
Determines whether the current event cancels the gesture.
CreateEdgeInputMode
 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
  
isRemoveBendEvent(evt:Event):Boolean
Determines whether the current event removes the last bend.
CreateEdgeInputMode
  
isSourceNodeDraggingFinished(evt:Event):Boolean
Determines whether the user has finished dragging over the source node.
CreateEdgeInputMode
 Inherited
isStopEvent(evt:Event):Boolean
Method that identifies an event as a stop event.
StateMachineInputMode
  
isValidBegin(evt:Event):Boolean
Determines whether the current mouse state is valid for beginning the edge creation gesture.
CreateEdgeInputMode
  
isValidBend(evt:Event):Boolean
Determines whether it is currently allowed to create a bend.
CreateEdgeInputMode
  
isValidEnd(evt:Event):Boolean
Determines whether the edge gesture may end at this state.
CreateEdgeInputMode
 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.
CreateEdgeInputMode
 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
  
Actually removes the last bend.
CreateEdgeInputMode
 Inherited
requestMutex():void
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
setDragPoint(x:Number, y:Number):void
Updates the drag point.
CreateEdgeInputMode
  
setGraph(newGraph:IGraph):void
Sets the IGraph that is associated with this instance.
CreateEdgeInputMode
  
Sets the GraphCanvasComponent that is associated with this instance.
CreateEdgeInputMode
 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
  
Sets the candidate for the IEdge.targetPort of the edge to be created.
CreateEdgeInputMode
  
Called at the beginning of the edge creation gesture.
CreateEdgeInputMode
 Inherited
Uninstalls all listeners, this instance has installed on calling intallListeners()
StateMachineInputMode
  
updateTargetPortOwner(oldOwner:IPortOwner, newOwner:IPortOwner):void
Updates the dummyEdge to reflect the current target port candidate.
CreateEdgeInputMode
Events
 EventSummaryDefined by
 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 an IHitTestable that determines whether it is valid to start an edge creation gesture here.

The default implementation returns true if there is a node at the given location.

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

See also

bendCreationAllowedproperty 
bendCreationAllowed:Boolean  [read-write]

Determines whether or not to allow the creation of bends.

Implementation
    public function get bendCreationAllowed():Boolean
    public function set bendCreationAllowed(value:Boolean):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

connectToCandidatesOnlyproperty 
connectToCandidatesOnly:Boolean  [read-write]

Gets or sets a property that determines whether this mode allows connecting to IPortCandidates only.

If this property is set to true and no candidates can be found for both the source and target node, no edge will be created.
Otherwise this mode will create the edge using the source node and target node without port information.

The default value is false.

Implementation
    public function get connectToCandidatesOnly():Boolean
    public function set connectToCandidatesOnly(value:Boolean):void
controlPointListproperty 
controlPointList:IMutableControlPoints  [read-only]

Gets or sets the control points used by the mode during the edge creation.

Implementation
    public function get controlPointList():IMutableControlPoints
controlPointsproperty 
controlPoints:IMutableControlPoints  [write-only]Implementation
    public function set controlPoints(value:IMutableControlPoints):void
createBendRecognizerproperty 
createBendRecognizer:Function  [read-write]

The event recognizer that recognizes the creation of a bend.

Implementation
    public function get createBendRecognizer():Function
    public function set createBendRecognizer(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

dragPointproperty 
dragPoint:IMutablePoint  [read-only]

Gets the dragging point for the edge creation.

Implementation
    public function get dragPoint():IMutablePoint
dummyEdgeproperty 
dummyEdge:IEdge  [read-write]

Gets or sets the dummy edge instance that will be used to render a preview of the edge to be created.

This instance will be used for rendering the edge during the gesture.

Implementation
    public function get dummyEdge():IEdge
    public function set dummyEdge(value:IEdge):void
endHitTestableproperty 
endHitTestable:IHitTestable  [read-write]

Gets or sets an IHitTestable that determines whether it is valid to finish an edge creation gesture here.

The default implementation returns true if there is a node at the given location.

Implementation
    public function get endHitTestable():IHitTestable
    public function set endHitTestable(value:IHitTestable):void

See also

finishRecognizerproperty 
finishRecognizer:Function  [read-write]

The event recognizer that recognizes the finishing gesture that is used to end the edge creation on the target node.

Implementation
    public function get finishRecognizer():Function
    public function set finishRecognizer(value:Function):void

See also

forceSnapToCandidateproperty 
forceSnapToCandidate:Boolean  [read-write]

Gets or sets a property that determines whether the mouse should be forced to snap to the nearest valid port candidate if the mouse hovers over a target node.

Implementation
    public function get forceSnapToCandidate():Boolean
    public function set forceSnapToCandidate(value:Boolean):void
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
movedOrDraggedRecognizerproperty 
movedOrDraggedRecognizer:Function  [read-write]

The event recognizer that recognizes the movement of the end point of the edge.

Implementation
    public function get movedOrDraggedRecognizer():Function
    public function set movedOrDraggedRecognizer(value:Function):void

See also

nodeComparisonFunctionproperty 
nodeComparisonFunction:Function  [read-write]

Gets or sets the comparison function that is used in getNode to determine the hit order and which node is hit first.

If this is set to null the first found node will be used.

Implementation
    public function get nodeComparisonFunction():Function
    public function set nodeComparisonFunction(value:Function):void
paintableproperty 
paintable:IPaintable  [read-only]

Gets the paintable that paints the edge and port candidates.

Implementation
    public function get paintable():IPaintable
prepareRecognizerproperty 
prepareRecognizer:Function  [read-write]

The event recognizer that recognizes the starting gesture that is used to prepare the edge creation on the target node.

Implementation
    public function get prepareRecognizer():Function
    public function set prepareRecognizer(value:Function):void

See also

removeBendRecognizerproperty 
removeBendRecognizer:Function  [read-write]

Gets or sets the property that determines bend removal events.

Implementation
    public function get removeBendRecognizer():Function
    public function set removeBendRecognizer(value:Function):void

See also

selfloopCreationAllowedproperty 
selfloopCreationAllowed:Boolean  [read-write]

Determines whether or not to allow the creation of self loops.

The default value is true;.

Implementation
    public function get selfloopCreationAllowed():Boolean
    public function set selfloopCreationAllowed(value:Boolean):void
showPortCandidatesproperty 
showPortCandidates:Boolean  [read-write]

Determines whether or not to display possible port candidates during the creation of the edge.

The default value is true.

Implementation
    public function get showPortCandidates():Boolean
    public function set showPortCandidates(value:Boolean):void
snapDistanceproperty 
snapDistance:Number  [read-write]

Gets or sets the distance in the view coordinate system that determines how far the mouse should be snapped to a port candidate if snapToTargetCandidate is enabled.

The default value is 20.

Implementation
    public function get snapDistance():Number
    public function set snapDistance(value:Number):void
snapToTargetCandidateproperty 
snapToTargetCandidate:Boolean  [read-write]

Determines whether or not the edge's end point should snap to the current target port candidate during the creation of the edge.

This will make the edge's end point point to the position of the target port candidate. However the path will end at the candidate and will not be cropped by the node. In order to show how the edge will look like after creation, turn the snapToTargetCandidateOwner property on, too.

Implementation
    public function get snapToTargetCandidate():Boolean
    public function set snapToTargetCandidate(value:Boolean):void
snapToTargetCandidateOwnerproperty 
snapToTargetCandidateOwner:Boolean  [read-write]

Determines whether or not the edge's port should snap to the current target port candidate owner during the creation of the edge.

This will make the edge appear cropped at the node bounds if the edge is snapped to a port candidate.

The default value is false.

Implementation
    public function get snapToTargetCandidateOwner():Boolean
    public function set snapToTargetCandidateOwner(value:Boolean):void
sourcePortCandidateproperty 
sourcePortCandidate:IPortCandidate  [read-write]

Gets or sets the candidate for the IEdge.sourcePort of the edge to be created.

Implementation
    protected function get sourcePortCandidate():IPortCandidate
    protected function set sourcePortCandidate(value:IPortCandidate):void
startPointproperty 
startPoint:IMutablePoint  [read-only]

Gets the starting point for the edge creation.

Implementation
    public function get startPoint():IMutablePoint
targetPortCandidateproperty 
targetPortCandidate:IPortCandidate  [read-only]

Gets the candidate for the IEdge.targetPort of the edge to be created.

Implementation
    public function get targetPortCandidate():IPortCandidate
useHitNodeTargetCandidatesOnlyproperty 
useHitNodeTargetCandidatesOnly:Boolean  [read-write]

Gets or sets a property that determines whether this mode should use only the target port candidates of the node the mouse currently hovers over.

The default value is true.

Implementation
    public function get useHitNodeTargetCandidatesOnly():Boolean
    public function set useHitNodeTargetCandidatesOnly(value:Boolean):void
validBeginCursorproperty 
validBeginCursor:Cursor  [read-write]

Sets the cursor that indicates a valid place to begin an edge creation.

Implementation
    public function get validBeginCursor():Cursor
    public function set validBeginCursor(value:Cursor):void
validBendCursorproperty 
validBendCursor:Cursor  [read-write]

Sets the cursor that indicates a valid place to create a bend.

Implementation
    public function get validBendCursor():Cursor
    public function set validBendCursor(value:Cursor):void
validBendHitTestableproperty 
validBendHitTestable:IHitTestable  [read-write]

Gets or sets an IHitTestable that determines whether it is valid to create a bend here.

The default implementation always returns true.

Implementation
    public function get validBendHitTestable():IHitTestable
    public function set validBendHitTestable(value:IHitTestable):void
validEndCursorproperty 
validEndCursor:Cursor  [read-write]

Sets the cursor that indicates a valid place to finish creation.

Implementation
    public function get validEndCursor():Cursor
    public function set validEndCursor(value:Cursor):void
Constructor detail
CreateEdgeInputMode()constructor
public function CreateEdgeInputMode(graph:IGraph)

Creates a new instance using the given graph.

Parameters
graph:IGraph — The graph to create the edge in and query the nodes from.
Method detail
assignBends()method
protected function assignBends(theGraph:IGraph, edge:IEdge, pointList:IControlPoints):void

Assigns the given bend points to the newly created edge.

Parameters
theGraph:IGraph — The graph that contains the edge.
 
edge:IEdge — The edge.
 
pointList:IControlPoints — The list of points including the source and target point.
assignEdgeStyle()method 
protected function assignEdgeStyle(model:IEdge):IEdgeStyle

Assigns the style to the edge to use during the gesture.

This implementation uses the defaultEdgeStyle property of the graph

Parameters
model:IEdge — The edge to assign the style to.

Returns
IEdgeStyle — The style used.
assignPortPosition()method 
protected function assignPortPosition(node:INode, startPoint:IPoint):void

Assigns the port position and owner to the dummyEdge.

This method is a callback used by startCreateEdge. Parameters

node:INode — The node to use for the source node.
 
startPoint:IPoint — The location of the port to use.
cancel()method 
public override function cancel():void
cancelEdgeCreation()method 
protected function cancelEdgeCreation(t:TransitionEvent):void

Transition that cleans up everything that has been built until now.

Parameters
t:TransitionEvent
createBend()method 
protected function createBend(t:TransitionEvent):void

Adds another bend to the edge's path.

Parameters
t:TransitionEvent
createBendAt()method 
protected function createBendAt(x:Number, y:Number):void

Actually creates the bend at the given location.

Parameters
x:Number — The x coordinate to create the bend at.
 
y:Number — The y coordinate to create the bend at.
createControlPoints()method 
protected function createControlPoints():IMutableControlPoints

Creates the control points used for the edge and during the edge creation.

This implementation returns the IEdge.bends of the dummyEdge combined with the source and target port points.

Returns
IMutableControlPoints — The bends of the edge combined with the source and target port points.
createDragPoint()method 
protected function createDragPoint():IMutablePoint

Factory method for the dragPoint property.

This implementation returns the location of the dummyEdge's IEdge.targetPort.

Returns
IMutablePoint — The location of the dummyEdge's target port.
createDummyEdge()method 
protected function createDummyEdge():IEdge

Creates the dummy edge that will be displayed by the input mode during the creation.

This method delegates to createDummyTargetNode to create the target node that is used to move the anchor during the gesture.

Returns
IEdge — An IEdge implementation that can be used as a dummy.
createDummyTargetNode()method 
protected function createDummyTargetNode():DefaultNode

Factory method that initially creates the dummy node that will be used to drag around the dummy edge's end.

Returns
DefaultNode — the dummy node that is used to drag around the dummy edge's end.
createEdge()method 
protected function createEdge(controlPoints:IControlPoints):IEdge

Callback at the end of the edge creation process.

This method will actually create the edge using one of the edge creation methods.
If successfull, this method will clear the bends and call assignBends to assign the bends created during the gesture to the resulting edge.

Parameters
controlPoints:IControlPoints — The point list to create the edge's bends from.

Returns
IEdge — The edge created or null.

See also