Packagecom.yworks.yfiles.layout.hierarchic.incremental
Classpublic class NodeLayoutDescriptor
InheritanceNodeLayoutDescriptor Inheritance YObject Inheritance Object

This class is used by com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl during the various phases to determine the drawing details of the graph's nodes. Note: not all of these values will be used for all kinds of nodes and any kind of algorithm used. This class is designed as a class to allow for future additions of new getter methods.

See also

com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl.NODE_LAYOUT_DESCRIPTOR_DPKEY
com.yworks.yfiles.layout.hierarchic.incremental.EdgeLayoutDescriptor
com.yworks.yfiles.layout.hierarchic.incremental.HierarchicLayouterImpl


Public Properties
 PropertyDefined By
  gridReference : YPoint
Specifies a reference point relative to the center of the node which will be placed on a grid coordinate.
NodeLayoutDescriptor
  layerAlignment : Number
Getter: Returns the alignment of the node within its layer Default is 0.5d which results in center-aligned nodes.
NodeLayoutDescriptor
  minimumDistance : Number
Getter: Returns the preferred minimum distance of the node to obstacles.
NodeLayoutDescriptor
  minimumLayerHeight : Number
Specifies the minimum height of the layer this node will be assigned to.
NodeLayoutDescriptor
  nodeLabelMode : int
Getter: Returns the mode that determines the consideration of node labels during the layout. This can be one of NODE_LABEL_MODE_NEVER, NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS, NODE_LABEL_MODE_CONSIDER_FOR_DRAWING, or NODE_LABEL_MODE_CONSIDER_FOR_ROUTING.
NodeLayoutDescriptor
  portAssignment : int
Specifies the assignment strategy which is used to distribute the ports on the node borders.
NodeLayoutDescriptor
  portBorderGapRatios : Number
[write-only] Sets the port border gap ratio for the port distribution on all sides of the node.
NodeLayoutDescriptor
Public Methods
 MethodDefined By
  
NodeLayoutDescriptor(init:Boolean = true)
Creates a new instance of a NodeLayoutDescriptor using the default values.
NodeLayoutDescriptor
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
NodeLayoutDescriptor
  
getPortBorderGapRatio(side:int):Number
Returns the port border gap ratio for the port distribution at the given side.
NodeLayoutDescriptor
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of a NodeLayoutDescriptor using the default values.
NodeLayoutDescriptor
  
setPortBorderGapRatio(side:int, ratio:Number):void
Sets the port border gap ratio for the port distribution at the given side.
NodeLayoutDescriptor
Protected Methods
 MethodDefined By
  
Initializes this object.
NodeLayoutDescriptor
Public Constants
 ConstantDefined By
  NODE_LABEL_MODE_CONSIDER_FOR_DRAWING : int = 2
[static] Byte constant used by nodeLabelMode and nodeLabelMode.
NodeLayoutDescriptor
  NODE_LABEL_MODE_CONSIDER_FOR_ROUTING : int = 3
[static] Byte constant used by nodeLabelMode and nodeLabelMode.
NodeLayoutDescriptor
  NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS : int = 1
[static] Byte constant used by nodeLabelMode and nodeLabelMode.
NodeLayoutDescriptor
  NODE_LABEL_MODE_NEVER : int = 0
[static] Byte constant used by nodeLabelMode and nodeLabelMode.
NodeLayoutDescriptor
  PORT_ASSIGNMENT_DEFAULT : int = 0
[static] Port assignment specifier that describes the default port assignment strategy of com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.
NodeLayoutDescriptor
  PORT_ASSIGNMENT_ON_GRID : int = 1
[static] Port assignment specifier that describes a port assignment strategy which places all edges on grid lines.
NodeLayoutDescriptor
  PORT_ASSIGNMENT_ON_SUBGRID : int = 2
[static] Port assignment specifier that describes a port assignment strategy which places all edges on grid lines or subgrid lines.
NodeLayoutDescriptor
Property Detail
gridReferenceproperty
gridReference:YPoint

Specifies a reference point relative to the center of the node which will be placed on a grid coordinate. By default the reference point is com.yworks.yfiles.geom.YPoint.ORIGIN and the nodes' center is placed on the grid.

The grid reference point will only be considered if there actually is a grid (com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.gridSpacing).


Implementation
    public function get gridReference():YPoint
    public function set gridReference(value:YPoint):void

See also

layerAlignmentproperty 
layerAlignment:Number

Getter: Returns the alignment of the node within its layer Default is 0.5d which results in center-aligned nodes.

Setter: Sets the alignment of the node within its layer. A value of 0.0d means nodes are aligned at the top of the layer (for top-down drawing). A value of 0.5d results in center-aligned nodes and 1.0d leads to bottom-aligned nodes.


Implementation
    public function get layerAlignment():Number
    public function set layerAlignment(value:Number):void

Throws
IllegalArgumentException — if the alignment is not within [0.0d .. 1.0d]
minimumDistanceproperty 
minimumDistance:Number

Getter: Returns the preferred minimum distance of the node to obstacles. Default is 5.0d.

Setter: Sets the preferred minimum distance to obstacles.


Implementation
    public function get minimumDistance():Number
    public function set minimumDistance(value:Number):void
minimumLayerHeightproperty 
minimumLayerHeight:Number

Specifies the minimum height of the layer this node will be assigned to. Note, that this will only affect the drawing if different layerAlignments (layerAlignment) are present.


Implementation
    public function get minimumLayerHeight():Number
    public function set minimumLayerHeight(value:Number):void

