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
[read-only] Returns the canceled state of the state machine.
StateMachineInputMode
  cancelRecognizer : Function
Gets or sets the property that determines cancel events.
CreateEdgeInputMode
 Inheritedcanvas : CanvasComponent
[read-only] 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
  disableSnappingRecognizer : Function
Gets or sets event recognizer that recognizes when the user temporarily disables snapping.
CreateEdgeInputMode
  displayObjectCreator : IDisplayObjectCreator
[read-only] Gets the display object creator that creates the display object for the edge and port candidates.
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
  enableSnappingRecognizer : Function
Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping.
CreateEdgeInputMode
  endHitTestable : IHitTestable
Gets or sets an IHitTestable that determines whether it is valid to finish an edge creation gesture here.
CreateEdgeInputMode
  enforceBendCreationRecognizer : Function
Gets or sets the recognizer function that will be queried to decide if bend creation is enforced.
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
Gets the Graph this mode is acting upon.
CreateEdgeInputMode
  graphCanvas : GraphCanvasComponent
[read-only] Gets the GraphCanvasComponent this mode is working on or null.
CreateEdgeInputMode
 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
  movedOrDraggedRecognizer : Function
The event recognizer that recognizes the movement of the end point of the edge.
CreateEdgeInputMode
  nodeBorderWidthRatio : Number
Defines the width of a node's border which is taken into account when deciding which way to route the first segment of an orthogonal 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
  orthogonalEdgeCreation : Boolean
Gets or sets the property that enforces creation of orthogonal edges.
CreateEdgeInputMode
  orthogonalSnapDistance : Number
Gets or sets the distance in the view coordinate system that determines how far the mouse should be snapped to a horizontal or vertical line.
CreateEdgeInputMode
  portCandidateResolutionRecognizer : Function
The event recognizer that detects changes to the isPortCandidateResolutionEnabled property.
CreateEdgeInputMode
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
  preferredMinimalEdgeDistance : Number
Defines the preferred minimal distance of orthogonal edges.
CreateEdgeInputMode
  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
  resolveSourcePortCandidates : Boolean
A value indicating whether PortCandidateValidity.DYNAMIC ports that are part of the source port candidates should be resolved for the current mouse location.
CreateEdgeInputMode
  resolveTargetPortCandidates : Boolean
A value indicating whether PortCandidateValidity.DYNAMIC ports that are part of the target port candidates should be resolved for the current mouse location.
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
  snapContext : SnapContext
