|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.graphml.graph2d.HierarchyManagerBasedHierarchySupport
public class HierarchyManagerBasedHierarchySupport
Implementation of HierarchySupport that uses a HierarchyManager
instance to retrieve the hierarchy information.
| Constructor Summary | |
|---|---|
HierarchyManagerBasedHierarchySupport(HierarchyManager hierarchyManager)
Create a new instance which is backed up by hierarchyManager. |
|
HierarchyManagerBasedHierarchySupport(HierarchyManager hierarchyManager,
Graph root)
Initializes a new instance of HierarchyManagerBasedHierarchySupport. |
|
| Method Summary | |
|---|---|
NodeList |
getChildren(GraphMLWriteContext context,
Node parent)
Returns the child nodes of a group/folder nodes. |
Node |
getNearestCommonAncestor(GraphMLWriteContext context,
Node node,
Node node1)
Returns the nearest common ancestor node of n and n1. |
Node |
getParent(GraphMLWriteContext context,
Node n)
Gets the parent node of n. |
Node |
getRoot(GraphMLWriteContext context)
Gets the root node of a hierarchy. |
Node |
getSourceNode(GraphMLWriteContext context,
Edge edge)
Returns the source node of edge. |
Graph |
getSubgraph(GraphMLWriteContext context,
Node n)
Gets the subgraph object that is represented by the node n. |
EdgeList |
getSubgraphEdges(GraphMLWriteContext context,
Graph g)
Returns all edges that lie completely in g. |
Node |
getTargetNode(GraphMLWriteContext context,
Edge edge)
Returns the target node of edge. |
boolean |
isLeafNode(GraphMLWriteContext context,
Node n)
Returns whether n is a leaf node or a group/folder node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HierarchyManagerBasedHierarchySupport(HierarchyManager hierarchyManager)
hierarchyManager.
Invoking this constructor is equivalent to:
new HierarchyManagerBasedHierarchySupport(hierarchyManager, hierarchyManager.getRootGraph())
hierarchyManager - The HierarchyManager that provides the hierarchy data.
public HierarchyManagerBasedHierarchySupport(HierarchyManager hierarchyManager,
Graph root)
HierarchyManagerBasedHierarchySupport.
hierarchyManager - the hierarchy information.root - the graph to be used as root for the graph hierarchy. Must be
a graph that is contained
in the given hierarchy.| Method Detail |
|---|
public boolean isLeafNode(GraphMLWriteContext context,
Node n)
HierarchySupportn is a leaf node or a group/folder node.
isLeafNode in interface HierarchySupportcontext - The current write context.n - The node to test.
true iff n is a leaf node, false if it's
a group or folder node.
public NodeList getChildren(GraphMLWriteContext context,
Node parent)
HierarchySupportIf n is not a group node, the result is undefined.
getChildren in interface HierarchySupportcontext - The current write context.parent - The node to query.
n.public Node getRoot(GraphMLWriteContext context)
HierarchySupportThis may be null depending on the actual implementation and therefore
should be used only as a handle for further queries on the hierarchy.
getRoot in interface HierarchySupportcontext - The current write context.
public Node getParent(GraphMLWriteContext context,
Node n)
HierarchySupportn.
The result is guaranteed to be either group or folder node, or the
root of the hierarchy as returned by HierarchySupport.getRoot(GraphMLWriteContext)
getParent in interface HierarchySupportcontext - The current write context.n - The node to query.
n.
public Node getNearestCommonAncestor(GraphMLWriteContext context,
Node node,
Node node1)
HierarchySupportn and n1.
This method always returns parent nodes of n and n1, even
if n is a child of n1 or the other way round.
getNearestCommonAncestor in interface HierarchySupportcontext - The current write context.node - The first node.node1 - The second node.
n and n1.
public EdgeList getSubgraphEdges(GraphMLWriteContext context,
Graph g)
HierarchySupportg.
getSubgraphEdges in interface HierarchySupportcontext - The current write context.g - The graph object to query.
g.
public Graph getSubgraph(GraphMLWriteContext context,
Node n)
HierarchySupportn.
This instance is only meaningful for containment queries like Graph.contains(y.base.Node) and
should not be used by code outside the core writing process.
getSubgraph in interface HierarchySupportcontext - The current write context.n - The node to query.
n.
public Node getSourceNode(GraphMLWriteContext context,
Edge edge)
HierarchySupportedge.
In case of folder nodes, this is the real source node.
getSourceNode in interface HierarchySupportcontext - The current write context.edge - The edge to test.
edge.
public Node getTargetNode(GraphMLWriteContext context,
Edge edge)
HierarchySupportedge.
In case of folder nodes, this is the real target node.
getTargetNode in interface HierarchySupportcontext - The current write context.edge - The edge to test.
edge.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||