See also

nodeLabelModeproperty 
nodeLabelMode:int

Getter: Returns the mode that determines the consideration of node labels during the layout. This can be one of NODE_LABEL_MODE_NEVER, NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS, NODE_LABEL_MODE_CONSIDER_FOR_DRAWING, or NODE_LABEL_MODE_CONSIDER_FOR_ROUTING. The default is NODE_LABEL_MODE_CONSIDER_FOR_DRAWING .

Setter: Sets the mode that determines the consideration of node labels during the layout. Note that in order to get this feature working the algorithm must be provided information about the layout of the node labels. If com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter is used for the layout the com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.considerNodeLabels should be set to true. Otherwise one has to assure that e.g. via an instanceof com.yworks.yfiles.layout.LabelLayoutTranslator the algorithm receives the appropriate information. The mode constant can be one of NODE_LABEL_MODE_NEVER, NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS, NODE_LABEL_MODE_CONSIDER_FOR_DRAWING, or NODE_LABEL_MODE_CONSIDER_FOR_ROUTING.


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

Throws
IllegalArgumentException — if the constant is unknown.

See also

portAssignmentproperty 
portAssignment:int

Specifies the assignment strategy which is used to distribute the ports on the node borders.

Note that the port assignments PORT_ASSIGNMENT_DEFAULT, PORT_ASSIGNMENT_ON_GRID and PORT_ASSIGNMENT_ON_SUBGRID are currently only supported in com.yworks.yfiles.layout.hierarchic.incremental.DefaultPortAllocator . A custom implementation of com.yworks.yfiles.layout.hierarchic.incremental.PortAllocator will have to handle these assignments itself or will replace them with its own behavior.

Note that if no grid is specified ( grid spacing (com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.gridSpacing) is smaller or equal to 0), assignment PORT_ASSIGNMENT_DEFAULT is used.

By default PORT_ASSIGNMENT_DEFAULT is used.


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

See also

portBorderGapRatiosproperty 
portBorderGapRatios:Number  [write-only]

Sets the port border gap ratio for the port distribution on all sides of the node.


Implementation
    public function set portBorderGapRatios(value:Number):void

See also

Constructor Detail
NodeLayoutDescriptor()Constructor
public function NodeLayoutDescriptor(init:Boolean = true)

Creates a new instance of a NodeLayoutDescriptor using the default values.

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
getClass()method
override public function getClass():Class

Returns
Class
getPortBorderGapRatio()method 
public function getPortBorderGapRatio(side:int):Number

Returns the port border gap ratio for the port distribution at the given side. Default is 0.5d for all sides.

Parameters

side:int — the 0-based clockwise side index for top-to-bottom layouts

Returns
Number — the ratio
initNodeLayoutDescriptor()method 
protected final function initNodeLayoutDescriptor():void

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

See also

newNodeLayoutDescriptor()method 
public static function newNodeLayoutDescriptor():NodeLayoutDescriptor

Creates a new instance of a NodeLayoutDescriptor using the default values.

Returns
NodeLayoutDescriptor
setPortBorderGapRatio()method 
public function setPortBorderGapRatio(side:int, ratio:Number):void

Sets the port border gap ratio for the port distribution at the given side.

Parameters

side:int — the side
 
ratio:Number — the new ratio

Constant Detail
NODE_LABEL_MODE_CONSIDER_FOR_DRAWINGConstant
public static const NODE_LABEL_MODE_CONSIDER_FOR_DRAWING:int = 2

Byte constant used by nodeLabelMode and nodeLabelMode. This mode makes the algorithm consider node labels for node placement and routing but not for self loops.

See also

NODE_LABEL_MODE_CONSIDER_FOR_ROUTINGConstant 
public static const NODE_LABEL_MODE_CONSIDER_FOR_ROUTING:int = 3

Byte constant used by nodeLabelMode and nodeLabelMode. This mode makes the algorithm consider node labels during routing only.

See also

NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPSConstant 
public static const NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS:int = 1

Byte constant used by nodeLabelMode and nodeLabelMode. This mode makes the algorithm consider node labels for self-loops, node placement, and routing.

See also

NODE_LABEL_MODE_NEVERConstant 
public static const NODE_LABEL_MODE_NEVER:int = 0

Byte constant used by nodeLabelMode and nodeLabelMode. This mode prevents node labels from being considered during the layout at all.

See also

PORT_ASSIGNMENT_DEFAULTConstant 
public static const PORT_ASSIGNMENT_DEFAULT:int = 0

Port assignment specifier that describes the default port assignment strategy of com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter. The ports are distributed evenly at the border of the node.

See also

PORT_ASSIGNMENT_ON_GRIDConstant 
public static const PORT_ASSIGNMENT_ON_GRID:int = 1

Port assignment specifier that describes a port assignment strategy which places all edges on grid lines. If there are not enough grid lines for each port, ports may overlap. In case there is no grid line available at the side of a node, the ports are placed centered at that side.

Note that this port assignment can only be used if the grid spacing (com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.gridSpacing) is greater than 0.

See also

PORT_ASSIGNMENT_ON_SUBGRIDConstant 
public static const PORT_ASSIGNMENT_ON_SUBGRID:int = 2

Port assignment specifier that describes a port assignment strategy which places all edges on grid lines or subgrid lines. If there are not enough grid lines for each port, the grid gets subdivided with subgrid lines until each edge has space for its port.

Note that this port assignment can only be used if the grid spacing (com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter.gridSpacing) is greater than 0.

See also