Packageorg.un.flex.graphLayout.layout
Classpublic class IterativeBaseLayouter
InheritanceIterativeBaseLayouter Inheritance BaseLayouter
ImplementsILayoutAlgorithm
SubclassesForceDirectedLayouter, Hyperbolic2DLayouter, ISOMLayouter

This is a base class of an Iterative Layouting algorithm. Unlike one pass algorithms with performs animation to reach to a final drawing, an iterative algorithm has several steps that are not pre-determined and are required to be taken until the graph 'stabilizes'. By definition, there could be many steps involved so the goal is to: (a) report measure of stability - update the user about the developments (b) faster computation steps - less time spent before every refresh (c) responsive UI - not to freeze the interface during computation



Public Properties
 PropertyDefined by
 InheritedanimInProgress : Boolean
Indicator if currently an animation sequence is still in progress.
BaseLayouter
 InheritedautoFitEnabled : Boolean
BaseLayouter
 InheriteddisableAnimation : Boolean
If set to true, animation is disabled and direct node location setting occurs (instantaneously).
BaseLayouter
 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
 InheritedlayoutChanged : Boolean
BaseLayouter
 InheritedlinkLength : Number
This is a NOP in the BaseLayouter class.
BaseLayouter
 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
 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.
BaseLayouter
 Inherited_disableAnimation : Boolean = false
If set to true, animation is disabled and direct node location setting occurs (instantaneously).
BaseLayouter
  _dragNode : IVisualNode = null
IterativeBaseLayouter
 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 the data structures and presets some parameters.
IterativeBaseLayouter
 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
  
dragEvent(event:MouseEvent, vn:IVisualNode):void
This method notifies the layouter about a drag/drop operation.
IterativeBaseLayouter
  
dropEvent(event:MouseEvent, vn:IVisualNode):void
If we receive a drop event, we delete the drag node.
IterativeBaseLayouter
  
layoutPass():Boolean
This is the actual method that does a layout pass.
IterativeBaseLayouter
 Inherited
refreshInit():void
This is a NOP for this layouter.
BaseLayouter
  
resetAll():void
Reset all layouting parameters, which may be required during a significant layout change.
IterativeBaseLayouter
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
  
Calculation step of the layout.
IterativeBaseLayouter
  
isStable():Boolean
Checks if the layout has stabilized.
IterativeBaseLayouter
  
layoutIteration():Boolean
Do a full calculation iteration of the layout.
IterativeBaseLayouter
Public Constants
 ConstantDefined by
 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
Property detail
_dragNodeproperty
protected var _dragNode:IVisualNode = null
Constructor detail
IterativeBaseLayouter()constructor
public function IterativeBaseLayouter(vg:IVisualGraph = null)

The constructor only initialises the data structures and presets some parameters.

Parameters
vg:IVisualGraph (default = null)
Method detail
calculateLayout()method
protected function calculateLayout():void

Calculation step of the layout. Sub-classes should override this method to define actual layout computations for every step.

dragEvent()method 
public override function dragEvent(event:MouseEvent, vn:IVisualNode):void

This method notifies the layouter about a drag/drop operation. This is important to exempt are currently dragged node from the layouting, to allow it to drag the whole graph with it. This method basically sets the current drag node.

Parameters
event:MouseEvent — The mouse event that is fired on the starting of the drag operation.
 
vn:IVisualNode — The node which is being dragged.
dropEvent()method 
public override function dropEvent(event:MouseEvent, vn:IVisualNode):void

If we receive a drop event, we delete the drag node.

Parameters
event:MouseEvent — The mouse event that is fired on the starting of the drag operation.
 
vn:IVisualNode — The node which is being dragged.
isStable()method 
protected function isStable():Boolean

Checks if the layout has stabilized. Sub-classes should define terminating conditions for the layout computations.

Returns
Boolean — true if the layout has stabilized
layoutIteration()method 
protected function layoutIteration():Boolean

Do a full calculation iteration of the layout. This is a wrapper only; the actual computation at every step is done in calculateLayout()

Returns
Boolean
layoutPass()method 
public override function layoutPass():Boolean

This is the actual method that does a layout pass. In this Layouter, it is supposed to interrupt and kick-off a new layout cycle, which is different from most others, since this layouter keeps on calculating the layout through a timer.

Returns
Boolean
resetAll()method 
public override function resetAll():void

Reset all layouting parameters, which may be required during a significant layout change. This is particularily important in this layouter, as it constantly updates the layout (using the timer).