Package | twaver.network.interaction |
Class | public class CreateLinkInteractionHandler |
Inheritance | CreateLinkInteractionHandler ![]() ![]() |
Subclasses | CreateOrthogonalLinkInteractionHandler, CreateShapeLinkInteractionHandler |
Here is an example how to install interaction handlers on network canvas
network.interactionHandlers = new Collection([ new SelectInteractionHandler(network), new EditInteractionHandler(network), new MoveInteractionHandler(network), new DefaultInteractionHandler(network), new MapFilterInteractionHandler(network), ]);
See also
Property | Defined By | ||
---|---|---|---|
currentNode : Node = null | CreateLinkInteractionHandler | ||
currentPoint : Point = null | CreateLinkInteractionHandler | ||
fromNode : Node = null | CreateLinkInteractionHandler | ||
_linkClass : Class = null | CreateLinkInteractionHandler | ||
linkClass : Class [read-only]
Get the link class type will be created
| CreateLinkInteractionHandler | ||
mark : UIComponent = null | CreateLinkInteractionHandler | ||
![]() | network : Network [read-only]
Get network component of this interaction. | BasicInteractionHandler | |
toNode : Node = null | CreateLinkInteractionHandler |
Method | Defined By | ||
---|---|---|---|
CreateLinkInteractionHandler(network:Network, linkClass:Class = null, callback:Function = null)
Interaction link constructor. | CreateLinkInteractionHandler | ||
installListeners():void [override]
Install listeners on this interaction. | CreateLinkInteractionHandler | ||
uninstallListeners():void [override]
Uninstall listeners on this interaction. | CreateLinkInteractionHandler |
Method | Defined By | ||
---|---|---|---|
clear():void
Clear all mouse drag-and-drop information and the
trace mark painted on network canvas. | CreateLinkInteractionHandler | ||
Create link after "from node" and "to node" are both
selected by mouse. | CreateLinkInteractionHandler | ||
![]() | dispatchEvent(kind:String, e:MouseEvent, element:IElement = null, resizeDirection:String = null, pointIndex:int = -1):void
Dispatch event to listeners. | BasicInteractionHandler | |
drawPoints(g:Graphics, formRect:Rectangle):void
Draw line on graphics. | CreateLinkInteractionHandler | ||
getFromNode(e:MouseEvent):Node
Get "from node" selected by mouse during creating link
on canvas. | CreateLinkInteractionHandler | ||
Get "to node" selected by mouse during creating link
on canvas. | CreateLinkInteractionHandler | ||
handleMouseDown(e:MouseEvent):void
This method handle the mouse down event. | CreateLinkInteractionHandler | ||
handleMouseMove(e:MouseEvent):void
This method handle mouse move event. | CreateLinkInteractionHandler | ||
updateMark():void
This method draw and update the trace mark
on network canvas to show the link trace between from
and mouse cursor location when moving mouse cursor around on
network canvas to pick "to node". | CreateLinkInteractionHandler |
_linkClass | property |
protected var _linkClass:Class = null
currentNode | property |
protected var currentNode:Node = null
currentPoint | property |
protected var currentPoint:Point = null
fromNode | property |
protected var fromNode:Node = null
linkClass | property |
linkClass:Class
[read-only] Get the link class type will be created
protected function get linkClass():Class
mark | property |
protected var mark:UIComponent = null
toNode | property |
protected var toNode:Node = null
CreateLinkInteractionHandler | () | Constructor |
public function CreateLinkInteractionHandler(network:Network, linkClass:Class = null, callback:Function = null)
Interaction link constructor. This interaction will create specified link class type.
Parametersnetwork:Network — the network this interaction work for.
| |
linkClass:Class (default = null ) — the link class type this interaction will create.
| |
callback:Function (default = null ) — a function will be called after link has been created.
|
clear | () | method |
protected function clear():void
Clear all mouse drag-and-drop information and the trace mark painted on network canvas.
createLink | () | method |
protected function createLink():Link
Create link after "from node" and "to node" are both selected by mouse. A link will be created between this from node and to node.
ReturnsLink — the created link instance.
|
drawPoints | () | method |
protected function drawPoints(g:Graphics, formRect:Rectangle):void
Draw line on graphics.
Parameters
g:Graphics — the graphics
| |
formRect:Rectangle — point location.
|
getFromNode | () | method |
protected function getFromNode(e:MouseEvent):Node
Get "from node" selected by mouse during creating link on canvas.
Parameters
e:MouseEvent — combined mouse event
|
Node — the "from node" selected by mouse during creating link
on canvas.
|
getToNode | () | method |
protected function getToNode(e:MouseEvent):Node
Get "to node" selected by mouse during creating link on canvas.
Parameters
e:MouseEvent — combined mouse event
|
Node — the "to node" selected by mouse during creating link
on canvas.
|
handleMouseDown | () | method |
protected function handleMouseDown(e:MouseEvent):void
This method handle the mouse down event.
Parameters
e:MouseEvent — mouse event to be handled.
|
handleMouseMove | () | method |
protected function handleMouseMove(e:MouseEvent):void
This method handle mouse move event.
Parameters
e:MouseEvent — mouse event to be handled.
|
installListeners | () | method |
override public function installListeners():void
Install listeners on this interaction.
uninstallListeners | () | method |
override public function uninstallListeners():void
Uninstall listeners on this interaction.
updateMark | () | method |
protected function updateMark():void
This method draw and update the trace mark on network canvas to show the link trace between from and mouse cursor location when moving mouse cursor around on network canvas to pick "to node".