Package | com.yworks.graph.input |
Class | public class CreateEdgeInputMode |
Inheritance | CreateEdgeInputMode StateMachineInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
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 INode
s in the graph to display port candidates and to finally
create the edges.
Property | Defined 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 | ||
canceledState : State [read-only]
Returns the canceled state of the state machine. | StateMachineInputMode | ||
cancelRecognizer : Function
Gets or sets the property that determines cancel events. | CreateEdgeInputMode | ||
canvas : 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 | ||
controller : 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 | ||
enabled : 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 | ||
inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | ||
installed : Boolean [read-only]
Whether this mode is currently installed, i.e
if a call to the canvas property will yield a non-null result. | AbstractInputMode | ||
lastMouseEvent : CanvasMouseEvent [read-only]
Returns the last mouse event. | StateMachineInputMode | ||
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 | ||
preferredCursor : 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 | ||
startState : State [read-only]
Returns the start state of the state machine. | StateMachineInputMode | ||
stateMachine : StateMachine [read-only]
Gets the state machine. | StateMachineInputMode | ||
stoppedState : State [read-only]
Returns the stopped state of the state machine. | StateMachineInputMode | ||
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 |
Property | Defined By | ||
---|---|---|---|
_lastEvent : Event
The last Event that has been delivered to this instance. | StateMachineInputMode | ||
_lastMouseEvent : CanvasMouseEvent
The last MouseEvent that has been delivered to this instance. | StateMachineInputMode | ||
sourcePortCandidate : IPortCandidate
Gets or sets the candidate for the IEdge.sourcePort
of the edge to be created. | CreateEdgeInputMode | ||
stopEventRecognizer : Function [read-only]
An event recognizer for the state machine
that is triggered if this mode has been stoppped. | StateMachineInputMode |
Method | Defined By | ||
---|---|---|---|
CreateEdgeInputMode(graph:IGraph = null)
Creates a new instance using the given graph. | CreateEdgeInputMode | ||
cancel():void [override] | CreateEdgeInputMode | ||
dispose():void
Disposes this input mode. | AbstractInputMode | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
onTargetLocationChanged(dragPoint:IPoint):void
Updates the visual representation and port candidates. | CreateEdgeInputMode | ||
Draws representations of the IPortCandidates for the target port of the edge to create. | CreateEdgeInputMode | ||
resetMachine():void
Runs the machine using a special reset event. | StateMachineInputMode | ||
run(evt:Event):void [override] | CreateEdgeInputMode | ||
stop():Boolean [override]
Runs the machine using a special stop event. | StateMachineInputMode | ||
uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode |
Method | Defined By | ||
---|---|---|---|
addDummyEdgeBend(location:IPoint):void
Adds a bend to the dummy edge
| CreateEdgeInputMode | ||
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 | ||
cancelEdgeCreation(t:TransitionEvent):void
Transition that cleans up everything that has been built until now. | CreateEdgeInputMode | ||
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | ||
createBend(t:TransitionEvent):void
Adds another bend to the edge's path. | CreateEdgeInputMode | ||
createBendAt(x:Number, y:Number):void
Actually creates the bend at the given location. | CreateEdgeInputMode | ||
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 | ||
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 | ||
Factory method that creates a start State for the given machine. | StateMachineInputMode | ||
Factory method that creates the state machine. | StateMachineInputMode | ||
Factory method that creates a stopped State
for the given machine. | StateMachineInputMode | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | 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 | ||
getFirstSegmentDirection(dragVector:IPoint):uint
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 | ||
getTargetPortCandidateProvider(sourceCandidate:IPortCandidate, dragPoint:IPoint, targetNode:INode):IPortCandidateProvider
Retrieves the port candidate provider instance given a source port candidate and a possible target node. | CreateEdgeInputMode | ||
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. | CreateEdgeInputMode | ||
Retrieves the target port candidates for a given location in world coordinates. | CreateEdgeInputMode | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | ||
initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void [override]
Called to initialize the state machine. | CreateEdgeInputMode | ||
installCore(context:IInputModeContext):void [override]
Installs this mode into the given canvas. | CreateEdgeInputMode | ||
installListeners():void
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 | ||
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. | CreateEdgeInputMode | ||
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 | ||
isDisabledEvent(evt:Event):Boolean
Method that identifies an event as a disabled event. | StateMachineInputMode | ||
isEnabledEvent(evt:Event):Boolean
Method that identifies an event as an enabled event. | StateMachineInputMode | ||
isMutexAquiredEvent(evt:Event):Boolean
Method that identifies an event as a mutexAquired event. | StateMachineInputMode | ||
isMutexLostEvent(evt:Event):Boolean
Method that identifies an event as a mutexLost event. | StateMachineInputMode | ||
isPortCandidateResolutionEnabled():Boolean
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 | ||
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 | ||
onCancelStateEntered(evt:StateChangeEvent):void
Called when the cancel state has been entered. | StateMachineInputMode | ||
onDisable():void
Runs the state machine using a disable event. | StateMachineInputMode | ||
onDisabled():void
Called when the enabled property changes to false. | AbstractConcurrentInputMode | ||
Called by createEdge(IControlPointList)
after the edge has been finalized. | CreateEdgeInputMode | ||
onEdgeCreationStarted(edge:IEdge):void
Raises the edgeCreationStarted event when the gesture for creating an edge has been initialized. | CreateEdgeInputMode | ||
onEnable():void
Runs the state machine using a enable event. | StateMachineInputMode | ||
onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | ||
Called when the graph property changes. | CreateEdgeInputMode | ||
onGraphStructureChanged(evt:GraphEvent):void
Called when the graph structure of the graph changes during an edge creation gesture. | CreateEdgeInputMode | ||
onMachineReset():void | StateMachineInputMode | ||
onMutexObtained():void [override]
Runs the state machine using a mutex obtained event. | StateMachineInputMode | ||
onMutexReleased():void [override]
Runs the state machine using a mutex lost event. | StateMachineInputMode | ||
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | ||
onRun(evt:Event):void
Callback method that will be called after the state machine has
been run using the arguments provided. | StateMachineInputMode | ||
onStopStateEntered(evt:StateChangeEvent):void
Called when the cancel state has been entered. | StateMachineInputMode | ||
releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | ||
removeLastBend():void
Actually removes the last bend. | CreateEdgeInputMode | ||
requestMutex():void
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 | ||
Sets the IGraph that is associated with this instance. | CreateEdgeInputMode | ||
setGraphCanvas(graphCanvas:GraphCanvasComponent):void
Sets the GraphCanvasComponent that is associated with this instance. | CreateEdgeInputMode | ||
setLastMouseEvent(evt:CanvasMouseEvent):void | StateMachineInputMode | ||
setPreferredCursorTransition(cursorClass:Class):Function
Factory method that can be used to obtain an listener
implementation that sets the given preferredCursor. | StateMachineInputMode | ||
setResetCursorTransition():Function
Factory method that can be used to obtain a listener implementation
that resets the preferredCursor. | StateMachineInputMode | ||
setTargetPortCandidate(value:IPortCandidate):void
Sets the candidate for the IEdge.targetPort
of the edge to be created. | CreateEdgeInputMode | ||
startCreateEdge():void
Called at the beginning of the edge creation gesture. | CreateEdgeInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Uninstalls this mode from the canvas. | CreateEdgeInputMode | ||
uninstallListeners():void
Uninstalls all listeners, this instance has installed on calling intallListeners()
| StateMachineInputMode | ||
Updates the dummyEdge to reflect the current target port candidate. | CreateEdgeInputMode |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when an edge is added by the user. | CreateEdgeInputMode | |||
Dispatched when an edge creation has been initialized. | CreateEdgeInputMode | |||
Dispatched after the input mode was installed. | AbstractInputMode | |||
Dispatched before the input mode will be installed. | AbstractInputMode | |||
Dispatched when the default cursor changed. | AbstractConcurrentInputMode | |||
Dispatched after the input mode was uninstalled. | AbstractInputMode | |||
Dispatched before the input mode will be uninstalled. | AbstractInputMode |
beginHitTestable | property |
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.
public function get beginHitTestable():IHitTestable
public function set beginHitTestable(value:IHitTestable):void
See also
bendCreationAllowed | property |
bendCreationAllowed:Boolean
Determines whether or not to allow the creation of bends.
public function get bendCreationAllowed():Boolean
public function set bendCreationAllowed(value:Boolean):void
cancelRecognizer | property |
cancelRecognizer:Function
Gets or sets the property that determines cancel events.
public function get cancelRecognizer():Function
public function set cancelRecognizer(value:Function):void
See also
connectToCandidatesOnly | property |
connectToCandidatesOnly:Boolean
Gets or sets a property that determines whether this mode allows
connecting to IPortCandidate
s 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
.
public function get connectToCandidatesOnly():Boolean
public function set connectToCandidatesOnly(value:Boolean):void
controlPointList | property |
controlPointList:IMutableControlPoints
[read-only] Gets or sets the control points used by the mode during the edge creation.
public function get controlPointList():IMutableControlPoints
controlPoints | property |
controlPoints:IMutableControlPoints
[write-only] public function set controlPoints(value:IMutableControlPoints):void
createBendRecognizer | property |
createBendRecognizer:Function
The event recognizer that recognizes the creation of a bend.
public function get createBendRecognizer():Function
public function set createBendRecognizer(value:Function):void
See also
disableSnappingRecognizer | property |
disableSnappingRecognizer:Function
Gets or sets event recognizer that recognizes when the user temporarily disables snapping.
The default value is EventRecognizers#CTRL_PRESSED
.
public function get disableSnappingRecognizer():Function
public function set disableSnappingRecognizer(value:Function):void
displayObjectCreator | property |
displayObjectCreator:IDisplayObjectCreator
[read-only] Gets the display object creator that creates the display object for the edge and port candidates.
public function get displayObjectCreator():IDisplayObjectCreator
draggedRecognizer | property |
draggedRecognizer:Function
The event recognizer that recognizes the initial dragging gesture that is used to initiate the creation after the preparation.
public function get draggedRecognizer():Function
public function set draggedRecognizer(value:Function):void
See also
dragPoint | property |
dragPoint:IMutablePoint
[read-only] Gets the dragging point for the edge creation.
public function get dragPoint():IMutablePoint
dummyEdge | property |
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.
public function get dummyEdge():IEdge
public function set dummyEdge(value:IEdge):void
enableSnappingRecognizer | property |
enableSnappingRecognizer:Function
Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping.
The default value is EventRecognizers#CTRL_RELEASED
.
public function get enableSnappingRecognizer():Function
public function set enableSnappingRecognizer(value:Function):void
endHitTestable | property |
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.
public function get endHitTestable():IHitTestable
public function set endHitTestable(value:IHitTestable):void
See also
enforceBendCreationRecognizer | property |
enforceBendCreationRecognizer:Function
Gets or sets the recognizer function that will be queried to decide if bend creation is enforced.
public function get enforceBendCreationRecognizer():Function
public function set enforceBendCreationRecognizer(value:Function):void
See also
finishRecognizer | property |
finishRecognizer:Function
The event recognizer that recognizes the finishing gesture that is used to end the edge creation on the target node.
public function get finishRecognizer():Function
public function set finishRecognizer(value:Function):void
See also
forceSnapToCandidate | property |
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.
public function get forceSnapToCandidate():Boolean
public function set forceSnapToCandidate(value:Boolean):void
graph | property |
graph:IGraph
Gets the Graph this mode is acting upon.
public function get graph():IGraph
public function set graph(value:IGraph):void
graphCanvas | property |
graphCanvas:GraphCanvasComponent
[read-only]
Gets the GraphCanvasComponent this mode is working on or null
.
This property is set by setGraphControl
which is
triggered if this mode is installed in
a GraphCanvasComponent
.
public function get graphCanvas():GraphCanvasComponent
movedOrDraggedRecognizer | property |
movedOrDraggedRecognizer:Function
The event recognizer that recognizes the movement of the end point of the edge.
public function get movedOrDraggedRecognizer():Function
public function set movedOrDraggedRecognizer(value:Function):void
See also
nodeBorderWidthRatio | property |
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
.
public function get nodeBorderWidthRatio():Number
public function set nodeBorderWidthRatio(value:Number):void
nodeComparisonFunction | property |
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.
public function get nodeComparisonFunction():Function
public function set nodeComparisonFunction(value:Function):void
orthogonalEdgeCreation | property |
orthogonalEdgeCreation:Boolean
Gets or sets the property that enforces creation of orthogonal edges.
The default value is false
.
public function get orthogonalEdgeCreation():Boolean
public function set orthogonalEdgeCreation(value:Boolean):void
orthogonalSnapDistance | property |
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
.
public function get orthogonalSnapDistance():Number
public function set orthogonalSnapDistance(value:Number):void
portCandidateResolutionRecognizer | property |
portCandidateResolutionRecognizer:Function
The event recognizer that detects changes to the isPortCandidateResolutionEnabled
property.
public function get portCandidateResolutionRecognizer():Function
public function set portCandidateResolutionRecognizer(value:Function):void
preferredMinimalEdgeDistance | property |
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
.
public function get preferredMinimalEdgeDistance():Number
public function set preferredMinimalEdgeDistance(value:Number):void
prepareRecognizer | property |
prepareRecognizer:Function
The event recognizer that recognizes the starting gesture that is used to prepare the edge creation on the target node.
public function get prepareRecognizer():Function
public function set prepareRecognizer(value:Function):void
See also
removeBendRecognizer | property |
removeBendRecognizer:Function
Gets or sets the property that determines bend removal events.
public function get removeBendRecognizer():Function
public function set removeBendRecognizer(value:Function):void
See also
resolveSourcePortCandidates | property |
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.
public function get resolveSourcePortCandidates():Boolean
public function set resolveSourcePortCandidates(value:Boolean):void
See also
resolveTargetPortCandidates | property |
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.
public function get resolveTargetPortCandidates():Boolean
public function set resolveTargetPortCandidates(value:Boolean):void
See also
selfloopCreationAllowed | property |
selfloopCreationAllowed:Boolean
Determines whether or not to allow the creation of self loops.
The default value is true;
.
public function get selfloopCreationAllowed():Boolean
public function set selfloopCreationAllowed(value:Boolean):void
showPortCandidates | property |
showPortCandidates:Boolean
Determines whether or not to display possible port candidates during the creation of the edge.
The default value is true
.
public function get showPortCandidates():Boolean
public function set showPortCandidates(value:Boolean):void
snapContext | property |
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
public function get snapContext():SnapContext
public function set snapContext(value:SnapContext):void
See also
snapDistance | property |
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
.
public function get snapDistance():Number
public function set snapDistance(value:Number):void
snapToTargetCandidate | property |
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.
public function get snapToTargetCandidate():Boolean
public function set snapToTargetCandidate(value:Boolean):void
snapToTargetCandidateOwner | property |
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
.
public function get snapToTargetCandidateOwner():Boolean
public function set snapToTargetCandidateOwner(value:Boolean):void
sourcePortCandidate | property |
sourcePortCandidate:IPortCandidate
Gets or sets the candidate for the IEdge.sourcePort
of the edge to be created.
protected function get sourcePortCandidate():IPortCandidate
protected function set sourcePortCandidate(value:IPortCandidate):void
startPoint | property |
startPoint:IMutablePoint
[read-only] Gets the starting point for the edge creation.
public function get startPoint():IMutablePoint
targetPortCandidate | property |
targetPortCandidate:IPortCandidate
[read-only]
Gets the candidate for the IEdge.targetPort
of the edge to be created.
public function get targetPortCandidate():IPortCandidate
toggleSegmentOrientationRecognizer | property |
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.
public function get toggleSegmentOrientationRecognizer():Function
public function set toggleSegmentOrientationRecognizer(value:Function):void
See also
useHitNodeTargetCandidatesOnly | property |
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
.
public function get useHitNodeTargetCandidatesOnly():Boolean
public function set useHitNodeTargetCandidatesOnly(value:Boolean):void
validBeginCursor | property |
validBeginCursor:Cursor
Sets the cursor that indicates a valid place to begin an edge creation.
public function get validBeginCursor():Cursor
public function set validBeginCursor(value:Cursor):void
validBendCursor | property |
validBendCursor:Cursor
Sets the cursor that indicates a valid place to create a bend.
public function get validBendCursor():Cursor
public function set validBendCursor(value:Cursor):void
validBendHitTestable | property |
validBendHitTestable:IHitTestable
Gets or sets an IHitTestable
that determines whether it is valid to create a bend here.
The default implementation always returns true
.
public function get validBendHitTestable():IHitTestable
public function set validBendHitTestable(value:IHitTestable):void
validEndCursor | property |
validEndCursor:Cursor
Sets the cursor that indicates a valid place to finish creation.
public function get validEndCursor():Cursor
public function set validEndCursor(value:Cursor):void
CreateEdgeInputMode | () | Constructor |
public function CreateEdgeInputMode(graph:IGraph = null)
Creates a new instance using the given graph.
Parametersgraph:IGraph (default = null ) — The graph to create the edge in and query the nodes from.
|
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.
|
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.
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
.
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.
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.
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.
ReturnsDefaultNode — 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.
|
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.
|
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.
|
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.
IInputModeContext |
createStartPoint | () | method |
protected function createStartPoint():IMutablePoint
Factory method for the StartPoint property.
This implementation returns the location
of
the dummyEdge
's IEdge.sourcePort
.
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
.
IInputModeContext |
See also
getClosestCandidate | () | method |
protected function getClosestCandidate(candidates:Iterable, dragPoint:IPoint):IPortCandidate
Finds the closest valid candidate given a number of IPortCandidate
s 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.
|
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 IPortCandidate
s 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.
|
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 IPortCandidate
s 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.
|
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.
|
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
|
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 |
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
.
Boolean — true 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.
|
Boolean — true 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.
Boolean — true 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.
|
Boolean — true 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.
|
Boolean — true 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 |
Boolean — true 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 |
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 |
Boolean — false 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.
|
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 IPortCandidate
s for the target port of the edge to create.
Parameters
ctx:IDisplayObjectContext — The paint context.
| |
candidates:Iterable — The candidates to paint.
|
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.
|
Iterable — An enumeration of non-dynamic port candidates.
|
See also
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 .
|
edgeCreated | Event |
com.yworks.graph.input.GraphEditorEvent
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.
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 |
com.yworks.graph.input.GraphEditorEvent
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.
The item
property contains the dummy edge that will be used during edge creation.