Search this API

y.layout.multipage
Interface NodeInfo


public interface NodeInfo

This interface offers access to information associated with a node.

The information can be either obtained from MultiPageLayout.getNodeInfo(Node) or LayoutContext.getNodeInfo(Node).

 

Field Summary
static byte TYPE_CONNECTOR
          A node type that specifies a connector node.
static byte TYPE_GROUP
          A node type that specifies a group node.
static byte TYPE_NORMAL
          A node type that specifies a normal node.
static byte TYPE_PROXY
          A node type that specifies a proxy node.
static byte TYPE_PROXY_REFERENCE
          A node type that specifies a proxy reference node.
 
Method Summary
 java.lang.Object getId()
          Returns the unique ID of the node associated with this info object.
 int getPageNo()
          Returns the page number of the page graph that contains the node associated with this info object.
 Node getReferencingNode()
          Returns the node that refers to the one associated with this info object.
 Node getRepresentedNode()
          Returns the node of the input graph that is represented by the node associated with this info object.
 byte getType()
          Returns the type of the node associated with this info object.
 

Field Detail

TYPE_NORMAL

static final byte TYPE_NORMAL
A node type that specifies a normal node.

A node is called normal if it does not belong to any other type.

See Also:
getType(), Constant Field Values

TYPE_GROUP

static final byte TYPE_GROUP
A node type that specifies a group node.

A group node is a node that may contain other nodes.

See Also:
getType(), Constant Field Values

TYPE_PROXY

static final byte TYPE_PROXY
A node type that specifies a proxy node.

A proxy node is a copy of a normal node. It is created by the algorithm if a normal node and its neighbors or associated connectors do not fit onto a single page. Hence, in such cases, the neighbors/connectors associated with a normal node may be distributed among different proxy nodes associated with this node.

 
A normal node may be associated with multiple proxy nodes placed on different pages.
See Also:
getType(), TYPE_NORMAL, TYPE_PROXY_REFERENCE, MultiPageLayouter.setProxyReferenceNodeCreationEnabled(boolean), Constant Field Values
Sample Graphs:

The input graph.

The result after a multi-page layout run. The second page contains a proxy for node 1. The first page has a proxy reference (the elliptical node) that indicates that there is a proxy of node 1 located at the second page.

TYPE_PROXY_REFERENCE

static final byte TYPE_PROXY_REFERENCE
A node type that specifies a proxy reference node.

For each proxy node there is exactly one matching proxy reference node (except if property MultiPageLayouter.setProxyReferenceNodeCreationEnabled(boolean) is disabled). The reference node refers to the proxy and is either connected to the normal node associated with this proxy or one of its other proxy nodes (a normal node may be associated with multiple proxy nodes). Hence, for a node connected to a proxy reference node there always exists a copy located on another page.

See Also:
getType(), TYPE_PROXY, MultiPageLayouter.setProxyReferenceNodeCreationEnabled(boolean), Constant Field Values
Sample Graphs:

The input graph.

The result after a multi-page layout run. The first page has a proxy reference (the elliptical node) that indicates that there is a proxy of node 1 located at the second page.

TYPE_CONNECTOR

static final byte TYPE_CONNECTOR
A node type that specifies a connector node.

Each edge of the input graph that connects two nodes v and w that are placed on different pages is split by a pair of matching connector nodes (one for each of the two pages). One of the connector nodes is connected to v and the other to w. Hence, each connector represents a jump mark to the matching connector and guarantees that no information is lost as it would be the case if such edges are simply removed.

See Also:
getType(), Constant Field Values
Sample Graphs:

The input graph.

The result after a multi-page layout run. The edge between node 1 and 2 is split by a pair of connector nodes (the two circular nodes). The label of a connector corresponds to that of the node connected to the matching connector (i.e., the opposite node of the split edge).
Method Detail

getRepresentedNode

Node getRepresentedNode()
Returns the node of the input graph that is represented by the node associated with this info object.

Note that, for the special nodes inserted to guarantee that no information is lost, there are no corresponding nodes in the input graph. Hence, special nodes are mapped to common nodes in the following way:

 
All nodes of the page graphs are created by the layout algorithm, the input graph remains unchanged. Matching elements are mapped to the same element ID, see MultiPageLayouter.NODE_ID_DPKEY, MultiPageLayouter.EDGE_ID_DPKEY, MultiPageLayouter.NODE_LABEL_ID_DPKEY and MultiPageLayouter.EDGE_LABEL_ID_DPKEY. This method always returns a node of the input graph!
Returns:
the represented node

getPageNo

int getPageNo()
Returns the page number of the page graph that contains the node associated with this info object.

 
This information is first available after the layout run.
Returns:
the page of the associated node

getType

byte getType()
Returns the type of the node associated with this info object.

Returns:
the type of the node

getId

java.lang.Object getId()
Returns the unique ID of the node associated with this info object.

Returns:
the ID of the node
See Also:
MultiPageLayouter.NODE_ID_DPKEY

getReferencingNode

Node getReferencingNode()
Returns the node that refers to the one associated with this info object.

More precisely, if the node associated with this info object

Returns:
the referencing node
See Also:
TYPE_CONNECTOR, TYPE_PROXY, TYPE_PROXY_REFERENCE, MultiPageLayouter.setProxyReferenceNodeCreationEnabled(boolean)

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