Packagetwaver.network.interaction
Classpublic class CreateShapeNodeInteractionHandler
InheritanceCreateShapeNodeInteractionHandler Inheritance BasicInteractionHandler Inheritance Object

This interaction used to create shape node on network canvas by clicking mouse on canvas to create a set of control points. Install this handler on network to get the ability to create shape node 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.ShapeNode
twaver.ShapeLink


Protected Properties
 PropertyDefined By
  currentPoint : Point = null
CreateShapeNodeInteractionHandler
  mark : UIComponent = null
CreateShapeNodeInteractionHandler
 Inheritednetwork : Network
[read-only] Get network component of this interaction.
BasicInteractionHandler
  points : ICollection = null
CreateShapeNodeInteractionHandler
  shapeNodeClass : Class
[read-only] Get the new created shape node class type.
CreateShapeNodeInteractionHandler
Public Methods
 MethodDefined By
  
CreateShapeNodeInteractionHandler(network:Network, shapeNodeClass:Class = null)
Create shape node interaction handler for specified network and class type.
CreateShapeNodeInteractionHandler
  
[override] Install listeners on this interaction.
CreateShapeNodeInteractionHandler
  
[override] Uninstall listeners on this interaction.
CreateShapeNodeInteractionHandler
Protected Methods
 MethodDefined By
  
clear():void
Clear all mark draw on network canvas and the mouse points.
CreateShapeNodeInteractionHandler
  
Create shape node instance and return.
CreateShapeNodeInteractionHandler
 Inherited
dispatchEvent(kind:String, e:MouseEvent, element:IElement = null, resizeDirection:String = null, pointIndex:int = -1):void
Dispatch event to listeners.
BasicInteractionHandler
  
handleMouseDown(e:MouseEvent):void
This method handle mouse down event.
CreateShapeNodeInteractionHandler
  
handleMouseMove(e:MouseEvent):void
This method handle the mouse moved event.
CreateShapeNodeInteractionHandler
  
updateMark():void
Update all painted mark on network canvas.
CreateShapeNodeInteractionHandler
Property Detail
currentPointproperty
protected var currentPoint:Point = null

markproperty 
protected var mark:UIComponent = null

pointsproperty 
protected var points:ICollection = null

shapeNodeClassproperty 
shapeNodeClass:Class  [read-only]

Get the new created shape node class type.


Implementation
    protected function get shapeNodeClass():Class
Constructor Detail
CreateShapeNodeInteractionHandler()Constructor
public function CreateShapeNodeInteractionHandler(network:Network, shapeNodeClass:Class = null)

Create shape node interaction handler for specified network and class type.

Parameters
network:Network — the network this interaction handler will work with.
 
shapeNodeClass:Class (default = null) — the new created shape node class type.
Method Detail
clear()method
protected function clear():void

Clear all mark draw on network canvas and the mouse points.

createShapeNode()method 
protected function createShapeNode():ShapeNode

Create shape node instance and return.

Returns
ShapeNode — the new create shape node instance.
handleMouseDown()method 
protected function handleMouseDown(e:MouseEvent):void

This method handle mouse down event.

Parameters

e:MouseEvent — the mouse event to be handled.

handleMouseMove()method 
protected function handleMouseMove(e:MouseEvent):void

This method handle the mouse moved event.

Parameters

e:MouseEvent — the 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

Update all painted mark on network canvas.