|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.grouping.Grouping
public class Grouping
Instances of this class can be used by algorithms to efficiently query the structure of such type of graphs. The grouping information is provided through DataProviders, whose keys are defined in the GroupingKeys interface.
![]() |
![]() |
| Field Summary |
|---|
| Fields inherited from interface y.layout.grouping.GroupingKeys |
|---|
GROUP_DPKEY, GROUP_NODE_INSETS_DPKEY, MINIMUM_NODE_SIZE_DPKEY, NODE_ID_DPKEY, PARENT_NODE_ID_DPKEY |
| Constructor Summary | |
|---|---|
Grouping(LayoutGraph graph)
Creates a new instance of Grouping. |
|
| Method Summary | |
|---|---|
protected NodeMap |
createInfoMap(LayoutGraph graph)
Factory method for a NodeMap |
void |
dispose()
Disposes the data structures held by this instance. |
protected void |
disposeInfoMap(LayoutGraph graph,
NodeMap infoMap)
Factory destructor method for a NodeMap |
NodeList |
getChildren(Node parent)
Returns the children of the given group node as a NodeList. |
NodeList |
getDescendants(Node parent)
Returns all descendants of the given group node as a NodeList. |
EdgeList |
getEdgesGoingIn(Node groupNode)
Convenience method that returns a list of all Edges crossing the group node boundary of the given group node in such a way, that there target is inside the group node and the source does not lie inside the group node. |
EdgeList |
getEdgesGoingOut(Node groupNode)
Convenience method that returns a list of all Edges crossing the group node boundary of the given group node in such a way, that there target is outside the group node and the source does not lie outside the group node. |
LayoutGraph |
getLayoutGraph()
Returns the graph instance this object provides information for. |
Node |
getParent(Node node)
Returns the parent of the given node or null if the node
is at the top of the hierarchy |
Node |
getRepresentative(Node node,
Node inGroup)
Convenience method that returns a node that can be used to represent node in the group inGroup, that is either the node
itself if it is an immediate child of inGroup, or a node that
is a child of inGroup and an ancestor of node at the
same time or null if neither of the latter applies. |
Node |
getRoot()
Returns a node instance that can be used as a handle to the virtual root of the node hierarchy. |
protected void |
init()
Initializes internal data structures. |
static boolean |
isFlat(Graph graph)
A graph is considered to be flat if it is either not grouped or there is no group node that contains child nodes present in the graph. |
static boolean |
isGrouped(Graph graph)
A graph is considered to be grouped if the three low-level grouping data providers GroupingKeys.GROUP_DPKEY,
GroupingKeys.NODE_ID_DPKEY and GroupingKeys.PARENT_NODE_ID_DPKEY
are registered. |
boolean |
isGroupNode(Node node)
Determines if the given node is a group node. |
boolean |
isNormalEdge(Edge e)
Determines if the given Edge is a normal edge, i.e. whether it does not cross any group node boundaries. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Grouping(LayoutGraph graph)
disposed once the grouping instance is not needed anymore.
| Method Detail |
|---|
protected void init()
public LayoutGraph getLayoutGraph()
protected NodeMap createInfoMap(LayoutGraph graph)
protected void disposeInfoMap(LayoutGraph graph,
NodeMap infoMap)
public Node getParent(Node node)
null if the node
is at the top of the hierarchy
public Node getRoot()
public NodeList getChildren(Node parent)
public NodeList getDescendants(Node parent)
parent - A group node.
If null is given, the graph's root is used.
public boolean isGroupNode(Node node)
public boolean isNormalEdge(Edge e)
public EdgeList getEdgesGoingIn(Node groupNode)
public EdgeList getEdgesGoingOut(Node groupNode)
public Node getRepresentative(Node node,
Node inGroup)
node in the group inGroup, that is either the node
itself if it is an immediate child of inGroup, or a node that
is a child of inGroup and an ancestor of node at the
same time or null if neither of the latter applies.
node - the node for which a representative will be returnedinGroup - the group to which the representative should belong.public void dispose()
public static boolean isGrouped(Graph graph)
GroupingKeys.GROUP_DPKEY,
GroupingKeys.NODE_ID_DPKEY and GroupingKeys.PARENT_NODE_ID_DPKEY
are registered.
An instance of this class requires its graph to be grouped.
public static boolean isFlat(Graph graph)
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||