C

HierarchicalLayoutNodeDescriptor

This class is used by HierarchicalLayout during the various phases to provide the drawing details of the nodes of the graph.
Inheritance Hierarchy

Remarks

A HierarchicalLayoutNodeDescriptor instance can be specified individually for single nodes with nodeDescriptors.

This class is designed as a class to allow future additions of new getter methods.

Default Values of Properties

NameDefaultDescription
borderToPortGapRatio0.5d
Ports are distributed along the sides of the node.
gridReferencePoint.ORIGIN
The reference point is ORIGIN and the center of the node is placed on the grid.
layerAlignment0.5d
Nodes are center-aligned within their corresponding layers.
minimumDistance5.0d
minimumLayerHeight0.0d
portAssignmentHierarchicalLayoutPortAssignmentMode.DEFAULT
Ports are distributed evenly along the border of the node.
tabularGroupChildDistance0

See Also

Developer's Guide

API

nodeDescriptors, HierarchicalLayoutEdgeDescriptor

Members

No filters for this type

Constructors

Creates a new instance of a HierarchicalLayoutNodeDescriptor with the default values.

Parameters

Properties

Sets the ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent ports) on all sides of the node.

This ratio determines the gap between a corner of the node and the first assigned port.

The ratio should be greater than 0.

A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port).

A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of the node and the first port is half as wide as the distance between two adjacent ports.

A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point.

final

Property Value

the given ratio

Throws

Exception ({ name: 'ArgumentError' })
if the given ratio is negative

Default Value

The default value is: 0.5d
Ports are distributed along the sides of the node.

Sample Graphs

ShownSetting: Port border gap ratio 0.0d - node 1 has port candidates LEFT and RIGHT while nodes 2,3,4 have port candidates BOTTOM.
Gets or sets the node's reference point that will be placed on a grid coordinate.
The reference point is specified as an offset to the center of the node. Hence, if for example the upper left corner of the node should be placed on a grid coordinate, you have to use -width/2 as the x-offset and -height/2 as the y-offset.
The grid reference point will only be considered if there actually is a grid.
conversionfinal

Property Value

the reference point for grid placement

Throws

Exception ({ name: 'ArgumentError' })
if the given grid reference is null

Default Value

The default value is: Point.ORIGIN
The reference point is ORIGIN and the center of the node is placed on the grid.

See Also

Developer's Guide
Gets or sets the alignment of the LayoutNode of this HierarchicalLayoutNodeDescriptor instance within its layer.
  • A value of 0.0d corresponds to top-alignment.
  • A value of 0.5d corresponds to center-alignment.
  • A value of 1.0d corresponds to bottom-alignment.
This value should be within [0,1] interval.
final

Property Value

a value from [0,1] interval

Throws

Exception ({ name: 'ArgumentError' })
if the alignment is not within the interval [0,1]

Default Value

The default value is: 0.5d
Nodes are center-aligned within their corresponding layers.

Sample Graphs

ShownSetting: Top-alignment (0.0d)
Gets or sets the preferred minimum distance to obstacles.

Currently, this distance only affects the following scenarios:

  • Distance between group nodes and other elements (horizontally and vertically).
  • The distance of normal nodes and group node to borders of a layout grid cell or swimlane.
  • The segment length of self-loops associated with this node.

The minimum distance should be greater than 0.

This setting does not affect the distance between normal nodes or between an edge and a normal node. These distances can be globally specified using nodeDistance and nodeToEdgeDistance, respectively. If individual spacings around nodes are required, node margins can be defined.
final

Property Value

the minimum distance to obstacles

Throws

Exception ({ name: 'ArgumentError' })
if the minimum length is negative

Default Value

The default value is: 5.0d

Sample Graphs

ShownSetting: Minimum distance 5.0
Gets or sets the minimum height of the layer to which this node is assigned.
Values should be equal or greater than 0.
This feature is especially useful if it is combined with different layerAlignments.
final

Property Value

a non-negative minimum height

Throws

Exception ({ name: 'ArgumentError' })
if the minimum height is negative

Default Value

The default value is: 0.0d

Sample Graphs

ShownSetting: Minimum layer height 0.0d (the bottom center node has layer alignment 1.0, all other nodes layer alignment 0.0)
Sets the minimum distance between ports on all sides of the node.

The node may be enlarged to ensure that the distances between the ports can be at least the given minimum distance. If the original size is already sufficient, it is not changed.

Negative values result in not changing the node size.

A value of 0.0d results in enlarging the node such that the edges (with given thicknesses) can be packed tightly.

A value larger than 0.0d results in enlarging the node such that the gaps between edges (with given thicknesses) have at least the required minimum size.

If a side has edges with fixed port candidates or edges that are aligned to such edges, the side length is not increased.
final

Default Value

The default value is: -1
The node size is not changed.
Gets or sets the assignment strategy which distributes the ports along the node borders.
Port assignments DEFAULT, ON_GRID and ON_SUBGRID are currently only supported in HierarchicalLayoutPortAssigner. A custom implementation of IHierarchicalLayoutPortAssigner will have to handle these assignments itself or will replace them with its own behavior.
If no grid is specified ( gridSpacing is smaller or equal to 0), assignment DEFAULT is used.
conversionfinal

Property Value

one of the predefined port assignment strategies

Default Value

Ports are distributed evenly along the border of the node.

See Also

Developer's Guide
Gets or sets the distance between this node and the other child nodes if they are part of a tabular group structure (tabularGroups).

This setting defines the spacing of child nodes in a tabular group node for which the global nodeDistance is ignored.

By default, this distance is set to zero to obtain maximally compact tabular group nodes without any spacing between the children.

final

Property Value

the distance between the node and other child nodes of the same tabular group

Throws

Exception ({ name: 'ArgumentError' })
if the given distance is negative

Default Value

The default value is: 0

Sample Graphs

ShownSetting: Child distance 0 (default)

See Also

Developer's Guide