Packagetwaver.network.interaction
Classpublic class CreateOrthogonalLinkInteractionHandler
InheritanceCreateOrthogonalLinkInteractionHandler Inheritance CreateLinkInteractionHandler Inheritance BasicInteractionHandler Inheritance Object

This interaction used to create orthogonal links on network canvas by dragging mouse from the "from node" to "to node". Install this handler on network to get the ability to create orthogonal link on network canvas.

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

twaver.Link


Protected Properties
 PropertyDefined By
 InheritedcurrentNode : Node = null
CreateLinkInteractionHandler
 InheritedcurrentPoint : Point = null
CreateLinkInteractionHandler
 InheritedfromNode : Node = null
CreateLinkInteractionHandler
 Inherited_linkClass : Class = null
CreateLinkInteractionHandler
 InheritedlinkClass : Class
[read-only] Get the link class type will be created
CreateLinkInteractionHandler
 Inheritedmark : UIComponent = null
CreateLinkInteractionHandler
 Inheritednetwork : Network
[read-only] Get network component of this interaction.
BasicInteractionHandler
 InheritedtoNode : Node = null
CreateLinkInteractionHandler
Public Methods
 MethodDefined By
  
CreateOrthogonalLinkInteractionHandler(network:Network, linkClass:Class = null, callback:Function = null, linkType:String = null, isByControlPoint:Boolean = false, value:Number = -1, splitByPercent:Boolean = false)
Constructor.
CreateOrthogonalLinkInteractionHandler
 Inherited
[override] Install listeners on this interaction.
CreateLinkInteractionHandler
 Inherited
[override] Uninstall listeners on this interaction.
CreateLinkInteractionHandler
Protected Methods
 MethodDefined By
 Inherited
clear():void
Clear all mouse drag-and-drop information and the trace mark painted on network canvas.
CreateLinkInteractionHandler
  
[override] Create link after "from node" and "to node" are both selected by mouse.
CreateOrthogonalLinkInteractionHandler
 Inherited
dispatchEvent(kind:String, e:MouseEvent, element:IElement = null, resizeDirection:String = null, pointIndex:int = -1):void
Dispatch event to listeners.
BasicInteractionHandler
  
drawPoints(g:Graphics, sourceBounds:Rectangle):void
[override] Draw line on graphics.
CreateOrthogonalLinkInteractionHandler
 Inherited
getFromNode(e:MouseEvent):Node
Get "from node" selected by mouse during creating link on canvas.
CreateLinkInteractionHandler
 Inherited
getToNode(e:MouseEvent):Node
Get "to node" selected by mouse during creating link on canvas.
CreateLinkInteractionHandler
 Inherited
handleMouseDown(e:MouseEvent):void
This method handle the mouse down event.
CreateLinkInteractionHandler
 Inherited
handleMouseMove(e:MouseEvent):void
This method handle mouse move event.
CreateLinkInteractionHandler
 Inherited
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
Constructor Detail
CreateOrthogonalLinkInteractionHandler()Constructor
public function CreateOrthogonalLinkInteractionHandler(network:Network, linkClass:Class = null, callback:Function = null, linkType:String = null, isByControlPoint:Boolean = false, value:Number = -1, splitByPercent:Boolean = false)

Constructor. Create an orthogonal link interaction handler for this network. Handler will create specified link class instance with specified link type.

Parameters
network:Network — the network this handler will work with.
 
linkClass:Class (default = null) — the new created link class type
 
callback:Function (default = null) — this will be called when link is created.
 
linkType:String (default = null) — link type of the new created link.
 
isByControlPoint:Boolean (default = false)link.setStyle(Styles.LINK_CONTROL_POINT,controlPoint);
 
value:Number (default = -1)link.setStyle(Styles.LINK_SPLIT_PERCENT,value);
 
splitByPercent:Boolean (default = false)link.setStyle(Styles.LINK_SPLIT_BY_PERCENT,splitByPercent);
Method Detail
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.

Returns
Link — the created link instance.
drawPoints()method 
override protected function drawPoints(g:Graphics, sourceBounds:Rectangle):void

Draw line on graphics.

Parameters

g:Graphics — the graphics
 
sourceBounds:Rectangle — point location.