Packageorg.un.flex.graphLayout.layout
Classpublic class BaseLayoutDrawing
SubclassesConcentricRadialLayoutDrawing, HierarchicalLayoutDrawing, ParentCenteredDrawingModel, PhylloTreeDrawingModel

This is a base class to hold layout drawing information like target coordinates for all nodes, access to polar and cartesian versions of those coordinates and an origin offset. So it can already represent a drawing.



Public Properties
 PropertyDefined by
  centeredLayout : Boolean
Specifies if the center offset should be applied or not.
BaseLayoutDrawing
  centerOffset : Point
Access to the offset of the center of the layout.
BaseLayoutDrawing
  originOffset : Point
Access to the offset of the origin of the layout.
BaseLayoutDrawing
Public Methods
 MethodDefined by
  
The constructor just initializes the internal data structures.
BaseLayoutDrawing
  
Access the absolute cartesian coordinates of the given node.
BaseLayoutDrawing
  
getPolarPhi(n:INode):Number
access the polar angle part of the target coordinates of the given node.
BaseLayoutDrawing
  
getPolarR(n:INode):Number
access the polar radius part of the target coordinates of the given node.
BaseLayoutDrawing
  
Access the cartesian coordinates of the given node.
BaseLayoutDrawing
  
invalidate all node data sets
BaseLayoutDrawing
  
nodeDataValid(n:INode):Boolean
indicates if the data set for a given node is currently valid.
BaseLayoutDrawing
  
setCartCoordinates(n:INode, p:Point):void
Set the target coordinates for node n according to the calculated layout in cartesian (i.e.
BaseLayoutDrawing
  
setPolarCoordinates(n:INode, polarR:Number, polarPhi:Number):void
Set the target coordinates for node n according to the calculated layout in Polar form.
BaseLayoutDrawing
Property detail
centeredLayoutproperty
centeredLayout:Boolean  [read-write]

Specifies if the center offset should be applied or not.

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

Implementation
    public function get centeredLayout():Boolean
    public function set centeredLayout(value:Boolean):void
centerOffsetproperty 
centerOffset:Point  [read-write]

Access to the offset of the center of the layout. The actual origin is the upper left corner of the canvas. But the calculation of this layout is done around circles around the origin. So we want to move the origin into the center of the canvas, This is what the center offset actually does.

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

Implementation
    public function get centerOffset():Point
    public function set centerOffset(value:Point):void
originOffsetproperty 
originOffset:Point  [read-write]

Access to the offset of the origin of the layout. The actual origin is the upper left corner of the canvas. But that changes if we scroll the canvas around, so we have to keep track of this offset.

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

Implementation
    public function get originOffset():Point
    public function set originOffset(value:Point):void
Constructor detail
BaseLayoutDrawing()constructor
public function BaseLayoutDrawing()

The constructor just initializes the internal data structures.

Method detail
getAbsCartCoordinates()method
public function getAbsCartCoordinates(n:INode):Point

Access the absolute cartesian coordinates of the given node. These are the absolute coordinates with the origin offset already applied.

Parameters
n:INode — The node which target coordinates are required.

Returns
Point — A Point object that contains the required absolute coordinates.
getPolarPhi()method 
public function getPolarPhi(n:INode):Number

access the polar angle part of the target coordinates of the given node. These are relative coordinates (subject to origin offset).

Parameters
n:INode — The node which target coordinate is required.

Returns
Number — The angle part of n's target coordinates (in polar).
getPolarR()method 
public function getPolarR(n:INode):Number

access the polar radius part of the target coordinates of the given node. These are relative coordinates (subject to origin offset).

Parameters
n:INode — The node which target coordinate is required.

Returns
Number — The radius part of n's target coordinates (in polar).
getRelCartCoordinates()method 
public function getRelCartCoordinates(n:INode):Point

Access the cartesian coordinates of the given node. These are relative coordinates (subject to origin offset).

Parameters
n:INode — The node which target coordinates are required.

Returns
Point — A Point object that contains the required coordinates.
invalidateNodeData()method 
public function invalidateNodeData():void

invalidate all node data sets

nodeDataValid()method 
public function nodeDataValid(n:INode):Boolean

indicates if the data set for a given node is currently valid. WARNING: may not be implemented properly and may not even be needed

Parameters
n:INode — The node for which dataset the validity should be tested.

Returns
Boolean — If the dataset for node n is valid.
setCartCoordinates()method 
public function setCartCoordinates(n:INode, p:Point):void

Set the target coordinates for node n according to the calculated layout in cartesian (i.e. x and y) form. Consider these are "relative" coordinates, which will finally be adjusted by the origin offset.

Parameters
n:INode — The node to set its coordinates.
 
p:Point — The point object representing the target coordinates.
setPolarCoordinates()method 
public function setPolarCoordinates(n:INode, polarR:Number, polarPhi:Number):void

Set the target coordinates for node n according to the calculated layout in Polar form. Consider these are "relative" coordinates, which will finally be adjusted by the origin offset.

Parameters
n:INode — The node to set its coordinates.
 
polarR:Number — The radius (length) part of the polar coordinates.
 
polarPhi:Number — The angle part of the polar coordinates (in degrees).

Throws
— error if any part of the coordinates is NaN (not a number).