Packageorg.un.flex.graphLayout.layout
Classpublic class AnimatedBaseLayouter
InheritanceAnimatedBaseLayouter Inheritance BaseLayouter
ImplementsILayoutAlgorithm
SubclassesCircularLayouter, ConcentricRadialLayouter, HierarchicalLayouter, ParentCenteredRadialLayouter, PhylloTreeLayouter

This subclass to the BaseLayouter encapsulates the methods for animation, since they are typically common in layouters.



Public Properties
 PropertyDefined by
  animInProgress : Boolean
[read-only] Indicator if currently an animation sequence is still in progress.
AnimatedBaseLayouter
 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
  animationType : int
[write-only] 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
  _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
  currentDrawing : BaseLayoutDrawing
[write-only] 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 initializes the layouter and may assign already a VisualGraph object, but this can also be set later.
AnimatedBaseLayouter
 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
 Inherited
layoutPass():Boolean
This is a NOP in the BaseLayouter class and always returns true.
BaseLayouter
 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.
AnimatedBaseLayouter
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
  
Interpolates the target coordinates with the current real coordinates achieving a smooth animation.
AnimatedBaseLayouter
  
Interpolates the target Polar coordinates with the current real coordinates achieving a smooth animation.
AnimatedBaseLayouter
  
killTimer():void
This method kills any currently running timers which is needed if some data is going to be reinitialised.
AnimatedBaseLayouter
  
Reset/Reinitialise animation related variables.
AnimatedBaseLayouter
  
setCoords():Boolean
Directly sets the target coordinates not animating anything.
AnimatedBaseLayouter
  
This method starts the animation according to the preset type in the _animationType variable.
AnimatedBaseLayouter
Public Constants
 ConstantDefined by
  ANIM_RADIAL : int = 1
constant to define the radial animation type, which interpolates node's polar coordinates.
AnimatedBaseLayouter
  ANIM_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
Property detail
animationTypeproperty
animationType:int  [write-only]

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.

Implementation
    protected function set animationType(value:int):void
_animInProgressproperty 
protected var _animInProgress:Boolean = false

Indicator if there is currently an animation in progress

animInProgressproperty 
animInProgress:Boolean  [read-only]

Indicator if currently an animation sequence is still in progress. During certain animation sequences, drag&drop might be disabled

Implementation
    public function get animInProgress():Boolean
currentDrawingproperty 
currentDrawing:BaseLayoutDrawing  [write-only]

Allow to set the reference to the drawing object from derived classes. This is important because of the type issue, the _currentDrawing variable will be declared separately in each derived layouter, but this one must have access to it anyway, to do the animation

Implementation
    protected function set currentDrawing(value:BaseLayoutDrawing):void
Constructor detail
AnimatedBaseLayouter()constructor
public function AnimatedBaseLayouter(vg:IVisualGraph = null)

The constructor initializes the layouter and may assign already a VisualGraph object, but this can also be set later.

Parameters
vg:IVisualGraph (default = null) — The VisualGraph object on which this layouter should work on.
Method detail
interpolateCartCoords()method
protected function interpolateCartCoords():Boolean

Interpolates the target coordinates with the current real coordinates achieving a smooth animation. It works in the same way as interpolatePolarCoords() but uses cartesian coordinates.

Returns
Boolean

See also

interpolatePolarCoords()
interpolatePolarCoords()method 
protected function interpolatePolarCoords():Boolean

Interpolates the target Polar coordinates with the current real coordinates achieving a smooth animation. This method always executes only one step as part of the animation. For each node, it's current coordinates are requested (and translated into the relative polar coordinates. From the drawing object, the target coordinates are taken and divided by the remaining interpolation steps. With that the coordinates of the current interpolation step can be calculated, which are subsequently directly applied to the node. The method then checks if the animation target coordinates have been reached. If not, and there are no more animation steps left, the actual target coordinates are applied. If there are animation steps left, a timer is started to call the same function again for the next animation step.

Returns
Boolean
killTimer()method 
protected function killTimer():void

This method kills any currently running timers which is needed if some data is going to be reinitialised. Remaining timer events could trigger code referring to stale data and crash the program otherwise.

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.

resetAnimation()method 
protected function resetAnimation():void

Reset/Reinitialise animation related variables.

setCoords()method 
protected function setCoords():Boolean

Directly sets the target coordinates not animating anything. Will be used if the disableAnimation flag is set.

Returns
Boolean
startAnimation()method 
protected function startAnimation():void

This method starts the animation according to the preset type in the _animationType variable. Currently only valid type is "RADIAL" which animates by interpolating polar coordinates. Other types like "LINEAR" (interpolating cartesian coordinates) may be added.

Constant detail
ANIM_RADIALconstant
public const ANIM_RADIAL:int = 1

constant to define the radial animation type, which interpolates node's polar coordinates.

ANIM_STRAIGHTconstant 
public const ANIM_STRAIGHT:int = 2

constant to define the radial animation type, which interpolates node's polar coordinates.