Search this API

y.layout.hierarchic.incremental
Interface NodeData


public interface NodeData

Multi-purpose node descriptor for each node in 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 a node's type and depending on the type an optional associated Edge and associated Node . Optionally they may carry a geometric description of the Node's borders and descriptors for various aspects of the layout.


Field Summary
static byte TYPE_BEND
          Node type constant as returned by getType().
static byte TYPE_DISTANCE_NODE
          Node type constant as returned by getType().
static byte TYPE_GROUP
          Node type constant as returned by getType().
static byte TYPE_GROUP_BEGIN
          Node type constant as returned by getType().
static byte TYPE_GROUP_END
          Node type constant as returned by getType().
static byte TYPE_GROUP_LAYER_DUMMY
          Node type constant as returned by getType().
static byte TYPE_LABEL
          Node type constant as returned by getType().
static byte TYPE_NORMAL
          Node type constant as returned by getType().
static byte TYPE_PROXY_FOR_EDGE_AT_GROUP
          Node type constant as returned by getType().
static byte TYPE_SAME_LAYER_CENTER_NODE
          Node type constant as returned by getType().
static byte TYPE_SAME_LAYER_SIDE_PROXY
          Node type constant as returned by getType().
static byte TYPE_SIDE_PROXY
          Node type constant as returned by getType().
static byte TYPE_SOURCE_BACKLOOP_PROXY
          Node type constant as returned by getType().
static byte TYPE_SOURCE_GROUP_NODE
          Node type constant as returned by getType().
static byte TYPE_TARGET_BACKLOOP_PROXY
          Node type constant as returned by getType().
static byte TYPE_TARGET_GROUP_NODE
          Node type constant as returned by getType().
 
Method Summary
 BorderLine createBorderLine(int side, NodeLayout nl)
          Creates, stores, and returns a BorderLine for the given side or returns the currently set BorderLine if it already exists.
 Edge getAssociatedEdge()
          Returns the associated edge (in case of e.g. bend or same layer center node)
 Node getAssociatedNode()
          Returns the associated node (in case of e.g. backloop proxy and side proxy)
 ListCell getFirstSameLayerEdgeCell()
          Returns the first same layer edge ListCell of all same layer edges.
 Object getGroupId()
          Returns group id of this node if it is a bus group node.
 Layers getGroupLayers()
          Returns the inner layers of this group node.
 Node getGroupNode()
          Returns the group node this node belongs to.
 HierarchicLayouter.IncrementalHint getIncrementalHint()
          Returns the hint of the incremental mode of this node if this node is of type TYPE_NORMAL and a corresponding hint has been set via the HierarchicLayouter.INCREMENTAL_HINTS_DPKEY DataProvider.
 int getLayer()
          Returns the layer index this node resides in
 NodeLayoutDescriptor getNodeLayoutDescriptor()
          Returns the NodeLayoutDescriptor instance that was initially bound to this node or null.
 BorderLine getNormalizedBorderLine(int side)
          Returns a borderline for the given side which is treated as if the node's position was at (0,0).
 Node getParentGroupNode()
          Returns the parent group node if any
 int getPosition()
          Returns the current position of this node in its layer.
 SwimLaneDescriptor getSwimLaneDescriptor()
          Returns the SwimLaneDescriptor instance that was initially bound to this node or null.
 byte getType()
          Returns the type constant for this node
 int sameLayerEdgeCount()
          Returns the number of same layer edges that are associated with this node
 

Field Detail

TYPE_NORMAL

static final byte TYPE_NORMAL
Node type constant as returned by getType(). A normal node - may have any degree, any size and any number of connected same layer edges.

See Also:
Constant Field Values

TYPE_BEND

static final byte TYPE_BEND
Node type constant as returned by getType(). A bend node - has degree 2, small size and no same layer edges.

See Also:
Constant Field Values

TYPE_SIDE_PROXY

static final byte TYPE_SIDE_PROXY
Node type constant as returned by getType(). 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 node this node is the proxy of.

See Also:
Constant Field Values

TYPE_SAME_LAYER_SIDE_PROXY

static final byte TYPE_SAME_LAYER_SIDE_PROXY
Node type constant as returned by getType(). A side proxy node for drawing same layer edges - has degree 0, small size and one same layer edge. The associated node is the node this node is the proxy of. The associated edge is the same layer edge this node is the proxy of.

See Also:
Constant Field Values

TYPE_LABEL

static final byte TYPE_LABEL
Node type constant as returned by getType(). A label node for drawing - 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:
Constant Field Values

TYPE_GROUP

static final byte TYPE_GROUP
Node type constant as returned by getType(). A group node if nested graph layouts are calculated. Carries additional Layers information.

See Also:
getGroupLayers(), Constant Field Values

TYPE_SOURCE_GROUP_NODE

static final byte TYPE_SOURCE_GROUP_NODE
Node type constant as returned by getType(). A source group node for bus edges. This node serves as a dummy node in a Layer.TYPE_SOURCE_GROUP_NODES layer.

See Also:
getGroupId(), Constant Field Values

TYPE_TARGET_GROUP_NODE

static final byte TYPE_TARGET_GROUP_NODE
Node type constant as returned by getType(). A target group node for bus edges. This node serves as a dummy node in a Layer.TYPE_TARGET_GROUP_NODES layer.

See Also:
getGroupId(), Constant Field Values

TYPE_SOURCE_BACKLOOP_PROXY

