Packageorg.un.flex.graphLayout.layout
Classpublic class Hyperbolic2DLayouter
InheritanceHyperbolic2DLayouter Inheritance IterativeBaseLayouter Inheritance BaseLayouter
ImplementsILayoutAlgorithm

This is an implementation of the Hyperbolic 2D layouting algorithm.
For this iterative layout, most of default mouse behavior, namely:
(1) scrolling while background drag, and
(2) node drag-drop
should be turned-off in VisualGraph.
The implementation is a rewrite of Jens Kanschik's Hypergraph implementation in Java. However, apart from the general idea and some variable names, this code improves on hypergraph and also implements additional functionality. Copyright (C) 2003 Jens Kanschik, mail : jensKanschik



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
  projector : IProjector
[read-only] Helper Methods - Node Animation, Misc.
Hyperbolic2DLayouter
 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
  _animInProgress : Boolean = false
Indicator if there is currently an animation in progress
Hyperbolic2DLayouter
 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
 Inherited_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
  
Initialization - Constructors, resets
Hyperbolic2DLayouter
  
bgDragContinue(event:MouseEvent):void
Notifies the layouter of a background drag-in-process event, in case it wants to react to that in special way.
Hyperbolic2DLayouter
  
bgDragEvent(event:MouseEvent):void
Notifies the layouter of a backgroung drag event, in case it wants to react to that in special way.
Hyperbolic2DLayouter
 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 method notifies the layouter about a drag/drop operation.
IterativeBaseLayouter
  
dropEvent(event:MouseEvent, vn:IVisualNode):void
Mouse Event Handling Methods
Hyperbolic2DLayouter
 Inherited
layoutPass():Boolean
This is the actual method that does a layout pass.
IterativeBaseLayouter
  
refreshInit():void
This is an initialisation method to do any kind of initialisation before a layout pass.
Hyperbolic2DLayouter
  
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.
Hyperbolic2DLayouter
Protected Methods
 MethodDefined by
  
animate():void
Performs one animation step.
Hyperbolic2DLayouter
 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
  
Hyperbolic2DLayouter
  
isStable():Boolean
Layout Methods - Computations
Hyperbolic2DLayouter
 Inherited
layoutIteration():Boolean
Do a full calculation iteration of the layout.
IterativeBaseLayouter
Public Constants
 ConstantDefined by
  ANIMATION_STEPS : int = 10
[static]
Hyperbolic2DLayouter
 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
_animInProgressproperty
protected var _animInProgress:Boolean = false

Indicator if there is currently an animation in progress

projectorproperty 
projector:IProjector  [read-only]

Helper Methods - Node Animation, Misc.

Implementation
    public function get projector():IProjector
Constructor detail
Hyperbolic2DLayouter()constructor
public function Hyperbolic2DLayouter(vg:IVisualGraph = null)

Initialization - Constructors, resets

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

Performs one animation step.

bgDragContinue()method 
public override function bgDragContinue(event:MouseEvent):void

Notifies the layouter of a background drag-in-process event, in case it wants to react to that in special way.

Parameters
event:MouseEvent
bgDragEvent()method 
public override function bgDragEvent(event:MouseEvent):void

Notifies the layouter of a backgroung drag event, in case it wants to react to that in special way.

Parameters
event:MouseEvent
calculateLayout()method 
protected override function calculateLayout():void
dropEvent()method 
public override function dropEvent(event:MouseEvent, vn:IVisualNode):void

Mouse Event Handling Methods

Parameters
event:MouseEvent
 
vn:IVisualNode
isStable()method 
protected override function isStable():Boolean

Layout Methods - Computations

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

This is an initialisation method to do any kind of initialisation before a layout pass. Not all layouters may require this and thus implement it meaningfully.

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
ANIMATION_STEPSconstant
public static const ANIMATION_STEPS:int = 10