Search this API

y.layout.hierarchic.incremental
Interface NodeData


public interface NodeData

This interface provides layout information about the nodes of the graph during the layout.

NodeData is a multi-purpose node descriptor for each node of the graph during the hierarchic layout used internally by the algorithm implementations.

Instances of this interface can be obtained during the layout from instances of the LayoutDataProvider interface.

NodeData typically carries the type of the node and depending on the type an optional associated edge and associated node. Optionally, it may carry a geometric description of the borders of the node and descriptors for various aspects of the layout.

 

Field Summary
static byte TYPE_BEND
          A constant describing a bend Node.
static byte TYPE_BUS_STRUCTURE_DUMMY
          A constant describing a Node that is used during the sequencing and drawing phase for the bus-style routing of bus edges at a certain root node.
static byte TYPE_DISTANCE_NODE
          A constant describing a Node used for the drawing phase to keep the distance between two nodes.
static byte TYPE_GROUP
          A constant describing a group Node for nested graph layouts.
static byte TYPE_GROUP_BEGIN
          A constant describing a Node used during the drawing phase for marking the beginning of a node group interval.
static byte TYPE_GROUP_END
          A constant describing a Node used during the drawing phase for marking the ending of a node group interval.
static byte TYPE_GROUP_LAYER_DUMMY
          A constant describing a Node used during the sequencing and drawing phase for marking a dummy node inserted to guarantee that a group is non-empty on the layer on which it is defined.
static byte TYPE_LABEL
          A constant describing a label Node.
static byte TYPE_NORMAL
          A constant describing a normal Node.
static byte TYPE_PROXY_FOR_CONTENT_EDGE_AT_GROUP
          A constant describing a Node used during the sequencing and drawing phase for marking a dummy node inserted as a legal endpoint of an edge connecting a descendant node to a group node.
static byte TYPE_PROXY_FOR_EDGE_AT_GROUP
          A constant describing a Node used during the sequencing and drawing phase for marking a dummy node inserted as a legal endpoint of an edge connecting to a group node.
static byte TYPE_RECURSIVE_EDGE_DUMMY
          A constant describing a Node used during sequencing and drawing phase for routing an Edge recursively.
static byte TYPE_SAME_LAYER_CENTER_NODE
          A constant describing a same-layer edge crossing dummy Node.
static byte TYPE_SAME_LAYER_SIDE_PROXY
          A constant describing a side proxy Node for drawing same-layer edges.
static byte TYPE_SIDE_PROXY
          A constant describing a side proxy Node.
static byte TYPE_SOURCE_BACKLOOP_PROXY
          A constant describing a back-loop proxy that belongs to the source of an edge.
static byte TYPE_SOURCE_GROUP_NODE
          A constant describing a source group Node for bus edges.
static byte TYPE_TARGET_BACKLOOP_PROXY
          A constant describing a back-loop proxy that belongs to the target of an edge.
static byte TYPE_TARGET_GROUP_NODE
          A constant describing a target group Node for bus edges.
 
Method Summary
 BorderLine createBorderLine(int side, NodeLayout nodeLayout)
          Creates, stores and returns a BorderLine for the given side or returns the current BorderLine instance if it already exists.
 Edge getAssociatedEdge()
          Returns the associated Edge of the Node of this NodeData instance (in case of e.g. bend or same-layer center node).
 Node getAssociatedNode()
          Returns the associated Node of this NodeData instance (in case of e.g. back-loop proxy and side proxy).
 ListCell getFirstSameLayerEdgeCell()
          Returns the first same-layer edge ListCell of all same-layer edges or null if there exists no same-layer edge.
 java.lang.Object getGroupId()
          Returns the group ID of the Node of this NodeData instance if it is a bus-group node.
 Layers getGroupLayers()
          Returns the inner layers of the group Node of this NodeData instance.
 Node getGroupNode()
          Returns the group node this node belongs to.
 HierarchicLayouter.IncrementalHint getIncrementalHint()
          Returns the hint of the incremental mode of the Node of this NodeData instance if this node is of type TYPE_NORMAL.
 int getLayer()
          Returns the index of the Layer instance to which the Node of this NodeData instance belongs.
 NodeLayoutDescriptor getNodeLayoutDescriptor()
          Returns the NodeLayoutDescriptor instance initially bound to the Node of this NodeData instance or null if no NodeLayoutDescriptor has been registered.
 BorderLine getNormalizedBorderLine(int side)
          Returns a BorderLine for the given side which is treated as if the position of the node is at (0,0).
 Node getParentGroupNode()
          Returns the parent group node of the Node of this NodeData instance (if any).
 int getPosition()
          Returns the current position of the Node of this NodeData instance within its layer.
 SwimLaneDescriptor getSwimLaneDescriptor()
          Returns the SwimLaneDescriptor instance initially bound to the Node of this NodeData instance or null if no SwimLaneDescriptor has been registered.
 byte getType()
          Returns the type constant for the Node of this NodeData instance.
 int sameLayerEdgeCount()
          Returns the number of same-layer edges associated with the Node of this NodeData instance.
 

Field Detail

TYPE_NORMAL

