Packagecom.yworks.yfiles.layout.tree
Classpublic class ARNodePlacer
InheritanceARNodePlacer Inheritance AbstractNodePlacer Inheritance YObject Inheritance Object
Implements FromSketchNodePlacer

This class is used by com.yworks.yfiles.layout.tree.GenericTreeLayouter and implements a sophisticated com.yworks.yfiles.layout.tree.NodePlacer. Subtrees are placed so that the overall subtree layout's aspect ratio will be close to a given aspect ratio.

See also

com.yworks.yfiles.layout.tree.GenericTreeLayouter
com.yworks.yfiles.layout.tree.NodePlacer


Public Properties
 PropertyDefined By
  aspectRatio : Number
Specifies the preferred aspect ratio.
ARNodePlacer
  fillStyle : int
Specifies the fill style.
ARNodePlacer
  horizontal : Boolean
Specifies whether this instance is configured to create horizontal rows of child nodes.
ARNodePlacer
  horizontalDistance : Number
Specifies the horizontal distance this NodePlacer should use for the arrangement of the elements.
ARNodePlacer
  verticalDistance : Number
Specifies the vertical distance this NodePlacer should use for the arrangement of the elements.
ARNodePlacer
Protected Properties
 PropertyDefined By
 Inheritedgraph : LayoutGraph
The graph instance this class is working on
AbstractNodePlacer
Public Methods
 MethodDefined By
  
ARNodePlacer(init:Boolean = true)
Creates a new instance of ARNodePlacer with default orientation (vertical), aspect ratio (1.0d), fill style ( FILL_STYLE_LEADING), and default distances (40.0d).
ARNodePlacer
  
clone():Object
[override]
ARNodePlacer
  
ARNodePlacer
 Inherited
Creates an optional Processor for pre- and post-processing.
AbstractNodePlacer
 Inherited
determineChildConnectors(localRoot:Node, connectorMap:DataMap):void
This method initializes internal data structures and then uses the abstract method to determine the child node connector directions.
AbstractNodePlacer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
ARNodePlacer
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of ARNodePlacer with default orientation (vertical), aspect ratio (1.0d), fill style ( FILL_STYLE_LEADING), and default distances (40.0d).
ARNodePlacer
  
newARNodePlacer2(horizontal:Boolean, aspectRatio:Number, fillStyle:int, horizontalDistance:Number, verticalDistance:Number):ARNodePlacer
[static] Creates a new instance of ARNodePlacer with given orientation and distances.
ARNodePlacer
 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.
AbstractNodePlacer
Protected Methods
 MethodDefined By
  
cloneImpl(o:Object):void
[override]
ARNodePlacer
  
[override]
ARNodePlacer
 Inherited
Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance.
AbstractNodePlacer
 Inherited
Convenience method that queries the DataProvider for a SubtreeShape.
AbstractNodePlacer
 Inherited
AbstractNodePlacer
  
Initializes this object.
ARNodePlacer
  
initARNodePlacer2(horizontal:Boolean, aspectRatio:Number, fillStyle:int, horizontalDistance:Number, verticalDistance:Number):void
Initializes this object.
ARNodePlacer
  
placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape
[override]
ARNodePlacer
Public Constants
 ConstantDefined By
  FILL_STYLE_CENTERED : int = 4
[static] Byte constant that can be used for the fillStyle property.
ARNodePlacer
  FILL_STYLE_JUSTIFY : int = 3
[static] Byte constant that can be used for the fillStyle property.
ARNodePlacer
  FILL_STYLE_LEADING : int = 1
[static] Byte constant that can be used for the fillStyle property.
ARNodePlacer
  FILL_STYLE_TRAILING : int = 2
[static] Byte constant that can be used for the fillStyle property.
ARNodePlacer
Property Detail
aspectRatioproperty
aspectRatio:Number

Specifies the preferred aspect ratio.


Implementation
    public function get aspectRatio():Number
    public function set aspectRatio(value:Number):void
fillStyleproperty 
fillStyle:int

Specifies the fill style. The byte constant defines how nodes should be distributed within their lanes.


Implementation
    public function get fillStyle():int
    public function set fillStyle(value:int):void
horizontalproperty 
horizontal:Boolean

Specifies whether this instance is configured to create horizontal rows of child nodes.


Implementation
    public function get horizontal():Boolean
    public function set horizontal(value:Boolean):void
horizontalDistanceproperty 
horizontalDistance:Number

Specifies the horizontal distance this NodePlacer should use for the arrangement of the elements.


Implementation
    public function get horizontalDistance():Number
    public function set horizontalDistance(value:Number):void
verticalDistanceproperty 
verticalDistance:Number

Specifies the vertical distance this NodePlacer should use for the arrangement of the elements.


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

Creates a new instance of ARNodePlacer with default orientation (vertical), aspect ratio (1.0d), fill style ( FILL_STYLE_LEADING), and default distances (40.0d).

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.

See also

Method Detail
clone()method
override public function clone():Object

Returns
Object
cloneImpl()method 
override protected function cloneImpl(o:Object):void

Parameters

o:Object

createFromSketchComparator()method 
public function createFromSketchComparator():Comparator

Returns
Comparator
determineChildConnector()method 
override protected function determineChildConnector(child:Node):int

Parameters

child:Node

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

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

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

See also

initARNodePlacer2()method 
protected final function initARNodePlacer2(horizontal:Boolean, aspectRatio:Number, fillStyle:int, horizontalDistance:Number, verticalDistance:Number):void

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

Parameters

horizontal:Boolean
 
aspectRatio:Number
 
fillStyle:int
 
horizontalDistance:Number
 
verticalDistance:Number

See also

newARNodePlacer1()method 
public static function newARNodePlacer1():ARNodePlacer

Creates a new instance of ARNodePlacer with default orientation (vertical), aspect ratio (1.0d), fill style ( FILL_STYLE_LEADING), and default distances (40.0d).

Returns
ARNodePlacer

See also

newARNodePlacer2()method 
public static function newARNodePlacer2(horizontal:Boolean, aspectRatio:Number, fillStyle:int, horizontalDistance:Number, verticalDistance:Number):ARNodePlacer

Creates a new instance of ARNodePlacer with given orientation and distances.

Parameters

horizontal:Booleantrue for horizontal row mode
 
aspectRatio:Number — the aspectRatio, this instance should try to obey
 
fillStyle:int — a fill style constant describing the node distribution
 
horizontalDistance:Number — horizontal distance between adjacent elements
 
verticalDistance:Number — vertical distance between adjacent elements

Returns
ARNodePlacer
placeSubtreeCore()method 
override protected function placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape

Parameters

localRoot:Node
 
parentConnectorDirection:int

Returns
GenericTreeLayouter_SubtreeShape
Constant Detail
FILL_STYLE_CENTEREDConstant
public static const FILL_STYLE_CENTERED:int = 4

Byte constant that can be used for the fillStyle property. Elements in one lane will be centered with the bounds.

FILL_STYLE_JUSTIFYConstant 
public static const FILL_STYLE_JUSTIFY:int = 3

Byte constant that can be used for the fillStyle property. Elements in one lane will be justified with the bounds.

FILL_STYLE_LEADINGConstant 
public static const FILL_STYLE_LEADING:int = 1

Byte constant that can be used for the fillStyle property. Elements in one lane will be aligned with the leading edge.

FILL_STYLE_TRAILINGConstant 
public static const FILL_STYLE_TRAILING:int = 2

Byte constant that can be used for the fillStyle property. Elements in one lane will be aligned with the trailing edge.