Class DotSerializer
- java.lang.Object
-
- de.uni_marburg.mdo_over.graphtools.DotSerializer
-
public class DotSerializer extends Object
Allows to generate a representation of aModelGraph
in the DOT language.- Author:
- S. John
- See Also:
- DOT language
-
-
Constructor Summary
Constructors Constructor Description DotSerializer(String basepath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
saveAsDot(ModelGraph graph, String filename)
Save the graph in a DOT file and afterwards clear the IDs used for labeling the graph elements in the DOT format.void
saveAsDot(ModelGraph graph, String filename, boolean resetIds)
/** Save the graph in a DOT file.
-
-
-
Constructor Detail
-
DotSerializer
public DotSerializer(String basepath)
-
-
Method Detail
-
saveAsDot
public void saveAsDot(ModelGraph graph, String filename, boolean resetIds) throws IOException
/** Save the graph in a DOT file. SettingresetIds
to false the IDs used for labeling the graph elements in the DOT format are kept for the next call tosaveAsDot(ModelGraph, String, boolean)
. In that case, the DOT representations of the given and the next saved graph will share the same labels for graph elements referencing the same objects. Otherwise the IDs are cleared and the labels of next graph are calculated independently.- Parameters:
graph
- a graph to save as DOT filefilename
- name of the fileresetIds
- whether to reset the IDs used for labeling graph elements or not- Throws:
IOException
- thrown if the file or any directories specified infilename
could not be accessed
-
saveAsDot
public void saveAsDot(ModelGraph graph, String filename) throws IOException
Save the graph in a DOT file and afterwards clear the IDs used for labeling the graph elements in the DOT format. The next call tosaveAsDot(ModelGraph, String, boolean)
will calculate new IDs regardless of whether or not the referenced objects of the next graph overlap with the objects of the given graph.Equivalent to a call to
saveAsDot(ModelGraph, String, true)
.- Parameters:
graph
- a graph to save as DOT filefilename
- name of the file- Throws:
IOException
- thrown if the file or any directories specified infilename
could not be accessed
-
-