static final byte TYPE_NORMAL
A constant describing a normal Node.

A normal node may have any degree, any size and any number of connected same-layer edges.

See Also:
getType(), Constant Field Values

TYPE_BEND

static final byte TYPE_BEND
A constant describing a bend Node.

A bend node has degree 2, small size and no same-layer edges.

See Also:
getType(), Constant Field Values

TYPE_SIDE_PROXY

static final byte TYPE_SIDE_PROXY
A constant describing a side proxy Node.

A side proxy node, in case port constraints are used for the drawing phase, has degree 1, small size and no same-layer edges. The associated node is the one of which this node is the proxy.

See Also:
getType(), Constant Field Values

TYPE_SAME_LAYER_SIDE_PROXY

static final byte TYPE_SAME_LAYER_SIDE_PROXY
A constant describing a side proxy Node for drawing same-layer edges.

A side proxy node for drawing same-layer edges has degree 0, small size and one same-layer edge. The associated node is the one of which this node is the proxy. The associated edge is the same-layer edge of which this node is the proxy.

See Also:
getType(), Constant Field Values

TYPE_LABEL

static final byte TYPE_LABEL
A constant describing a label Node.

A label node has degree 2, size of the labels and no same-layer edges. The borders of this node describe the layout of the labels.

See Also:
getType(), Constant Field Values

TYPE_GROUP

static final byte TYPE_GROUP
A constant describing a group Node for nested graph layouts.

This group node carries additional Layers information.

See Also:
getType(), getGroupLayers(), Constant Field Values

TYPE_SOURCE_GROUP_NODE

static final byte TYPE_SOURCE_GROUP_NODE
A constant describing a source group Node for bus edges.

This node serves as a dummy node in a Layer.TYPE_SOURCE_GROUP_NODES layer.

See Also:
getType(), getGroupId(), Constant Field Values

TYPE_TARGET_GROUP_NODE

static final byte TYPE_TARGET_GROUP_NODE
A constant describing a target group Node for bus edges.

This node serves as a dummy node in a Layer.TYPE_TARGET_GROUP_NODES layer.

See Also:
getType(), getGroupId(), Constant Field Values

TYPE_SOURCE_BACKLOOP_PROXY

static final byte TYPE_SOURCE_BACKLOOP_PROXY
A constant describing a back-loop proxy that belongs to the source of an edge.

A back-loop proxy that belongs to the source of an edge has degree 2, small size and exactly one same-layer edge.

See Also:
getType(), Constant Field Values

TYPE_TARGET_BACKLOOP_PROXY

static final byte TYPE_TARGET_BACKLOOP_PROXY
A constant describing a back-loop proxy that belongs to the target of an edge.

A back-loop proxy that belongs to the target of an edge has degree 2, small size and exactly one same-layer edge.

See Also:
getType(), Constant Field Values

TYPE_SAME_LAYER_CENTER_NODE

static final byte TYPE_SAME_LAYER_CENTER_NODE
A constant describing a same-layer edge crossing dummy Node.

A same-layer edge crossing dummy node has degree 2, small size and exactly two same-layer edges. It is used for marking the crossing of the layer, if source and target port are at opposite layer sides.

See Also:
getType(), Constant Field Values

TYPE_DISTANCE_NODE

static final byte TYPE_DISTANCE_NODE
A constant describing a Node used for the drawing phase to keep the distance between two nodes.

See Also:
getType(), Constant Field Values

TYPE_GROUP_BEGIN

static final byte TYPE_GROUP_BEGIN
A constant describing a Node used during the drawing phase for marking the beginning of a node group interval.

See Also:
getType(), Constant Field Values

TYPE_GROUP_END

static final byte TYPE_GROUP_END
A constant describing a Node used during the drawing phase for marking the ending of a node group interval.

See Also:
getType(), Constant Field Values

TYPE_GROUP_LAYER_DUMMY

static final byte TYPE_GROUP_LAYER_DUMMY
A constant describing a Node used during the sequencing and drawing phase for marking a dummy node inserted to guarantee that a group is non-empty on the layer on which it is defined.

See Also:
getType(), Constant Field Values

TYPE_PROXY_FOR_EDGE_AT_GROUP

static final byte TYPE_PROXY_FOR_EDGE_AT_GROUP
A constant describing a Node used during the sequencing and drawing phase for marking a dummy node inserted as a legal endpoint of an edge connecting to a group node.

See Also:
getType(), Constant Field Values

TYPE_PROXY_FOR_CONTENT_EDGE_AT_GROUP

static final byte TYPE_PROXY_FOR_CONTENT_EDGE_AT_GROUP
A constant describing a Node used during the sequencing and drawing phase for marking a dummy node inserted as a legal endpoint of an edge connecting a descendant node to a group node. It has degree 0 or 1 depending on whether or not the opposite node of the edge is assigned to the same layer. This kind of proxy nodes is only used if there are edges that shall connect to the group node without backloops.

See Also:
EdgeLayoutDescriptor.setDirectGroupContentEdgeRoutingEnabled(boolean), Constant Field Values

TYPE_RECURSIVE_EDGE_DUMMY

