Packageorg.un.flex.graphLayout.layout
Classpublic class HierarchicalLayouter
InheritanceHierarchicalLayouter Inheritance AnimatedBaseLayouter Inheritance BaseLayouter
ImplementsILayoutAlgorithm

This layouter implements the drawing of generalized trees in a hierarchical fashion using the algorithm by Christoph Buchheim, Michael Juenger and Sebastian Leipert presented in their paper "Improving Walker's Algorithm to run in linear time"



Public Properties
 PropertyDefined by
 InheritedanimInProgress : Boolean
Indicator if currently an animation sequence is still in progress.
AnimatedBaseLayouter
 InheritedautoFitEnabled : Boolean
BaseLayouter
  breadth : Number
Set the spacing between the nodes within a layer.
HierarchicalLayouter
  compareNodesFunction : Function
[write-only]
HierarchicalLayouter
 InheriteddisableAnimation : Boolean
If set to true, animation is disabled and direct node location setting occurs (instantaneously).
BaseLayouter
  enableSiblingSpread : Boolean
Enable a spreading out of sibling nodes to make labels more legible in some cases.
HierarchicalLayouter
 Inheritedgraph : IGraph
Assign a Graph datastructure object to the layouter, every layouter will need one to work and some may allow to set it in their constructor
BaseLayouter
  honorNodeSize : Boolean
[write-only]
HierarchicalLayouter
  interleaveSiblings : Boolean
HierarchicalLayouter
  layerMargin : int = 0
HierarchicalLayouter
 InheritedlayoutChanged : Boolean
BaseLayouter
  linkLength : Number
HierarchicalLayouter
  orientation : uint
Set the orientation for the hierarchical layouter.
HierarchicalLayouter
  siblingSpreadDistance : Number
HierarchicalLayouter
 Inheritedvgraph : IVisualGraph
Assign a VisualGraph object to the layouter, every layouter will need one to work, some may also offer to set it in their constructor.
BaseLayouter
Protected Properties
 PropertyDefined by
 InheritedanimationType : int
Access to the type of animation, currently supported type is: ANIM_RADIAL which does interpolation of polar coordinates and ANIM_STRAIGHT which interpolates cartesian coordinates.
AnimatedBaseLayouter
 Inherited_animInProgress : Boolean = false
Indicator if there is currently an animation in progress
AnimatedBaseLayouter
 Inherited_autoFitEnabled : Boolean = false
The indicator if AutoFit should currently be used or not.
BaseLayouter
 InheritedcurrentDrawing : BaseLayoutDrawing
Allow to set the reference to the drawing object from derived classes.
AnimatedBaseLayouter
 Inherited_disableAnimation : Boolean = false
If set to true, animation is disabled and direct node location setting occurs (instantaneously).
BaseLayouter
 Inherited_graph : IGraph = null
All layouters need access to the Graph.
BaseLayouter
 Inherited_layoutChanged : Boolean = false
This keeps track if the layout has changed and can be accessed by any derived layouter.
BaseLayouter
 Inherited_root : INode
The current root node of the layout.
BaseLayouter
 Inherited_stree : IGTree
A spanning tree of the graph, since probably every layout will work on a spanning tree, we keep this one in this base class.
BaseLayouter
 Inherited_vgraph : IVisualGraph = null
All layouters need access to the VisualGraph.
BaseLayouter
Public Methods
 MethodDefined by
  
The constructor only initialises some data structures.
HierarchicalLayouter
 Inherited
bgDragContinue(event:MouseEvent):void
This is a NOP for this layouter.
BaseLayouter
 Inherited
bgDragEvent(event:MouseEvent):void
This is a NOP for this layouter.
BaseLayouter
 Inherited
bgDropEvent(event:MouseEvent):void
This is a NOP for this layouter.
BaseLayouter
 Inherited
dragContinue(event:MouseEvent, vn:IVisualNode):void
This is a NOP for this layouter.
BaseLayouter
 Inherited
dragEvent(event:MouseEvent, vn:IVisualNode):void
This is a NOP for this layouter.
BaseLayouter
 Inherited
dropEvent(event:MouseEvent, vn:IVisualNode):void
This is a NOP for this layouter.
BaseLayouter
  
layoutPass():Boolean
This main interface method computes and and executes the new layout.
HierarchicalLayouter
 Inherited
refreshInit():void
This is a NOP for this layouter.
BaseLayouter
  
resetAll():void
This should reset all parameters of the layouter, which might not be needed for all layouters, and it is up to each layouter to do something with it.
HierarchicalLayouter
Protected Methods
 MethodDefined by
 Inherited
Sets the current absolute target coordinates of a node in the node's vnode.
BaseLayouter
 Inherited
applyTargetToNodes(vns:Dictionary):void
Applies the target coordinates to all nodes that are in the Dictionary object passed as argument.
BaseLayouter
 Inherited
Interpolates the target coordinates with the current real coordinates achieving a smooth animation.
AnimatedBaseLayouter
 Inherited
