Packageorg.un.flex.graphLayout.layout
Interfacepublic interface ILayoutAlgorithm
SubinterfacesIAngularLayouter
ImplementorsAnimatedBaseLayouter, BaseLayouter, ConcentricRadialLayouter, DirectPlacementLayouter, ForceDirectedLayouter, HierarchicalLayouter, Hyperbolic2DLayouter, ISOMLayouter, IterativeBaseLayouter

The interface to all layout algorithms that should work with VisualGraph components and underlying Graph data structures. This interface defines all the methods required to control the aspects of a layouter.



Public Properties
 PropertyDefined by
  animInProgress : Boolean
[read-only] Indicator if currently an animation sequence is still in progress.
ILayoutAlgorithm
  autoFitEnabled : Boolean
Flag to indicate whether the Layouter should attempt to automatically fit the layout to the screen.
ILayoutAlgorithm
  disableAnimation : Boolean
If set to true, animation is disabled and direct node location setting occurs (instantaneously).
ILayoutAlgorithm
  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
ILayoutAlgorithm
  layoutChanged : Boolean
Indicator if the layout has changed or not.
ILayoutAlgorithm
  linkLength : Number
Access to a value that controls the length of links (or rather edges).
ILayoutAlgorithm
  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.
ILayoutAlgorithm
Public Methods
 MethodDefined by
  
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.
ILayoutAlgorithm
  
bgDragEvent(event:MouseEvent):void
Notifies the layouter of a backgroung drag event, in case it wants to react to that in special way.
ILayoutAlgorithm
  
bgDropEvent(event:MouseEvent):void
Notifies the layouter of a background drop event, in case it wants to react to that in special way.
ILayoutAlgorithm
  
dragContinue(event:MouseEvent, vn:IVisualNode):void
Notifies the layouter of a node dragging-in-process event, in case it wants to react to that in special way.
ILayoutAlgorithm
  
dragEvent(event:MouseEvent, vn:IVisualNode):void
Notifies the layouter of a node drag event, in case it wants to react to that in special way.
ILayoutAlgorithm
  
dropEvent(event:MouseEvent, vn:IVisualNode):void
Notifies the layouter of a node drop event, in case it wants to react to that in special way.
ILayoutAlgorithm
  
layoutPass():Boolean
This is the main method of the layouter, that actually implements the calculation of the layout.
ILayoutAlgorithm
  
refreshInit():void
This is an initialisation method to do any kind of initialisation before a layout pass.
ILayoutAlgorithm
  
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.
ILayoutAlgorithm
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 
autoFitEnabled:Boolean  [read-write]

Flag to indicate whether the Layouter should attempt to automatically fit the layout to the screen.

Implementation
    public function get autoFitEnabled():Boolean
    public function set autoFitEnabled(value:Boolean):void
disableAnimationproperty 
disableAnimation:Boolean  [read-write]

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

The default value is false.

Implementation
    public function get disableAnimation():Boolean
    public function set disableAnimation(value:Boolean):void
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 
layoutChanged:Boolean  [read-write]

Indicator if the layout has changed or not. This can be used to notify the layouter, that some external means (like dragging & dropping a node) has changed the layout, and it will also be set by the layouter itself when the layouter updated the layout. This is used by the VisualGraphs "updateDisplayList()" method, to see whether to redraw all edges using the EdgeRenderer.

Implementation
    public function get layoutChanged():Boolean
    public function set layoutChanged(value:Boolean):void

See also

linkLengthproperty 
linkLength:Number  [read-write]

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;

The default value is 10.

Implementation
    public function get linkLength():Number
    public function set linkLength(value:Number):void
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

See also

Method detail
bgDragContinue()method
public 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 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
bgDropEvent()method 
public function bgDropEvent(event:MouseEvent):void

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

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

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

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 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 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.