static final byte TYPE_RECURSIVE_EDGE_DUMMY
A constant describing a Node used during sequencing and drawing phase for routing an Edge recursively. An Edge that connects to the content of a group node has to leave the group node at the bottom side and enter it at the top side.

See Also:
getType(), Constant Field Values

TYPE_BUS_STRUCTURE_DUMMY

static final byte TYPE_BUS_STRUCTURE_DUMMY
A constant describing a Node that is used during the sequencing and drawing phase for the bus-style routing of bus edges at a certain root node. Such a node is inserted on each layer of the bus structure.

See Also:
getType(), IncrementalHierarchicLayouter.BUS_DESCRIPTOR_DPKEY, Constant Field Values
Method Detail

getGroupNode

Node getGroupNode()
Returns the group node this node belongs to.

Returns:
the group node to which the associated Node belongs or null if the associated Node is a top level node.

getNormalizedBorderLine

BorderLine getNormalizedBorderLine(int side)
Returns a BorderLine for the given side which is treated as if the position of the node is at (0,0).

Clients may modify this instance but should always reset it to the original position, since this is a shared instance.

It may return null to indicate that the BorderLine can be determined through the NodeLayout instance.

Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side and 3 to the left side.

Parameters:
side - an integer value from [0,3] interval
Returns:
a BorderLine instance or null
See Also:
createBorderLine(int, NodeLayout)

createBorderLine

BorderLine createBorderLine(int side,
                            NodeLayout nodeLayout)
Creates, stores and returns a BorderLine for the given side or returns the current BorderLine instance if it already exists.

Not every type of node supports this operation. TYPE_NORMAL supports BorderLines.

Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side and 3 to the left side.

Parameters:
side - an integer value from [0,3] interval
nodeLayout - the NodeLayout of the current node
Returns:
a BorderLine instance
Throws:
java.lang.UnsupportedOperationException - if this type of node does not support node borders
See Also:
getNormalizedBorderLine(int)

getFirstSameLayerEdgeCell

ListCell getFirstSameLayerEdgeCell()
Returns the first same-layer edge ListCell of all same-layer edges or null if there exists no same-layer edge.

Returns:
a ListCell containing the first same-layer edge or null if no same-layer edge exists

sameLayerEdgeCount

int sameLayerEdgeCount()
Returns the number of same-layer edges associated with the Node of this NodeData instance.

Returns:
the number of same-layer edges associated with the node

getType

byte getType()
Returns the type constant for the Node of this NodeData instance.

Returns:
one of the predefined type constants

getGroupId

java.lang.Object getGroupId()
Returns the group ID of the Node of this NodeData instance if it is a bus-group node.

Returns:
a group ID or null if this node does not belong to an edge group node construct
See Also:
TYPE_SOURCE_GROUP_NODE, TYPE_TARGET_GROUP_NODE

getAssociatedNode

Node getAssociatedNode()
Returns the associated Node of this NodeData instance (in case of e.g. back-loop proxy and side proxy).

Returns:
the associated Node

getAssociatedEdge

Edge getAssociatedEdge()
Returns the associated Edge of the Node of this NodeData instance (in case of e.g. bend or same-layer center node).

Returns:
the associated Edge

getLayer

int getLayer()
Returns the index of the Layer instance to which the Node of this NodeData instance belongs.

Returns:
the index of the Layer instance to which this Node belongs

getPosition

int getPosition()
Returns the current position of the Node of this NodeData instance within its layer.

 
This may not always be up-to-date depending on which phase the layout algorithm is currently executed.
Returns:
the zero-based position index of the Node within its current layer

getParentGroupNode

Node getParentGroupNode()
Returns the parent group node of the Node of this NodeData instance (if any).

Returns:
the parent of the Node (in the sense of hierarchically grouped graphs)

getGroupLayers

Layers getGroupLayers()
Returns the inner layers of the group Node of this NodeData instance.

If this node is of type TYPE_GROUP, this method returns the Layers object that describes the layering in the subgraph.

Returns:
the layers of the subgraph

getIncrementalHint

HierarchicLayouter.IncrementalHint getIncrementalHint()
Returns the hint of the incremental mode of the Node of this NodeData instance if this node is of type TYPE_NORMAL.

The corresponding hint has been set by a DataProvider using key HierarchicLayouter.INCREMENTAL_HINTS_DPKEY.

Returns:
the hint of this Node or HierarchicLayouter.IncrementalHint.NONE

getNodeLayoutDescriptor

NodeLayoutDescriptor getNodeLayoutDescriptor()
Returns the NodeLayoutDescriptor instance initially bound to the Node of this NodeData instance or null if no NodeLayoutDescriptor has been registered.

Returns:
a NodeLayoutDescriptor instance or null if no NodeLayoutDescriptor has been registered

getSwimLaneDescriptor

SwimLaneDescriptor getSwimLaneDescriptor()
Returns the SwimLaneDescriptor instance initially bound to the Node of this NodeData instance or null if no SwimLaneDescriptor has been registered.

Returns:
a SwimLaneDescriptor instance or null if no SwimLaneDescriptor has been registered

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.