The SnapContext which manages snapping model items to certain coordinates (e.g.
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
[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
  targetPortCandidate : IPortCandidate
[read-only] Gets the candidate for the IEdge.targetPort of the edge to be created.
CreateEdgeInputMode
  toggleSegmentOrientationRecognizer : Function
Gets or sets the recognizer that toggles the orientation of the first orthogonally created segment.
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
[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.
CreateEdgeInputMode
  
cancel():void
[override]
CreateEdgeInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
  
Updates the visual representation and port candidates.
CreateEdgeInputMode
  
Draws representations of the IPortCandidates for the target port of the edge to create.
CreateEdgeInputMode
 Inherited
Runs the machine using a special reset event.
StateMachineInputMode
  
run(evt:Event):void
[override]
CreateEdgeInputMode
 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
  
addDummyEdgeBend(location:IPoint):void
Adds a bend to the dummy edge
CreateEdgeInputMode
  
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
  
Assigns the port location model parameter 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 a display object creator that creates a display object for the DummyEdge and the port candidates.
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
  
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
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
  
Returns the input mode context that will be passed to implementations that are called by this instance and require a context.
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
  
getDummyEdgeSnapLines(graphSnapContext:GraphSnapContext, dummyEdgeSegmentSnapLineProvider:ISnapLineProvider):Iterable
Gets the snap lines lines that are induced by the current dummy edge.
CreateEdgeInputMode
  
Calculates direction of first edge segment of the DummyNode.
CreateEdgeInputMode
  
Retrieves the node at a given position in world coordinates.
CreateEdgeInputMode
  
Finds the source node for a given point in world coordinates.
CreateEdgeInputMode
  
getSourcePortCandidate(provider:IPortCandidateProvider, location:IPoint, shallResolveCandidates:Boolean):IPortCandidate
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
  
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
  
getTargetPortCandidates(dragPoint:IPoint, shallResolveCandidates:Boolean):Iterable
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, canceledState:State, stoppedState:State, finishedState:State):void
[override] Called to initialize the state machine.
CreateEdgeInputMode
  
[override] Installs this mode into the given canvas.
CreateEdgeInputMode
 Inherited
Installs all necessary listeners to trigger the run method.
StateMachineInputMode
  
invalidate():void
[override] 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
  
This method is called to determine whether PortCandidateValidity.DYNAMIC ports should be resolved or discarded.
CreateEdgeInputMode
  
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
  
onEdgeCreated(graph:IGraph, edge:IEdge):void
Called by createEdge(IControlPointList) after the edge has been finalized.
CreateEdgeInputMode
  
Raises the edgeCreationStarted event when the gesture for creating an edge has been initialized.
CreateEdgeInputMode
 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
  
Called when the graph structure of the graph changes during an edge creation gesture.
CreateEdgeInputMode
 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
 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
  
Actually removes the last bend.
CreateEdgeInputMode
 Inherited
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
Returns an enumerable over the given candidates where no instance has PortCandidateValidity.DYNAMIC validity.
CreateEdgeInputMode
  
setBendLocation(index:int, location:IPoint):void
Callback that sets the location of the bend of the current dummy ede at the given index.
CreateEdgeInputMode
  
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
  
[override] Uninstalls this mode from the canvas.
CreateEdgeInputMode
 Inherited
Uninstalls all listeners, this instance has installed on calling intallListeners()
StateMachineInputMode
  
Updates the dummyEdge to reflect the current target port candidate.
CreateEdgeInputMode
Events
 Event Summary Defined By
  Dispatched when an edge is added by the user.CreateEdgeInputMode
  Dispatched when an edge creation has been initialized.CreateEdgeInputMode
 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
beginHitTestable:IHitTestable

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

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

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

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

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

disableSnappingRecognizerproperty 
disableSnappingRecognizer:Function

Gets or sets event recognizer that recognizes when the user temporarily disables snapping.

The default value is EventRecognizers#CTRL_PRESSED.


Implementation
    public function get disableSnappingRecognizer():Function
    public function set disableSnappingRecognizer(value:Function):void
displayObjectCreatorproperty 
displayObjectCreator:IDisplayObjectCreator  [read-only]

Gets the display object creator that creates the display object for the edge and port candidates.


Implementation
    public function get displayObjectCreator():IDisplayObjectCreator
draggedRecognizerproperty 
draggedRecognizer:Function

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

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
enableSnappingRecognizerproperty 
enableSnappingRecognizer:Function

Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping.

The default value is EventRecognizers#CTRL_RELEASED.


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

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

enforceBendCreationRecognizerproperty 
enforceBendCreationRecognizer:Function

Gets or sets the recognizer function that will be queried to decide if bend creation is enforced.


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

See also

finishRecognizerproperty 
finishRecognizer:Function

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

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

Gets the Graph this mode is acting upon.


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

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

nodeBorderWidthRatioproperty 
nodeBorderWidthRatio:Number

Defines the width of a node's border which is taken into account when deciding which way to route the first segment of an orthogonal edge. An edge starting in a border is always pointing away from it.

The default value is 0.1.


Implementation
    public function get nodeBorderWidthRatio():Number
    public function set nodeBorderWidthRatio(value:Number):void
nodeComparisonFunctionproperty 
nodeComparisonFunction:Function

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
orthogonalEdgeCreationproperty 
orthogonalEdgeCreation:Boolean

Gets or sets the property that enforces creation of orthogonal edges.

The default value is false.


Implementation
    public function get orthogonalEdgeCreation():Boolean
    public function set orthogonalEdgeCreation(value:Boolean):void
orthogonalSnapDistanceproperty 
orthogonalSnapDistance:Number

Gets or sets the distance in the view coordinate system that determines how far the mouse should be snapped to a horizontal or vertical line.

The default value is 5.


Implementation
    public function get orthogonalSnapDistance():Number
    public function set orthogonalSnapDistance(value:Number):void
portCandidateResolutionRecognizerproperty 
portCandidateResolutionRecognizer:Function

The event recognizer that detects changes to the isPortCandidateResolutionEnabled property.


Implementation
    public function get portCandidateResolutionRecognizer():Function
    public function set portCandidateResolutionRecognizer(value:Function):void
preferredMinimalEdgeDistanceproperty 
preferredMinimalEdgeDistance:Number

Defines the preferred minimal distance of orthogonal edges. This information is needed when deciding which way to route the first segment of an orthogonal edge.

The default value is 10.0.


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

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

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

resolveSourcePortCandidatesproperty 
resolveSourcePortCandidates:Boolean

A value indicating whether PortCandidateValidity.DYNAMIC ports that are part of the source port candidates should be resolved for the current mouse location. By default this feature is enabled and the portCandidateResolutionRecognizer is configured so that the resolution mechanism is used if the user holds the shift modifier during the gesture.


Implementation
    public function get resolveSourcePortCandidates():Boolean
    public function set resolveSourcePortCandidates(value:Boolean):void

See also

resolveTargetPortCandidatesproperty 
resolveTargetPortCandidates:Boolean

A value indicating whether PortCandidateValidity.DYNAMIC ports that are part of the target port candidates should be resolved for the current mouse location. By default this feature is enabled and the portCandidateResolutionRecognizer is configured so that the resolution mechanism is used if the user holds the shift modifier during the gesture.


Implementation
    public function get resolveTargetPortCandidates():Boolean
    public function set resolveTargetPortCandidates(value:Boolean):void

See also

selfloopCreationAllowedproperty 
selfloopCreationAllowed:Boolean

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

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
snapContextproperty 
snapContext:SnapContext

The SnapContext which manages snapping model items to certain coordinates (e.g. other items). If set to null this input mode tries to obtain the SnapContext from the IInputModeContext. To explicitly disable snapping, SnapContext.voidInstance has to be set to this instance.

The default value is null.


Implementation
    public function get snapContext():SnapContext
    public function set snapContext(value:SnapContext):void

See also

IInputModeContext
SnapContext.voidInstance
snapDistanceproperty 
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.

The default value is 20.


Implementation
    public function get snapDistance():Number
    public function set snapDistance(value:Number):void
snapToTargetCandidateproperty 
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.

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

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

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
toggleSegmentOrientationRecognizerproperty 
toggleSegmentOrientationRecognizer:Function

Gets or sets the recognizer that toggles the orientation of the first orthogonally created segment. The default instance recognizes if the user hits the space key.


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

See also

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

The default value is true.


Implementation
    public function get useHitNodeTargetCandidatesOnly():Boolean
    public function set useHitNodeTargetCandidatesOnly(value:Boolean):void
validBeginCursorproperty 
validBeginCursor:Cursor

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

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

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

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 = null)

Creates a new instance using the given graph.

Parameters
graph:IGraph (default = null) — The graph to create the edge in and query the nodes from.
Method Detail
addDummyEdgeBend()method
protected function addDummyEdgeBend(location:IPoint):void

Adds a bend to the dummy edge

Parameters

location:IPoint — The location of the bend.

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.
assignPortLocationModelParameter()method 
protected function assignPortLocationModelParameter(node:INode, modelParameter:IPortLocationModelParameter):void

Assigns the port location model parameter and owner to the dummyEdge.

This method is a callback used by startCreateEdge.

Parameters

node:INode — The node to use for the source node.
 
modelParameter:IPortLocationModelParameter — The location model parameter of the port to use.

cancel()method 
override public 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.
createDummyDisplayObjectCreator()method 
protected function createDummyDisplayObjectCreator():IDisplayObjectCreator

Creates a display object creator that creates a display object for the DummyEdge and the port candidates.

Returns
IDisplayObjectCreator — The display object creator.
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 successful, 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

createEdgeBetweenCandidates()method 
protected function createEdgeBetweenCandidates(theGraph:IGraph, sourcePortCandidate:IPortCandidate, targetPortCandidate:IPortCandidate):IEdge

Callback used by createEdge if both sourcePortCandidate and targetPortCandidate habe been set.

This method will create the edge and connect them to the port candidates.

Parameters

theGraph:IGraph — The graph to create the edge for.
 
sourcePortCandidate:IPortCandidate — The candidate to use for the source.
 
targetPortCandidate:IPortCandidate — The candidate to use for the target.

Returns
IEdge — The edge created or null.
createEdgeBetweenNodes()method 
protected function 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.

Parameters

theGraph:IGraph — The graph instance to create the edge for.
 
sourceNode:INode — The source node of the edge.
 
targetNode:INode — The target node of the edge.

Returns
IEdge — The edge created or null if the edge could not be created.
createEdgeCreationInputModeContext()method 
protected function createEdgeCreationInputModeContext():IInputModeContext

Creates an IInputModeContext for us with the port candidates queries for the upcoming edge creation operation.

Returns
IInputModeContext
createStartPoint()method 
protected function createStartPoint():IMutablePoint

Factory method for the StartPoint property.

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

Returns
IMutablePoint
getChildInputModeContext()method 
protected function getChildInputModeContext():IInputModeContext

Returns the input mode context that will be passed to implementations that are called by this instance and require a context. This method caches the context for the current edge creation and creates a new instance using createEdgeCreationInputModeContext.

Returns
IInputModeContext

See also

getClosestCandidate()method 
protected function getClosestCandidate(candidates:Iterable, dragPoint:IPoint):IPortCandidate

Finds the closest valid candidate given a number of IPortCandidates and a location in world coordinates.

Parameters

candidates:Iterable — The candidates to find the closest from.
 
dragPoint:IPoint — The location of the mouse in world coordinates.

Returns
IPortCandidate — The candidate to use or null if no candidate satisfies the needs
getClosestSourceCandidate()method 
protected function getClosestSourceCandidate(candidates:Iterable, location:IPoint):IPortCandidate

Finds the closest candidate given a number of IPortCandidates and a location in world coordinates.

Parameters

candidates:Iterable — The candidates to find the closest from.
 
location:IPoint — The location of the mouse in world coordinates.

Returns
IPortCandidate — The candidate to use or null if no candidate satisfies the needs.
getClosestTargetCandidate()method 
protected function getClosestTargetCandidate(candidates:Iterable, dragPoint:IPoint):IPortCandidate

Finds the closest target candidate given a number of IPortCandidates and a location in world coordinates.

Parameters

candidates:Iterable — The candidates to find the closest from.
 
dragPoint:IPoint — The location of the mouse in world coordinates.

Returns
IPortCandidate — The candidate to use or null if no candidate satisfies the needs or isBendCreationEnforced yields true.
getDummyEdgeSnapLines()method 
protected function getDummyEdgeSnapLines(graphSnapContext:GraphSnapContext, dummyEdgeSegmentSnapLineProvider:ISnapLineProvider):Iterable

Gets the snap lines lines that are induced by the current dummy edge.

Parameters

graphSnapContext:GraphSnapContext — The graph snap context.
 
dummyEdgeSegmentSnapLineProvider:ISnapLineProvider — The dummy edge segment snap line provider.

Returns
Iterable — The snap lines induced by the current dummy edge.
getFirstSegmentDirection()method 
protected function getFirstSegmentDirection(dragVector:IPoint):uint

Calculates direction of first edge segment of the DummyNode. An edge starting in an border will always be orthogonal to the border's outer line. An edge starting in a corner will point the way the user dragged the mouse. An edge starting in the inner of the node will be directed the way dragged if direction isn't taken by another node.

Parameters

dragVector:IPoint — The drag vector. Last mouse location - sourcePort location

Returns
uint — The direction of the first edge segment as defined in EdgeSegmentDirection.

See also

getNode()method 
protected function getNode(point:IPoint):INode

Retrieves the node at a given position in world coordinates.

This implementation uses the getHitTestable method of the nodes to find hit nodes and uses the nodeComparisonFunction to determine the hit order and which node is hit first.

Parameters

point:IPoint

Returns
INode
getSourceNode()method 
protected function getSourceNode(sourcePoint:IPoint):INode

Finds the source node for a given point in world coordinates.

This method simply delegates to getNode.

Parameters

sourcePoint:IPoint — The location of the mouse at the end of the gesture.

Returns
INode — The node to use for the source node or null.
getSourcePortCandidate()method 
protected function getSourcePortCandidate(provider:IPortCandidateProvider, location:IPoint, shallResolveCandidates:Boolean):IPortCandidate

Finds the best matching source port IPortCandidate given a provider and the current location. The shallResolveCandidates parameter determines whether dynamic port candidates should be resolved with respect to location or simply discarded.

Parameters

provider:IPortCandidateProvider — The provider for the candidates.
 
location:IPoint — The location where the gesture was initiated.
 
shallResolveCandidates:Boolean — Determines whether PortCandidateValidity.DYNAMIC ports should be resolved with respect to the location or not.

Returns
IPortCandidate — The candidate to use or null.

See also

getSourcePortCandidateProvider()method 
protected function getSourcePortCandidateProvider(node:INode):IPortCandidateProvider

Retrieves the port candidate provider instance given a source node.

This implementations uses the node's lookup to retrieve an IPortCandidateProvider implementation.

Parameters

node:INode — The node to find the candidates for.

Returns
IPortCandidateProvider — A provider instance or null.
getTargetNode()method 
protected function getTargetNode(targetPoint:IPoint):INode

Finds the target node for a given point in world coordinates.

This method simply delegates to getNode.

Parameters

targetPoint:IPoint — The location of the mouse at the end of the gesture.

Returns
INode — The node to use for the target node or null.
getTargetPortCandidateProvider()method 
protected function getTargetPortCandidateProvider(sourceCandidate:IPortCandidate, dragPoint:IPoint, targetNode:INode):IPortCandidateProvider

Retrieves the port candidate provider instance given a source port candidate and a possible target node.

This implementations uses the targetNode's lookup to retrieve an IPortCandidateProvider implementation.

Parameters

sourceCandidate:IPortCandidate — The current source port candidate.
 
dragPoint:IPoint — The node to find the candidates for.
 
targetNode:INode — The location of the mouse.

Returns
IPortCandidateProvider — A provider instance or null.
getTargetPortCandidateProviders()method 
protected function getTargetPortCandidateProviders(sourceCandidate:IPortCandidate, dragPoint:IPoint):IPortCandidateProvider

Retrieves the IPortCandidateProvider instance that provides the possible candidates for the target of the edge given the current source candidate.

This implementation queries all nodes in the graph for their provider and returns a composite unless useHitNodeTargetCandidatesOnly is set to true in which case the target portCandidateProvider is queried using the current target node.

Parameters

sourceCandidate:IPortCandidate — The source candidate that has been chosen for the edge creation.
 
dragPoint:IPoint — The location of the mouse.

Returns
IPortCandidateProvider — The provider to get the port candidates from.
getTargetPortCandidates()method 
protected function getTargetPortCandidates(dragPoint:IPoint, shallResolveCandidates:Boolean):Iterable

Retrieves the target port candidates for a given location in world coordinates.

The shallResolveCandidates parameter determines whether dynamic port candidates should be resolved with respect to dragPoint or simply be discarded.

This implementation delegates to getTargetPortCandidateProvider or returns an empty enumerable if no provider has been found.

Parameters

dragPoint:IPoint — The location of the mouse in world coordinates.
 
shallResolveCandidates:Boolean — Determines whether PortCandidateValidity.DYNAMIC ports should be resolved with respect to dragPoint or not.

Returns
Iterable — A possibly empty enumeration over all target port candidates.

See also

initializeStateMachine()method 
override protected function initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void

Called to initialize the state machine.

This implementation does nothing.

Parameters

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

installCore()method 
override protected function installCore(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

invalidate()method 
override protected function invalidate():void

Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.

isBendCreationEnforced()method 
protected function isBendCreationEnforced():Boolean

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.

This implementation yields true if during the last mouse event the ctrlKey key had been pressed and bendCreationAllowed is set to true.

Returns
Booleantrue if bend creation is allowed and the ctrlKey was pressed during the last mouse event.
isCancelGesture()method 
protected function isCancelGesture(evt:Event):Boolean

Determines whether the current event cancels the gesture.

Parameters

evt:Event — the current event.

Returns
Booleantrue if the current event cancels the gesture.
isPortCandidateResolutionEnabled()method 
protected function isPortCandidateResolutionEnabled():Boolean

This method is called to determine whether PortCandidateValidity.DYNAMIC ports should be resolved or discarded. This implementation delegates to portCandidateResolutionRecognizer and passes the lastMouseEvent as the arguments.

Returns
Booleantrue if dynamic port candidates are resolved for the current mouse location; otherwise, false.

See also

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

Determines whether the current event removes the last bend.

Parameters

evt:Event — the current event.

Returns
Booleantrue if the current event removes the last bend.
isSourceNodeDraggingFinished()method 
protected function isSourceNodeDraggingFinished(evt:Event):Boolean

Determines whether the user has finished dragging over the source node.

Parameters

evt:Event — the current event.

Returns
Booleantrue if the current event finishes the dragging.
isValidBegin()method 
protected function isValidBegin(evt:Event):Boolean

Determines whether the current mouse state is valid for beginning the edge creation gesture.

If connectToCandidatesOnly is set to true, this method will only yield true if a valid source port candidate is found for the current source node.

Parameters

evt:Event

Returns
Booleantrue if a valid source port candidate is found for the source node.
isValidBend()method 
protected function isValidBend(evt:Event):Boolean

Determines whether it is currently allowed to create a bend.

Parameters

evt:Event

Returns
Boolean
isValidEnd()method 
protected function isValidEnd(evt:Event):Boolean

Determines whether the edge gesture may end at this state.

This method will yield false if isBendCreationEnforced yields true.

Parameters

evt:Event

Returns
Booleanfalse if isBendCreationEnforced is true
onEdgeCreated()method 
protected function onEdgeCreated(graph:IGraph, edge:IEdge):void

Called by createEdge(IControlPointList) after the edge has been finalized.

Parameters

graph:IGraph — The graph the edge has been created in.
 
edge:IEdge — The edge that has been created using this mode.

onEdgeCreationStarted()method 
protected function onEdgeCreationStarted(edge:IEdge):void

Raises the edgeCreationStarted event when the gesture for creating an edge has been initialized.

Parameters

edge:IEdge — The dummy edge that will be used during edge creation.


Events
GraphEditorEvent#EDGE_CREATION_STARTED
onGraphChanged()method 
protected function onGraphChanged(oldGraph:IGraph, newGraph:IGraph):void

Called when the graph property changes.

This implementation cancels the edge creation.

Parameters

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

onGraphStructureChanged()method 
protected function onGraphStructureChanged(evt:GraphEvent):void

Called when the graph structure of the graph changes during an edge creation gesture.

This implementation cancels the edge creation.

Parameters

evt:GraphEvent — The graph event of type GraphEvent.GRAPH_CHANGED

See also

onTargetLocationChanged()method 
public function onTargetLocationChanged(dragPoint:IPoint):void

Updates the visual representation and port candidates.

This method delegates to getTargetPortCandidates and getClosestTargetCandidate and eventually to updateTargetPortOwner.

Parameters

dragPoint:IPoint — The actual position of the drag point.

paintTargetPortCandidates()method 
public function paintTargetPortCandidates(ctx:IDisplayObjectContext, candidates:Iterable):DisplayObject

Draws representations of the IPortCandidates for the target port of the edge to create.

Parameters

ctx:IDisplayObjectContext — The paint context.
 
candidates:Iterable — The candidates to paint.

Returns
DisplayObject
removeLastBend()method 
protected function removeLastBend():void

Actually removes the last bend.

resolveCandidates()method 
protected function resolveCandidates(candidates:Iterable, location:IPoint):Iterable

Returns an enumerable over the given candidates where no instance has PortCandidateValidity.DYNAMIC validity.

If the location isn't null, method IPortCandidate.getPortCandidateAt is used to resolve the dynamic candidate to a real candidate, otherwise that candidate is discarded.

Parameters

candidates:Iterable — The candidates to possibly resolve.
 
location:IPoint — The location to resolve dynamic candidates against or null if they should be discarded instead.

Returns
Iterable — An enumeration of non-dynamic port candidates.

See also

PortCandidateValidity
IPortCandidate.validity
IPortCandidate.getPortCandidateAt
run()method 
override public function run(evt:Event):void

Parameters

evt:Event

setBendLocation()method 
protected function setBendLocation(index:int, location:IPoint):void

Callback that sets the location of the bend of the current dummy ede at the given index.

Parameters

index:int — The index of the bend.
 
location:IPoint — The new bend location.

setDragPoint()method 
protected function setDragPoint(x:Number, y:Number):void

Updates the drag point.

Parameters

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

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

Sets the IGraph that is associated with this instance.

Parameters

newGraph:IGraph — The IGraph to set.

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.

setTargetPortCandidate()method 
protected function setTargetPortCandidate(value:IPortCandidate):void

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

Parameters

value:IPortCandidate

startCreateEdge()method 
protected function startCreateEdge():void

Called at the beginning of the edge creation gesture.

This method assigns the edge style to the dummyEdge and resets the port candidates.

See also

uninstallCore()method 
override protected function uninstallCore(context:IInputModeContext):void

Uninstalls this mode from the canvas.

Subclasses should always call super.uninstallCore( canvas ) as the last statement. This implementation calls uninstallListeners.

Parameters

context:IInputModeContext — The canvas component to uninstall this input mode from.

updateTargetPortOwner()method 
protected function updateTargetPortOwner(oldOwner:IPortOwner, newOwner:IPortOwner):void

Updates the dummyEdge to reflect the current target port candidate.

This implementation creates a self loop of the dummy edge if the newOwner is the same as the owner of the sourcePortCandidate.

Parameters

oldOwner:IPortOwner — the owner of the sourcePortCandidate.
 
newOwner:IPortOwner — the owner of the current targetPortCandidate.

Event Detail
edgeCreated Event
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.EDGE_CREATED

Dispatched when an edge is added by the user. The edge property of the event contains the newly added edge.

Dispatched when a new edge has been created.

This event will only be dispatched for bends which have been deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if a bend is removed because its edge is removed.

edgeCreationStarted Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.EDGE_CREATION_STARTED

Dispatched when an edge creation has been initialized. The item property of the event contains the dummy edge that is used during creation.

Dispatched when a new edge creation has been initialized.

The item property contains the dummy edge that will be used during edge creation.