Packagecom.yworks.yfiles.layout.tree
Classpublic class LayeredNodePlacer
InheritanceLayeredNodePlacer Inheritance AbstractRotatableNodePlacer Inheritance YObject Inheritance Object

This NodePlacer calculates and respects layers.

Warning: Changing the orientation within the LayeredNodePlacers will result in dubious problems.



Public Properties
 PropertyDefined By
  busAlignment : Number
Specifies the vertical bus alignment for orthogonally routed edge buses.
LayeredNodePlacer
  dendrogramStyle : Boolean
LayeredNodePlacer
  id : Object
[read-only] Returns the ID.
LayeredNodePlacer
  layerSpacing : Number
Specifies the spacing between two layers.
LayeredNodePlacer
 InheritedmodificationMatrix : AbstractRotatableNodePlacer_Matrix
[read-only] The actual modification matrix
AbstractRotatableNodePlacer
  polylineLabelingEnabled : Boolean
Specifies whether polyline labeling should be used.
LayeredNodePlacer
  rootAlignment : AbstractRotatableNodePlacer_RootAlignment
Specifies the alignment strategy for the tree's root node.
LayeredNodePlacer
  routingStyle : int
Specifies the routing style.
LayeredNodePlacer
 Inheritedspacing : Number
Specifies the spacing between subtrees this NodePlacer is arranging.
AbstractRotatableNodePlacer
  verticalAlignment : Number
Specifies the relative vertical alignment of nodes within their respective layers.
LayeredNodePlacer
Protected Properties
 PropertyDefined By
 InheritedcreatedChildren : List
List containing the created children
AbstractRotatableNodePlacer
 Inheritedgraph : LayoutGraph
The graph instance this class is working on
AbstractRotatableNodePlacer
 InheritednodeShapeProvider : DataProvider
The actual node shape provider
AbstractRotatableNodePlacer
 Inherited_spacing : Number
This is the "default" spacing for the different move operations.
AbstractRotatableNodePlacer
 InheritedsubtreeShapeProvider : DataProvider
The actual subtree shape provider
AbstractRotatableNodePlacer
Public Methods
 MethodDefined By
  
LayeredNodePlacer(init:Boolean = true)
LayeredNodePlacer
 Inherited
AbstractRotatableNodePlacer
 Inherited
AbstractRotatableNodePlacer
  
[override] Creates an processor that distributes the LayerRoot
LayeredNodePlacer
 Inherited
determineChildConnectors(localRoot:Node, connectorMap:DataMap):void
This method initializes internal data structures, then uses the abstract method determineChildConnector() to determine the child node connector directions.
AbstractRotatableNodePlacer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
LayeredNodePlacer
 Inherited
hashCode():int
YObject
  
[static]
LayeredNodePlacer
  
[static] Default constructor.
LayeredNodePlacer
 Inherited
placeSubtree(nodeShapeProvider:DataProvider, subtreeShapeProvider:DataProvider, graph:LayoutGraph, localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape
This method initializes the local data structures and then delegates the work to the abstract variant.
AbstractRotatableNodePlacer
 Inherited
[static] Translates a "real world point" to a "model point"
AbstractRotatableNodePlacer
Protected Methods
 MethodDefined By
 Inherited
createRootNodeShape(node:Node):SubtreeShapeRotated
Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance.
AbstractRotatableNodePlacer
 Inherited
createSubtreeShape(node:Node):SubtreeShapeRotated
Convenience method that queries the DataProvider for a SubtreeShape.
AbstractRotatableNodePlacer
  
[override]
LayeredNodePlacer
 Inherited
Lookup method to get the PortConstraint for the local root translated.
AbstractRotatableNodePlacer
 Inherited
Translates the absolute source point of the given edge to the "view coordinates" (translated by the modification matrix)
AbstractRotatableNodePlacer
 Inherited
AbstractRotatableNodePlacer
  
Initializes this object.
LayeredNodePlacer
  
Initializes this object.
LayeredNodePlacer
  
placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):SubtreeShapeRotated
[override]
LayeredNodePlacer
 Inherited
translateDirectionToModel(realDirection:int):int
Translates a "real" direction into a directionModel direction
AbstractRotatableNodePlacer
 Inherited
translateDirectionToReal(modelDirection:int):int
Translates a modelDirectionModel into the "real" directionModel
AbstractRotatableNodePlacer
Public Constants
 ConstantDefined By
  ORTHOGONAL_STYLE : int = 1
[static] Layout style constant.
LayeredNodePlacer
  PLAIN_STYLE : int = 0
[static] Layout style constant.
LayeredNodePlacer
Property Detail
busAlignmentproperty
busAlignment:Number

