Packagetwaver.network.layout
Classpublic class CloudLayouter
InheritanceCloudLayouter Inheritance Object

Perform a layout algorithm for connected network elements and display elements on the surface of a 3D globe.

See the left-bottom corner demo pictures in TWaver Flex online demo to know more about cloud layout.



Public Properties
 PropertyDefined By
  active : Boolean
Check whether layouter now is active.
CloudLayouter
  ceaseLimit : Number
Get cease limit.
CloudLayouter
  ceaseRate : Number
Get cease rate of this layout.
CloudLayouter
  count : int
[read-only] Get total node counts.
CloudLayouter
  elliptical : Boolean
Whether layout shape is elliptical.
CloudLayouter
  layoutRect : Rectangle
[read-only] Get the layouted area.
CloudLayouter
  mouseMoveFunction : Function
Get the function that will be called when mouse is moved.
CloudLayouter
  mouseOverFunction : Function
Get the function that will be called when mouse is moved over network canvas.
CloudLayouter
  moveSpeed : Number
Get the node movement speed.
CloudLayouter
  network : Network
[read-only] Get connected network component.
CloudLayouter
  percentPadding : Number
Get padding percent.
CloudLayouter
  reloadOnDataBoxChanged : Boolean
Whether need to reload data when network data box has been changed.
CloudLayouter
  running : Boolean
[read-only] Check whether this layouter is running now.
CloudLayouter
  timer : Timer
[read-only] Get the timer of this layouter.
CloudLayouter
  timerDelay : Number
Get the delay value of internal timer.
CloudLayouter
  updateLayoutRectOnResized : Boolean
Update the layout of related rectangle area if element is resized.
CloudLayouter
  updateNodeFunction : Function
Get the function used to update node.
CloudLayouter
Public Methods
 MethodDefined By
  
Cloud layout constructor.
CloudLayouter
  
centerNode(node:Node):void
Centralize specified node to the center location of the cloud.
CloudLayouter
  
isLayoutable(node:Node):Boolean
Check whether specified node element is layoutable.
CloudLayouter
  
reload():void
Reload all layout data.
CloudLayouter
  
start(needToReset:Boolean = true):void
Call this to start the layouter.
CloudLayouter
  
stop(removeListeners:Boolean = true):void
Call this to stop layout.
CloudLayouter
  
updateLayoutRect(needToReload:Boolean = false):void
update the layout for the layout rectangle.
CloudLayouter
Protected Methods
 MethodDefined By
  
Calculate the control point for specified node.
CloudLayouter
  
This method to handle data box change event.
CloudLayouter
  
handleMouseMove(e:MouseEvent):void
This method to handle mouse move event.
CloudLayouter
  
handleMouseOver(e:MouseEvent):void
This method to handle mouse over event.
CloudLayouter
  
handleNetworkPropertyChange(e:PropertyChangeEvent):void
This method handle network property change event.
CloudLayouter
  
handleResize(e:ResizeEvent):void
Handle element resize event.
CloudLayouter
  
handleRollOut(e:MouseEvent):void
Handle mouse roll out event.
CloudLayouter
  
This method to handle the data selection change.
CloudLayouter
  
isAtCenter(node:Node, perspective:Number, cx:Number, cy:Number, cz:Number):Boolean
Whether specified node is at center location of the cloud.
CloudLayouter
  
updateNode(node:Node, zIndex:int, count:int, alpha:Number):void
Update a node by calling updateNodeFunction function.
CloudLayouter
Property Detail
activeproperty
active:Boolean

Check whether layouter now is active.


Implementation
    public function get active():Boolean
    public function set active(value:Boolean):void
ceaseLimitproperty 
ceaseLimit:Number

Get cease limit. Default value is 0.01.


Implementation
    public function get ceaseLimit():Number
    public function set ceaseLimit(value:Number):void
ceaseRateproperty 
ceaseRate:Number

Get cease rate of this layout. Default value is 0.9.


Implementation
    public function get ceaseRate():Number
    public function set ceaseRate(value:Number):void
countproperty 
count:int  [read-only]

Get total node counts.


Implementation
    public function get count():int
ellipticalproperty 
elliptical:Boolean

Whether layout shape is elliptical. Default value is true.


Implementation
    public function get elliptical():Boolean
    public function set elliptical(value:Boolean):void
layoutRectproperty 
layoutRect:Rectangle  [read-only]

Get the layouted area.


Implementation
    public function get layoutRect():Rectangle
mouseMoveFunctionproperty 
mouseMoveFunction:Function

Get the function that will be called when mouse is moved.


Implementation
    public function get mouseMoveFunction():Function
    public function set mouseMoveFunction(value:Function):void
mouseOverFunctionproperty 
mouseOverFunction:Function

Get the function that will be called when mouse is moved over network canvas.


Implementation
    public function get mouseOverFunction():Function
    public function set mouseOverFunction(value:Function):void
moveSpeedproperty 
moveSpeed:Number

Get the node movement speed. Default value is 2.


