|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.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 n1 and n2 . |
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)
HierarchySupport
n
is a leaf node or a group/folder node.
isLeafNode
in interface HierarchySupport
context
- 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)
HierarchySupport
If n
is not a group node, the result is undefined.
getChildren
in interface HierarchySupport
context
- The current write context.parent
- The node to query.
n
.public Node getRoot(GraphMLWriteContext context)
HierarchySupport
This 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 HierarchySupport
context
- The current write context.
public Node getParent(GraphMLWriteContext context, Node n)
HierarchySupport
n
.
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 HierarchySupport
context
- The current write context.n
- The node to query.
n
.public Node getNearestCommonAncestor(GraphMLWriteContext context, Node node, Node node1)
HierarchySupport
n1
and n2
.
This method always returns parent nodes of n1
and n2
, even
if n1
is a child of n2
or the other way round.
getNearestCommonAncestor
in interface HierarchySupport
context
- The current write context.node
- The first node.node1
- The second node.
n1
and n2
.public EdgeList getSubgraphEdges(GraphMLWriteContext context, Graph g)
HierarchySupport
g
.
getSubgraphEdges
in interface HierarchySupport
context
- The current write context.g
- The graph object to query.
g
.public Graph getSubgraph(GraphMLWriteContext context, Node n)
HierarchySupport
n
.
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 HierarchySupport
context
- The current write context.n
- The node to query.
n
.public Node getSourceNode(GraphMLWriteContext context, Edge edge)
HierarchySupport
edge
.
In case of folder nodes, this is the real source node.
getSourceNode
in interface HierarchySupport
context
- The current write context.edge
- The edge to test.
edge
.public Node getTargetNode(GraphMLWriteContext context, Edge edge)
HierarchySupport
edge
.
In case of folder nodes, this is the real target node.
getTargetNode
in interface HierarchySupport
context
- The current write context.edge
- The edge to test.
edge
.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |