| Package | org.un.flex.graphLayout.layout |
| Class | public class AnimatedBaseLayouter |
| Inheritance | AnimatedBaseLayouter BaseLayouter |
| Implements | ILayoutAlgorithm |
| Subclasses | CircularLayouter, ConcentricRadialLayouter, HierarchicalLayouter, ParentCenteredRadialLayouter, PhylloTreeLayouter |
| Property | Defined by | ||
|---|---|---|---|
| animInProgress : Boolean [read-only]
Indicator if currently an animation sequence is still
in progress.
| AnimatedBaseLayouter | ||
![]() | autoFitEnabled : Boolean | BaseLayouter | |
![]() | disableAnimation : Boolean
If set to true, animation is disabled and direct
node location setting occurs (instantaneously).
| BaseLayouter | |
![]() | graph : 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 | |
![]() | layoutChanged : Boolean | BaseLayouter | |
![]() | linkLength : Number
This is a NOP in the BaseLayouter class.
| BaseLayouter | |
![]() | vgraph : 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 | |
| Property | Defined 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 | ||
![]() | _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 | ||
![]() | _disableAnimation : Boolean = false
If set to true, animation is disabled and direct
node location setting occurs (instantaneously).
| BaseLayouter | |
![]() | _graph : IGraph = null
All layouters need access to the Graph.
| BaseLayouter | |
![]() | _layoutChanged : Boolean = false
This keeps track if the layout has changed
and can be accessed by any derived layouter.
| BaseLayouter | |
![]() | _root : INode
The current root node of the layout.
| BaseLayouter | |
![]() | _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 | |
![]() | _vgraph : IVisualGraph = null
All layouters need access to the VisualGraph.
| BaseLayouter | |
| Method | Defined by | ||
|---|---|---|---|
|
AnimatedBaseLayouter(vg:IVisualGraph = null)
The constructor initializes the layouter and may assign
already a VisualGraph object, but this can also be set later.
| AnimatedBaseLayouter | ||
![]() |
bgDragContinue(event:MouseEvent):void
This is a NOP for this layouter.
| BaseLayouter | |
![]() |
bgDragEvent(event:MouseEvent):void
This is a NOP for this layouter.
| BaseLayouter | |
![]() |
bgDropEvent(event:MouseEvent):void
This is a NOP for this layouter.
| BaseLayouter | |
![]() |
dragContinue(event:MouseEvent, vn:IVisualNode):void
This is a NOP for this layouter.
| BaseLayouter | |
![]() |
dragEvent(event:MouseEvent, vn:IVisualNode):void
This is a NOP for this layouter.
| BaseLayouter | |
![]() |
dropEvent(event:MouseEvent, vn:IVisualNode):void
This is a NOP for this layouter.
| BaseLayouter | |
![]() |
layoutPass():Boolean
This is a NOP in the BaseLayouter class and always returns true.
| BaseLayouter | |
![]() |
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 | ||
| Method | Defined by | ||
|---|---|---|---|
![]() |
applyTargetCoordinates(n:INode):void
Sets the current absolute target coordinates of a node
in the node's vnode.
| BaseLayouter | |
![]() |
applyTargetToNodes(vns:Dictionary):void
Applies the target coordinates to all nodes that
are in the Dictionary object passed as argument.
| BaseLayouter | |
|
interpolateCartCoords():Boolean
Interpolates the target coordinates with the current real coordinates
achieving a smooth animation.
| AnimatedBaseLayouter | ||
|
interpolatePolarCoords():Boolean
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 | ||
|
resetAnimation():void
Reset/Reinitialise animation related variables.
| AnimatedBaseLayouter | ||
|
setCoords():Boolean
Directly sets the target coordinates not animating anything.
| AnimatedBaseLayouter | ||
|
startAnimation():void
This method starts the animation according
to the preset type in the _animationType
variable.
| AnimatedBaseLayouter | ||
| Constant | Defined 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 | ||
![]() | DEFAULT_MARGIN : Number = 30 [static]
The default margin to be considered when using
autoFit.
| BaseLayouter | |
![]() | MINIMUM_NODE_HEIGHT : Number = 5 [static]
The default minimum node height to be used if the exact node
height cannot be determined yet.
| BaseLayouter | |
![]() | MINIMUM_NODE_WIDTH : Number = 5 [static]
The default minimum node width to be used if the exact node
height cannot be determined yet.
| BaseLayouter | |
| animationType | property |
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
| _animInProgress | property |
protected var _animInProgress:Boolean = falseIndicator if there is currently an animation in progress
| animInProgress | property |
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
| currentDrawing | property |
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
| 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.
Parametersvg:IVisualGraph (default = null) — The VisualGraph object on which this layouter should work on.
|
| interpolateCartCoords | () | method |
protected function interpolateCartCoords():BooleanInterpolates the target coordinates with the current real coordinates achieving a smooth animation. It works in the same way as interpolatePolarCoords() but uses cartesian coordinates.
ReturnsBoolean |
See also
| interpolatePolarCoords | () | method |
protected function interpolatePolarCoords():BooleanInterpolates 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.
ReturnsBoolean |
| killTimer | () | method |
protected function killTimer():voidThis 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():voidThis 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():voidReset/Reinitialise animation related variables.
| setCoords | () | method |
protected function setCoords():BooleanDirectly sets the target coordinates not animating anything. Will be used if the disableAnimation flag is set.
ReturnsBoolean |
| startAnimation | () | method |
protected function startAnimation():voidThis 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.
| ANIM_RADIAL | constant |
public const ANIM_RADIAL:int = 1constant to define the radial animation type, which interpolates node's polar coordinates.
| ANIM_STRAIGHT | constant |
public const ANIM_STRAIGHT:int = 2constant to define the radial animation type, which interpolates node's polar coordinates.