Package | twaver.network.interaction |
Class | public class CreateShapeLinkInteractionHandler |
Inheritance | 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 | |
points : ICollection = null | CreateShapeLinkInteractionHandler | ||
![]() | toNode : Node = null | CreateLinkInteractionHandler |
Method | Defined By | ||
---|---|---|---|
CreateShapeLinkInteractionHandler(network:Network, linkClass:Class = null)
Constructor. | CreateShapeLinkInteractionHandler | ||
![]() | installListeners():void [override]
Install listeners on this interaction. | CreateLinkInteractionHandler | |
![]() | uninstallListeners():void [override]
Uninstall listeners on this interaction. | CreateLinkInteractionHandler |
Method | Defined By | ||
---|---|---|---|
clear():void [override]
Clear all mouse drag-and-drop information and the
trace mark painted on network canvas. | CreateShapeLinkInteractionHandler | ||
[override]
Create link after "from node" and "to node" are both
selected by mouse. | CreateShapeLinkInteractionHandler | ||
![]() | 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 [override]
Draw line on graphics. | CreateShapeLinkInteractionHandler | ||
![]() | 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 [override]
This method handle the mouse down event. | CreateShapeLinkInteractionHandler | ||
![]() | 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 |
points | property |
protected var points:ICollection = null
CreateShapeLinkInteractionHandler | () | Constructor |
public function CreateShapeLinkInteractionHandler(network:Network, linkClass:Class = null)
Constructor. Create a shape link interaction handler for specified network and link class type.
Parametersnetwork:Network — network this interaction handler will work with
| |
linkClass:Class (default = null ) — the created shape link type.
|
clear | () | method |
override protected function clear():void
Clear all mouse drag-and-drop information and the trace mark painted on network canvas.
createLink | () | method |
override 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 |
override protected function drawPoints(g:Graphics, formRect:Rectangle):void
Draw line on graphics.
Parameters
g:Graphics — the graphics
| |
formRect:Rectangle — point location.
|
handleMouseDown | () | method |
override protected function handleMouseDown(e:MouseEvent):void
This method handle the mouse down event.
Parameters
e:MouseEvent — mouse event to be handled.
|