Specifies the vertical bus alignment for orthogonally routed edge buses. The bus alignment determines the relative position of an edge bus in between two subsequent layers of nodes. A value of 0 places the bus at the top right below the parent node; a value of 0.5 places the bus in the middle between parent and child nodes; and a value of 1 places the bus at the bottom right above the child nodes.

Defaults to 0.3.


Implementation
    public function get busAlignment():Number
    public function set busAlignment(value:Number):void
dendrogramStyleproperty 
dendrogramStyle:Boolean


Implementation
    public function get dendrogramStyle():Boolean
    public function set dendrogramStyle(value:Boolean):void
idproperty 
id:Object  [read-only]

Returns the ID. The ID is used to identify LayeredNodePlacers that share information about their height. Using different IDs offers aligned layouts within different subtrees.


Implementation
    public function get id():Object
layerSpacingproperty 
layerSpacing:Number

Specifies the spacing between two layers.


Implementation
    public function get layerSpacing():Number
    public function set layerSpacing(value:Number):void
polylineLabelingEnabledproperty 
polylineLabelingEnabled:Boolean

Specifies whether polyline labeling should be used.

If set to true, the poly line connectors between the parent and its children are added to the shape. Labels (of nodes and edges) will not cut them.


Implementation
    public function get polylineLabelingEnabled():Boolean
    public function set polylineLabelingEnabled(value:Boolean):void
rootAlignmentproperty 
rootAlignment:AbstractRotatableNodePlacer_RootAlignment

Specifies the alignment strategy for the tree's root node.


Implementation
    public function get rootAlignment():AbstractRotatableNodePlacer_RootAlignment
    public function set rootAlignment(value:AbstractRotatableNodePlacer_RootAlignment):void
routingStyleproperty 
routingStyle:int

Specifies the routing style. The possible values are:


Implementation
    public function get routingStyle():int
    public function set routingStyle(value:int):void

See also

verticalAlignmentproperty 
verticalAlignment:Number

Specifies the relative vertical alignment of nodes within their respective layers. A value of 0 means nodes are top aligned; a value of 1 means nodes are bottom aligned.

Defaults to 0.5, i.e. nodes are center aligned.


Implementation
    public function get verticalAlignment():Number
    public function set verticalAlignment(value:Number):void
Constructor Detail
LayeredNodePlacer()Constructor
public function LayeredNodePlacer(init:Boolean = true)

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
createProcessor()method
override public function createProcessor(layouter:GenericTreeLayouter, graph:LayoutGraph, currentRoot:Node):Processor

Creates an processor that distributes the LayerRoot

Parameters

layouter:GenericTreeLayouter
 
graph:LayoutGraph — the actual graph
 
currentRoot:Node — the actual root node for this node placer

Returns
Processor — a Processor or null
determineChildConnector()method 
override protected function determineChildConnector(child:Node):int

Parameters

child:Node — the child node

Returns
int — a byte constant as defined in the com.yworks.yfiles.layout.tree.NodePlacer interface

See also

getClass()method 
override public function getClass():Class

Returns
Class
initLayeredNodePlacer1()method 
protected final function initLayeredNodePlacer1():void

Initializes this object. See the documentation of the corresponding factory method newLayeredNodePlacer1() for details.

See also

initLayeredNodePlacer2()method 
protected final function initLayeredNodePlacer2(modificationMatrix:AbstractRotatableNodePlacer_Matrix, id:Object):void

Initializes this object. See the documentation of the corresponding factory method newLayeredNodePlacer2() for details.

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix
 
id:Object

See also

newLayeredNodePlacer1()method 
public static function newLayeredNodePlacer1():LayeredNodePlacer

Returns
LayeredNodePlacer
newLayeredNodePlacer2()method 
public static function newLayeredNodePlacer2(modificationMatrix:AbstractRotatableNodePlacer_Matrix, id:Object):LayeredNodePlacer

Default constructor. Instantiates a new instance with the given modification matrix.

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix — the translation for the NodePlacer
 
id:Object

Returns
LayeredNodePlacer
placeSubtreeCore()method 
override protected function placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):SubtreeShapeRotated

Parameters

localRoot:Node — the local root node
 
parentConnectorDirection:int — the direction of the connector shape

Returns
SubtreeShapeRotated — a SubtreeShape instance that describes the shape of the whole subtree
Constant Detail
ORTHOGONAL_STYLEConstant
public static const ORTHOGONAL_STYLE:int = 1

Layout style constant. Draw edges orthogonally in a bus-like fashion.

See also

PLAIN_STYLEConstant 
public static const PLAIN_STYLE:int = 0

Layout style constant. Draw edges as straight lines.

Note that it is possible that edges overlap with nodes depending on their size and vertical alignment. When node labels are considered (com.yworks.yfiles.layout.tree.GenericTreeLayouter.integratedNodeLabeling), there might also be edge overlaps with node labels that are placed above the according node.

See also