static final byte TYPE_SOURCE_BACKLOOP_PROXY
Node type constant as returned by getType(). A backloop proxy that belongs to the source of an edge - has degree 2, small size and exactly one same layer edge

See Also:
Constant Field Values

TYPE_TARGET_BACKLOOP_PROXY

static final byte TYPE_TARGET_BACKLOOP_PROXY
Node type constant as returned by getType(). A backloop proxy that belongs to the target of an edge - has degree 2, small size and exactly one same layer edge

See Also:
Constant Field Values

TYPE_SAME_LAYER_CENTER_NODE

static final byte TYPE_SAME_LAYER_CENTER_NODE
Node type constant as returned by getType(). A same layer edge crossing dummy node - has degree 2, small size and exactly two same layer edges. Is used to mark the crossing of the layer if source and target port are at opposite layer sides.

See Also:
Constant Field Values

TYPE_DISTANCE_NODE

static final byte TYPE_DISTANCE_NODE
Node type constant as returned by getType(). A node used for the drawing phase to keep the distance between two nodes.

See Also:
Constant Field Values

TYPE_GROUP_BEGIN

static final byte TYPE_GROUP_BEGIN
Node type constant as returned by getType(). A node used for the drawing phase to mark the beginning of a node group interval.

See Also:
Constant Field Values

TYPE_GROUP_END

static final byte TYPE_GROUP_END
Node type constant as returned by getType(). A node used for the drawing phase to mark the ending of a node group interval.

See Also:
Constant Field Values

TYPE_GROUP_LAYER_DUMMY

static final byte TYPE_GROUP_LAYER_DUMMY
Node type constant as returned by getType(). A node used for the the sequencing and drawing phase to mark a dummy node inserted to guarantee that a group is non-empty on each layer that it is defined on.

See Also:
Constant Field Values

TYPE_PROXY_FOR_EDGE_AT_GROUP

static final byte TYPE_PROXY_FOR_EDGE_AT_GROUP
Node type constant as returned by getType(). A node used for the the sequencing and drawing phase to mark a dummy node that has been inserted as a legal end point of an edge connecting to a group node.

See Also:
Constant Field Values
Method Detail

getGroupNode

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

Returns:
the group node this node belongs to or null if this node is a top level node.

getNormalizedBorderLine

BorderLine getNormalizedBorderLine(int side)
Returns a borderline for the given side which is treated as if the node's position was at (0,0). Clients may modify this instance but should always reset it to the original position, since this is a shared instance. May return null to indicate that the borderline can be determined through the node's NodeLayout

Parameters:
side - the index of the side where 0 means top, 1 means right, 2 means bottom, and 3 means left.
Returns:
a BorderLine instance if the node was at (0,0) or null
See Also:
createBorderLine(int, NodeLayout)

createBorderLine

BorderLine createBorderLine(int side,
                            NodeLayout nl)
Creates, stores, and returns a BorderLine for the given side or returns the currently set BorderLine if it already exists. Not every type of node supports this operation. TYPE_NORMAL supports borderlines.

Throws:
UnsupportedOperationException - if this type of node does not support node borders
Parameters:
side - the side as defined in getNormalizedBorderLine(int)
nl - the NodeLayout of the current node, the initial Borderline will be initialize from this instance
See Also:
getNormalizedBorderLine(int)

getFirstSameLayerEdgeCell

ListCell getFirstSameLayerEdgeCell()
Returns the first same layer edge ListCell of all same layer edges.

Returns:
a ListCell containing the first same layer edge or null if there is no same layer edge

sameLayerEdgeCount

int sameLayerEdgeCount()
Returns the number of same layer edges that are associated with this node

Returns:
the number

getType

byte getType()
Returns the type constant for this node

Returns:
one of the type constants defined in this interface

getGroupId

Object getGroupId()
Returns group id of this node if it is a bus group node.

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

getAssociatedNode

Node getAssociatedNode()
Returns the associated node (in case of e.g. backloop proxy and side proxy)

Returns:
the associated node

getAssociatedEdge

Edge getAssociatedEdge()
Returns the associated edge (in case of e.g. bend or same layer center node)

Returns:
the associated edge

getLayer

int getLayer()
Returns the layer index this node resides in

Returns:
the index of the Layer instance this node resides in

getPosition

int getPosition()
Returns the current position of this node in its layer. Note: this may not always be up to date depending on which phase the layout algorithm is currently in

Returns:
the zero based position index in the current layer

getParentGroupNode

Node getParentGroupNode()
Returns the parent group node if any

Returns:
the parent, this node is a child of (in the sense of hierarchically grouped graphs)

getGroupLayers

Layers getGroupLayers()
Returns the inner layers of this group node. 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 this node if this node is of type TYPE_NORMAL and a corresponding hint has been set via the HierarchicLayouter.INCREMENTAL_HINTS_DPKEY DataProvider.

Returns:
the hint associated with this node or HierarchicLayouter.IncrementalHint.NONE

getNodeLayoutDescriptor

NodeLayoutDescriptor getNodeLayoutDescriptor()
Returns the NodeLayoutDescriptor instance that was initially bound to this node or null.

Returns:
the NodeLayoutDescriptor instance bound to this node.

getSwimLaneDescriptor

SwimLaneDescriptor getSwimLaneDescriptor()
Returns the SwimLaneDescriptor instance that was initially bound to this node or null.

Returns:
the SwimLaneDescriptor bound to this node.

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