|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.graph.HierarchyToDot
public class HierarchyToDot
DOT file generator for Hierarchy objects. It is used to create dot files as
an input to GraphViz tools. A dot file is created by first defining an
Hierarchy object and then using the toFile(java.lang.String)
method. Underlying
hierarchy object is cached during the constructor call and cannot be changed
afterwards.
Field Summary | |
---|---|
protected DotGenerator |
_dotGenerator
Dot generator object. |
protected Hierarchy |
_hierarchy
Cached hierarchy object. |
Constructor Summary | |
---|---|
protected |
HierarchyToDot()
|
|
HierarchyToDot(Hierarchy hierarchy,
java.util.Collection flattenSet,
boolean useElementNames)
Creates a DotGenerator object from a Hierarchy object. |
Method Summary | |
---|---|
protected java.lang.String |
_elementName(mocgraph.Element element)
Returns the name of an element if it is stored in a special way. |
static DotGenerator |
hierarchyGraphToDot(Hierarchy hierarchy)
Draw the hierarchy graph starting from this hierarchy. |
void |
toFile(java.lang.String fileName)
Creates a "dot" file from the given hierarchy. |
java.lang.String |
toString()
Creates a Dot string from the given hierarchy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Hierarchy _hierarchy
protected DotGenerator _dotGenerator
Constructor Detail |
---|
protected HierarchyToDot()
public HierarchyToDot(Hierarchy hierarchy, java.util.Collection flattenSet, boolean useElementNames)
hierarchy
- Original hierarchy from which this generator is
created. It is cached during constructor call.flattenSet
- Runs flatten on the given set of nodes and draws them
as clusters. This parameter can be left null.useElementNames
- If true, _elementName(mocgraph.Element)
method will be
used to get element names of the graph. Otherwise node/edge labels in
Graph
will be used.Method Detail |
---|
public static DotGenerator hierarchyGraphToDot(Hierarchy hierarchy)
Hierarchy.hierarchyGraph()
method.
hierarchy
- The top level hierarchy.
CyclicHierarchyException
- If hierarchy structure is found to
be cyclic. The relation causing this exception can be obtained via
a method in CyclicHierarchyException
.Hierarchy.hierarchyGraph()
,
DotGenerator
public void toFile(java.lang.String fileName) throws java.io.IOException
fileName
- Name of the dot file to be created. A ".dot" extension
will be appended to this name.
java.io.IOException
- If file cannot be created.public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String _elementName(mocgraph.Element element)
element
- An element (node or an edge) included in the backing
graph of the hierarchy.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |