public class DotUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DOT_EXE |
| Constructor and Description |
|---|
DotUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkDot()
Verify if dot can be started and print out the version to stdout.
|
static void |
renderGraph(java.io.File dotfile,
java.io.File resultfile)
Call graphviz-dot to convert the .dot-file to a rendered graph.
|
static void |
setDotExe(java.lang.String dotExe)
Allows to define where the exe-file for dot can be found.
|
static void |
writeFooter(java.io.Writer writer)
Closes the graph-markup with the necessary closing statements.
|
static void |
writeHeader(java.io.Writer writer,
int dpi,
java.lang.String rankdir,
java.lang.String id,
java.util.List<java.lang.String> attribLines)
Write the header structure.
|
static void |
writeln(java.io.Writer writer,
java.lang.String string)
Write out the string and a newline
|
static void |
writeln(java.io.Writer writer,
java.lang.String string,
int indentLevel)
Write out the string and a newline, appending a number of tabs to
properly indent the resulting text-file.
|
public static void writeln(java.io.Writer writer,
java.lang.String string)
throws java.io.IOException
writer - The writer for the .dot-filestring - The text to writejava.io.IOException - if writing to the Writer failspublic static void writeln(java.io.Writer writer,
java.lang.String string,
int indentLevel)
throws java.io.IOException
writer - The writer for the .dot-filestring - The text to writeindentLevel - How much to indent the linejava.io.IOException - if writing to the Writer failspublic static void writeHeader(java.io.Writer writer,
int dpi,
java.lang.String rankdir,
java.lang.String id,
java.util.List<java.lang.String> attribLines)
throws java.io.IOException
writer - A writer where the header is written to.dpi - The resulting resolution, can be 0 for using the default DPI-setting of dotrankdir - The direction of the graph, can be nullid - The id of the graph, cannot be null, needs to start with a alphabetical character, can contain numbers, alphabetic characters and underscore only.attribLines - Additional attributes, can be nulljava.io.IOException - if writing to the Writer failspublic static void writeFooter(java.io.Writer writer)
throws java.io.IOException
writer - A writer where the footer is written to.java.io.IOException - if writing to the Writer failspublic static void renderGraph(java.io.File dotfile,
java.io.File resultfile)
throws java.io.IOException
dotfile - The dot File used for the graph generationresultfile - The File to which should be writtenjava.io.IOException - if writing the resulting graph fails or other I/O
problems occurpublic static boolean checkDot()
throws java.io.IOException
java.io.IOException - If running dot fails.public static void setDotExe(java.lang.String dotExe)
dotExe - The full pathname of the dot-executable.