Interpolates the target Polar coordinates with the current real coordinates achieving a smooth animation.
AnimatedBaseLayouter
 Inherited
killTimer():void
This method kills any currently running timers which is needed if some data is going to be reinitialised.
AnimatedBaseLayouter
 Inherited
Reset/Reinitialise animation related variables.
AnimatedBaseLayouter
 Inherited
setCoords():Boolean
Directly sets the target coordinates not animating anything.
AnimatedBaseLayouter
 Inherited
This method starts the animation according to the preset type in the _animationType variable.
AnimatedBaseLayouter
Public Constants
 ConstantDefined by
 InheritedANIM_RADIAL : int = 1
constant to define the radial animation type, which interpolates node's polar coordinates.
AnimatedBaseLayouter
 InheritedANIM_STRAIGHT : int = 2
constant to define the radial animation type, which interpolates node's polar coordinates.
AnimatedBaseLayouter
 InheritedDEFAULT_MARGIN : Number = 30
[static] The default margin to be considered when using autoFit.
BaseLayouter
 InheritedMINIMUM_NODE_HEIGHT : Number = 5
[static] The default minimum node height to be used if the exact node height cannot be determined yet.
BaseLayouter
 InheritedMINIMUM_NODE_WIDTH : Number = 5
[static] The default minimum node width to be used if the exact node height cannot be determined yet.
BaseLayouter
  ORIENT_BOTTOM_UP : uint = 3
[static] Set the orientation to this to result in a bottom up layout.
HierarchicalLayouter
  ORIENT_LEFT_RIGHT : uint = 0
[static] Set the orientation to this to result in a left to right layout.
HierarchicalLayouter
  ORIENT_RIGHT_LEFT : uint = 1
[static] Set the orientation to this to result in a right to left layout.
HierarchicalLayouter
  ORIENT_TOP_DOWN : uint = 2
[static] Set the orientation to this to result in a top down layout.
HierarchicalLayouter
Property detail
breadthproperty
breadth:Number  [read-write]

Set the spacing between the nodes within a layer. Typical range 0 .. 100 should be ok.

Implementation
    public function get breadth():Number
    public function set breadth(value:Number):void
compareNodesFunctionproperty 
compareNodesFunction:Function  [write-only]Implementation
    public function set compareNodesFunction(value:Function):void
enableSiblingSpreadproperty 
enableSiblingSpread:Boolean  [read-write]

Enable a spreading out of sibling nodes to make labels more legible in some cases.

Implementation
    public function get enableSiblingSpread():Boolean
    public function set enableSiblingSpread(value:Boolean):void
honorNodeSizeproperty 
honorNodeSize:Boolean  [write-only]Implementation
    public function set honorNodeSize(value:Boolean):void
interleaveSiblingsproperty 
interleaveSiblings:Boolean  [read-write]Implementation
    public function get interleaveSiblings():Boolean
    public function set interleaveSiblings(value:Boolean):void
layerMarginproperty 
public var layerMargin:int = 0
linkLengthproperty 
linkLength:Number  [read-write]

This property can be used as the source for data binding.

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

Set the orientation for the hierarchical layouter. Available values are provided through defined constants. Use one of: HierarchicalLayouter.ORIENT_TOP_DOWN HierarchicalLayouter.ORIENT_BOTTOM_UP HierarchicalLayouter.ORIENT_LEFT_RIGHT HierarchicalLayouter.ORIENT_RIGHT_LEFT

Implementation
    public function get orientation():uint
    public function set orientation(value:uint):void
siblingSpreadDistanceproperty 
siblingSpreadDistance:Number  [read-write]Implementation
    public function get siblingSpreadDistance():Number
    public function set siblingSpreadDistance(value:Number):void
Constructor detail
HierarchicalLayouter()constructor
public function HierarchicalLayouter(vg:IVisualGraph = null)

The constructor only initialises some data structures.

Parameters
vg:IVisualGraph (default = null)
Method detail
layoutPass()method
public override function layoutPass():Boolean

This main interface method computes and and executes the new layout.

Returns
Boolean — Currently the return value is not set or used.
resetAll()method 
public override function resetAll():void

This should reset all parameters of the layouter, which might not be needed for all layouters, and it is up to each layouter to do something with it. It would also stop any existing layouting loops/timers.

Constant detail
ORIENT_BOTTOM_UPconstant
public static const ORIENT_BOTTOM_UP:uint = 3

Set the orientation to this to result in a bottom up layout.

ORIENT_LEFT_RIGHTconstant 
public static const ORIENT_LEFT_RIGHT:uint = 0

Set the orientation to this to result in a left to right layout.

ORIENT_RIGHT_LEFTconstant 
public static const ORIENT_RIGHT_LEFT:uint = 1

Set the orientation to this to result in a right to left layout.

ORIENT_TOP_DOWNconstant 
public static const ORIENT_TOP_DOWN:uint = 2

Set the orientation to this to result in a top down layout.