Package | twaver.network.layout |
Class | public class AutoLayouter |
Inheritance | AutoLayouter ![]() |
doLayout
to perform auto-layout.
An example to use auto layouter:
var box:ElementBox = new ElementBox(); var network:Network = new Network(box); var autoLayouter:AutoLayouter = new AutoLayouter(network); autoLayouter.animate = true; autoLayouter.doLayout(Consts.LAYOUT_ROUND);
Property | Defined By | ||
---|---|---|---|
accountAttachments : Boolean
Whether consider element attachments when perform auto-layout. | AutoLayouter | ||
animate : Boolean
Whether use animated effect when moving elements
to the layouted locations. | AutoLayouter | ||
elements : ICollection [read-only]
Get all layout elements in this layouter with a collection. | AutoLayouter | ||
expandGroup : Boolean
Whether all group elements will be expanded before the auto-layout calculation. | AutoLayouter | ||
explicitXOffset : Number
Get explicit x offset value of this auto-layouter. | AutoLayouter | ||
explicitYOffset : Number
Get explicit y offset value of this auto-layouter. | AutoLayouter | ||
network : Network [read-only]
Get the connected network component of auto-layouter. | AutoLayouter | ||
repulsion : Number
Get the repulsion factor of auto-layout algorithm. | AutoLayouter | ||
type : String [read-only]
Layout algorithm type name. | AutoLayouter | ||
_xOffset : Number = 0 | AutoLayouter | ||
_yOffset : Number = 0 | AutoLayouter |
Method | Defined By | ||
---|---|---|---|
AutoLayouter(network:Network)
Constructor. | AutoLayouter | ||
createMatrix(type:String):Matrix [static] | AutoLayouter | ||
doLayout(type:String, finishFunction:Function = null):Boolean
Perform layout. | AutoLayouter | ||
Get specified node dimension in this layouter. | AutoLayouter | ||
getLayoutResult(type:String):Dictionary
Get auto-layout results with a dictionary. | AutoLayouter | ||
AutoLayouter |
_xOffset | property |
public var _xOffset:Number = 0
_yOffset | property |
public var _yOffset:Number = 0
accountAttachments | property |
accountAttachments:Boolean
Whether consider element attachments when perform auto-layout. If true, the attachments area will considered as a part of that element body. False otherwise.
public function get accountAttachments():Boolean
public function set accountAttachments(value:Boolean):void
animate | property |
animate:Boolean
Whether use animated effect when moving elements to the layouted locations.
public function get animate():Boolean
public function set animate(value:Boolean):void
elements | property |
elements:ICollection
[read-only] Get all layout elements in this layouter with a collection.
public function get elements():ICollection
expandGroup | property |
expandGroup:Boolean
Whether all group elements will be expanded before the auto-layout calculation. Default value is false.
public function get expandGroup():Boolean
public function set expandGroup(value:Boolean):void
explicitXOffset | property |
explicitXOffset:Number
Get explicit x offset value of this auto-layouter.
public function get explicitXOffset():Number
public function set explicitXOffset(value:Number):void
explicitYOffset | property |
explicitYOffset:Number
Get explicit y offset value of this auto-layouter.
public function get explicitYOffset():Number
public function set explicitYOffset(value:Number):void
network | property |
network:Network
[read-only] Get the connected network component of auto-layouter.
public function get network():Network
repulsion | property |
repulsion:Number
Get the repulsion factor of auto-layout algorithm. Default value is 1.
public function get repulsion():Number
public function set repulsion(value:Number):void
type | property |
type:String
[read-only] Layout algorithm type name. The value can be:
public function get type():String
AutoLayouter | () | Constructor |
public function AutoLayouter(network:Network)
Constructor. Create a network graph auto-layouter for specified network.
Parametersnetwork:Network — the network component auto-layouter layout for.
|
createMatrix | () | method |
public static function createMatrix(type:String):Matrix
Parameters
type:String |
Matrix |
doLayout | () | method |
public function doLayout(type:String, finishFunction:Function = null):Boolean
Perform layout.
Parameters
type:String — layout algorithm name. It can be:
| |
finishFunction:Function (default = null ) — this function will be called when layout finished.
|
Boolean — true if success, false otherwise.
|
getDimension | () | method |
public function getDimension(node:Node):Size
Get specified node dimension in this layouter.
Parameters
node:Node — a node element.
|
Size — the dimension of this node.
|
getLayoutResult | () | method |
public function getLayoutResult(type:String):Dictionary
Get auto-layout results with a dictionary. The dictionary contains layouted location of each node.
Parameters
type:String — layout algorithm. It can be:
|
Dictionary — a dictionary contains layouted location of each node.
|
getOffset | () | method |