Implementation
    public function get moveSpeed():Number
    public function set moveSpeed(value:Number):void
networkproperty 
network:Network  [read-only]

Get connected network component.


Implementation
    public function get network():Network
percentPaddingproperty 
percentPadding:Number

Get padding percent. Default value is 0.25.


Implementation
    public function get percentPadding():Number
    public function set percentPadding(value:Number):void
reloadOnDataBoxChangedproperty 
reloadOnDataBoxChanged:Boolean

Whether need to reload data when network data box has been changed. Default value is true.


Implementation
    public function get reloadOnDataBoxChanged():Boolean
    public function set reloadOnDataBoxChanged(value:Boolean):void
runningproperty 
running:Boolean  [read-only]

Check whether this layouter is running now.


Implementation
    public function get running():Boolean
timerproperty 
timer:Timer  [read-only]

Get the timer of this layouter.


Implementation
    public function get timer():Timer
timerDelayproperty 
timerDelay:Number

Get the delay value of internal timer. Default value is 50.


Implementation
    public function get timerDelay():Number
    public function set timerDelay(value:Number):void
updateLayoutRectOnResizedproperty 
updateLayoutRectOnResized:Boolean

Update the layout of related rectangle area if element is resized. Default value is true.


Implementation
    public function get updateLayoutRectOnResized():Boolean
    public function set updateLayoutRectOnResized(value:Boolean):void
updateNodeFunctionproperty 
updateNodeFunction:Function

Get the function used to update node. It will be called when node is layouted and moved.


Implementation
    public function get updateNodeFunction():Function
    public function set updateNodeFunction(value:Function):void
Constructor Detail
CloudLayouter()Constructor
public function CloudLayouter(network:Network)

Cloud layout constructor. Layout elements on specified network in cloud effect.

Parameters
network:Network — the network component to be layout.
Method Detail
centerNode()method
public function centerNode(node:Node):void

Centralize specified node to the center location of the cloud.

Parameters

node:Node — the node to be centralized.

createControlPoint()method 
protected function createControlPoint(node:Node):Point

Calculate the control point for specified node.

Parameters

node:Node — a node element

Returns
Point — the control point for specified node.
handleDataBoxChange()method 
protected function handleDataBoxChange(e:DataBoxChangeEvent):void

This method to handle data box change event.

Parameters

e:DataBoxChangeEvent — the data box change event.

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

This method to handle mouse move event.

Parameters

e:MouseEvent — mouse move event.

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

This method to handle mouse over event.

Parameters

e:MouseEvent — the mouse over event.

handleNetworkPropertyChange()method 
protected function handleNetworkPropertyChange(e:PropertyChangeEvent):void

This method handle network property change event.

Parameters

e:PropertyChangeEvent — network property change event.

handleResize()method 
protected function handleResize(e:ResizeEvent):void

Handle element resize event.

Parameters

e:ResizeEvent — element resize event.

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

Handle mouse roll out event.

Parameters

e:MouseEvent — mouse roll out event

handleSelectionChange()method 
protected function handleSelectionChange(e:SelectionChangeEvent):void

This method to handle the data selection change.

Parameters

e:SelectionChangeEvent — data selection change event.

isAtCenter()method 
protected function isAtCenter(node:Node, perspective:Number, cx:Number, cy:Number, cz:Number):Boolean

Whether specified node is at center location of the cloud.

Parameters

node:Node — a node to be checked.
 
perspective:Number — the perspective to be used.
 
cx:Number — number in x axis.
 
cy:Number — number in y axis.
 
cz:Number — number in z axis.

Returns
Boolean — true if specified node is at center location of the cloud, false otherwise.
isLayoutable()method 
public function isLayoutable(node:Node):Boolean

Check whether specified node element is layoutable. A layoutable node will be layouted by this layouter. The non-layoutable node will fixed and not moved.

Parameters

node:Node — a node to be check.

Returns
Boolean — true if layoutable, false otherwise.
reload()method 
public function reload():void

Reload all layout data.

start()method 
public function start(needToReset:Boolean = true):void

Call this to start the layouter.

Parameters

needToReset:Boolean (default = true) — whether need to reset layout before start. True if need to reset, false otherwise. Default value is true.

stop()method 
public function stop(removeListeners:Boolean = true):void

Call this to stop layout.

Parameters

removeListeners:Boolean (default = true) — whether need to remove all installed listeners after layouter is stop. True if need to remove listeners, false otherwise. Default value is true.

updateLayoutRect()method 
public function updateLayoutRect(needToReload:Boolean = false):void

update the layout for the layout rectangle.

Parameters

needToReload:Boolean (default = false) — whether need to reload data. True if need to reload, false otherwise. Default value is false.

updateNode()method 
protected function updateNode(node:Node, zIndex:int, count:int, alpha:Number):void

Update a node by calling updateNodeFunction function.

Parameters

node:Node — the node to be layout
 
zIndex:int — index in z order.
 
count:int — node total count.
 
alpha:Number — alpha transparency.