Packagecom.asterisq.constellation.behaviors
Classpublic class TreeLayoutBehavior
InheritanceTreeLayoutBehavior Inheritance LayoutBehavior Inheritance Behavior Inheritance flash.events.EventDispatcher

Lays out nodes in a hierarchical tree.



Public Properties
 PropertyDefined by
  alignment : String
The alignment of the layout to the origin point.
TreeLayoutBehavior
 InheritedautoInvalidate : Boolean
Flag indicating whether to automatically invalidate when the renderers change.
LayoutBehavior
  childSpacing : Number
The spacing between parent and child nodes in the layout.
TreeLayoutBehavior
  constellation : IConstellation
The constellation instance this behavior belongs to.
TreeLayoutBehavior
 Inheritedenabled : Boolean
Indicates whether this behavior is currently enabled.
Behavior
 InheritednodeRendererFilterFunction : Function
The function which determines the node renderers affected by this behavior.
Behavior
  orientation : Number
The orientation (rotation) of the layout, in radians.
TreeLayoutBehavior
  origin : Point
The origin point to which the layout is aligned.
TreeLayoutBehavior
  rootNodeID : String
The ID of the tree's root node.
TreeLayoutBehavior
  siblingSpacing : Number
The spacing between sibling nodes in the layout.
TreeLayoutBehavior
Public Methods
 MethodDefined by
  
TreeLayoutBehavior(childSpacing:Number = 50, siblingSpacing:Number = 100, orientation:Number, alignment:String)
Creates a new behavior.
TreeLayoutBehavior
 Inherited
Indicates whether this class affects node renderers' acceleration.
Behavior
 Inherited
Determines whether this behavior affects the given node renderer.
Behavior
 Inherited
affectsPosition():Boolean
Indicates whether this class affects node renderers' position.
Behavior
 Inherited
affectsVelocity():Boolean
Indicates whether this class affects node renderers' velocity.
Behavior
 Inherited
fromXML(elem:XML):Behavior
[static] Creates an IBehavior instance and initializes it with the given XML data.
Behavior
 Inherited
invalidate():void
Invalidates the layout and causes a redraw during the next step.
LayoutBehavior
 Inherited
stepEnd():void
Method called at the end of a step.
Behavior
 Inherited
stepStart():void
Method called at the beginning of a step.
LayoutBehavior
 Inherited
Modifies the given node renderer's acceleration.
Behavior
 Inherited
Modifies the given node renderer's position.
Behavior
 Inherited
Modifies the given node renderer's velocity.
Behavior
  
validate():Boolean
The layout validation method.
TreeLayoutBehavior
Protected Methods
 MethodDefined by
  
loadValuesFromXML(behaviorElem:XML):void
Updates this behavior with values from the given XML element.
TreeLayoutBehavior
 Inherited
setNodeRendererTargetPosition(tnr:ITweenableNodeRenderer, origin:Point, targetPosition:Point, startTime:Number):void
Convenience function for setting the ITweenableNodeRenderer animation properties.
LayoutBehavior
Public Constants
 ConstantDefined by
  CENTER : String = "center"
[static] Aligns the layout's center with the origin.
TreeLayoutBehavior
  HORIZONTAL : Number = 0
[static] Orients the layout horizontally.
TreeLayoutBehavior
  ROOT_NODE : String = "rootNode"
[static] Aligns the root node with the origin.
TreeLayoutBehavior
  VERTICAL : Number
[static] Orients the layout vertically.
TreeLayoutBehavior
Property detail
alignmentproperty
alignment:String  [read-write]

The alignment of the layout to the origin point. Set this to TreeLayoutBehavior.CENTER to align the center of the layout with the origin. Set this to TreeLayoutBehavior.ROOT_NODE to align the root node with the origin.

Setting this value causes the layout to redraw.

Implementation
    public function get alignment():String
    public function set alignment(value:String):void
childSpacingproperty 
childSpacing:Number  [read-write]

The spacing between parent and child nodes in the layout.

Setting this value causes the layout to redraw.

Implementation
    public function get childSpacing():Number
    public function set childSpacing(value:Number):void
constellationproperty 
constellation:IConstellation  [read-write]

The constellation instance this behavior belongs to.

Implementation
    public function get constellation():IConstellation
    public function set constellation(value:IConstellation):void
orientationproperty 
orientation:Number  [read-write]

The orientation (rotation) of the layout, in radians. Set to TreeLayoutBehavior.HORIZONTAL or TreeLayoutBehavior.VERTICAL.

Setting this value causes the layout to redraw.

Implementation
    public function get orientation():Number
    public function set orientation(value:Number):void
originproperty 
origin:Point  [read-write]

The origin point to which the layout is aligned. Actual alignment behavior depends on the value of alignment.

If the origin is set to null, then the behavior depends on the alignment value. If the alignment is set to CENTER, the layout is centered on the Constellation graph visualization. If the alignment is set to ROOT_NODE, the layout is aligned to the current position of the root node.

Setting this value causes the layout to redraw.

Implementation
    public function get origin():Point
    public function set origin(value:Point):void
rootNodeIDproperty 
rootNodeID:String  [read-write]

The ID of the tree's root node.

Setting this value causes the layout to redraw.

Implementation
    public function get rootNodeID():String
    public function set rootNodeID(value:String):void
siblingSpacingproperty 
siblingSpacing:Number  [read-write]

The spacing between sibling nodes in the layout.

Setting this value causes the layout to redraw.

Implementation
    public function get siblingSpacing():Number
    public function set siblingSpacing(value:Number):void
Constructor detail
TreeLayoutBehavior()constructor
public function TreeLayoutBehavior(childSpacing:Number = 50, siblingSpacing:Number = 100, orientation:Number, alignment:String)

Creates a new behavior.

Parameters
childSpacing:Number (default = 50)
 
siblingSpacing:Number (default = 100)
 
orientation:Number
 
alignment:String
Method detail
loadValuesFromXML()method
protected override function loadValuesFromXML(behaviorElem:XML):void

Updates this behavior with values from the given XML element. This method should be overridden to update this Behavior.

Parameters
behaviorElem:XML
validate()method 
public override function validate():Boolean

The layout validation method. Returns true if validation was successful.

This method should be overridden to update the ITweenableNodeRenderer properties according to the layout algorithm.

Returns
Boolean
Constant detail
CENTERconstant
public static const CENTER:String = "center"

Aligns the layout's center with the origin.

HORIZONTALconstant 
public static const HORIZONTAL:Number = 0

Orients the layout horizontally.

ROOT_NODEconstant 
public static const ROOT_NODE:String = "rootNode"

Aligns the root node with the origin.

VERTICALconstant 
public static const VERTICAL:Number

Orients the layout vertically.