Packageorg.un.flex.graphLayout.layout
Classpublic class BaseLayouter
ImplementsILayoutAlgorithm
SubclassesAnimatedBaseLayouter, DirectPlacementLayouter, IterativeBaseLayouter

This is an base class to various layout implementations it does not really do any layouting but implements everything required by the Interface.



Public Properties
 PropertyDefined by
  animInProgress : Boolean
[read-only] Indicator if currently an animation sequence is still in progress.
BaseLayouter
  autoFitEnabled : Boolean
BaseLayouter
  disableAnimation : Boolean
If set to true, animation is disabled and direct node location setting occurs (instantaneously).
BaseLayouter
  graph : IGraph
[write-only] 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
[write-only] 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
  _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.
BaseLayouter
  _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
Public Methods
 MethodDefined by
  
The constructor initializes the layouter and may assign already a VisualGraph object, but this can also be set later.
BaseLayouter
  
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.
BaseLayouter
Protected Methods
 MethodDefined by
  
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
Public Constants
 ConstantDefined by
  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
Property detail
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
_autoFitEnabledproperty 
protected var _autoFitEnabled:Boolean = false

The indicator if AutoFit should currently be used or not.

autoFitEnabledproperty 
autoFitEnabled:Boolean  [read-write]

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

Implementation
    public function get autoFitEnabled():Boolean
    public function set autoFitEnabled(value:Boolean):void
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
_disableAnimationproperty 
protected var _disableAnimation:Boolean = false

If set to true, animation is disabled and direct node location setting occurs (instantaneously).

The default value is false.

disableAnimationproperty 
disableAnimation:Boolean  [read-write]

If set to true, animation is disabled and direct node location setting occurs (instantaneously).

Implementation
    public function get disableAnimation():Boolean
    public function set disableAnimation(value:Boolean):void
_graphproperty 
protected var _graph:IGraph = null

All layouters need access to the Graph.

graphproperty 
graph:IGraph  [write-only]

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

Implementation
    public function set graph(value:IGraph):void
_layoutChangedproperty 
protected var _layoutChanged:Boolean = false

This keeps track if the layout has changed and can be accessed by any derived layouter.

layoutChangedproperty 
layoutChanged:Boolean  [read-write]

Implementation
    public function get layoutChanged():Boolean
    public function set layoutChanged(value:Boolean):void
linkLengthproperty 
linkLength:Number  [read-write]

This is a NOP in the BaseLayouter class. It does not set anything and always returns 0. Access to a value that controls the length of links (or rather edges). It is up to the layouter what to do with it, and some may ignore this value under certain circumstances (like autoFit). The interface requires the value to be between 0 and 100;

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

Implementation
    public function get linkLength():Number
    public function set linkLength(value:Number):void
_rootproperty 
protected var _root:INode

The current root node of the layout.

_streeproperty 
protected var _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.

_vgraphproperty 
protected var _vgraph:IVisualGraph = null

All layouters need access to the VisualGraph.

vgraphproperty 
vgraph:IVisualGraph  [write-only]

Assign a VisualGraph object to the layouter, every layouter will need one to work, some may also offer to set it in their constructor. The layouter may choose to implicitly also set the graph object if it is found within the VisualGraph object.

Implementation
    public function set vgraph(value:IVisualGraph):void

Throws
— error if the vgraph was already set.
Constructor detail
BaseLayouter()constructor
public function BaseLayouter(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
applyTargetCoordinates()method
protected function applyTargetCoordinates(n:INode):void

Sets the current absolute target coordinates of a node in the node's vnode. This does not yet move the node, as for this the vnode's commit() method must be called.

Parameters
n:INode — The node to get its target coordinates updated.
applyTargetToNodes()method 
protected function applyTargetToNodes(vns:Dictionary):void

Applies the target coordinates to all nodes that are in the Dictionary object passed as argument. The items are expected to be VNodes (as typically a list of currently visible VNodes is passed).

Parameters
vns:Dictionary
bgDragContinue()method 
public function bgDragContinue(event:MouseEvent):void

This is a NOP for this layouter. 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 function bgDragEvent(event:MouseEvent):void

This is a NOP for this layouter. Notifies the layouter of a backgroung drag event, in case it wants to react to that in special way.

Parameters
event:MouseEvent
bgDropEvent()method 
public function bgDropEvent(event:MouseEvent):void

This is a NOP for this layouter. Notifies the layouter of a background drop event, in case it wants to react to that in special way.

Parameters
event:MouseEvent
dragContinue()method 
public function dragContinue(event:MouseEvent, vn:IVisualNode):void

This is a NOP for this layouter. Notifies the layouter of a node dragging-in-process event, in case it wants to react to that in special way.

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

This is a NOP for this layouter. Notifies the layouter of a node drag event, in case it wants to react to that in special way.

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

This is a NOP for this layouter. Notifies the layouter of a node drop event, in case it wants to react to that in special way.

Parameters
event:MouseEvent
 
vn:IVisualNode
layoutPass()method 
public function layoutPass():Boolean

This is a NOP in the BaseLayouter class and always returns true. This is the main method of the layouter, that actually implements the calculation of the layout. It will be called by the VisualGraph on any significant change that will require a layout to be recomputed.

Returns
Boolean — true if something was done successfully, false otherwise.
refreshInit()method 
public function refreshInit():void

This is a NOP for this layouter. 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 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
DEFAULT_MARGINconstant
public static const DEFAULT_MARGIN:Number = 30

The default margin to be considered when using autoFit.

MINIMUM_NODE_HEIGHTconstant 
public static const MINIMUM_NODE_HEIGHT:Number = 5

The default minimum node height to be used if the exact node height cannot be determined yet.

MINIMUM_NODE_WIDTHconstant 
public static const MINIMUM_NODE_WIDTH:Number = 5

The default minimum node width to be used if the exact node height cannot be determined yet.