Package org.eclipse.gef.dot.internal
Class DotExecutableUtils
java.lang.Object
org.eclipse.gef.dot.internal.DotExecutableUtils
Class for drawing dot graphs by calling the dot executable.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
executeDot
(File dotExecutablePath, boolean invertYAxis, File dotInputFile, File outputFile, String outputFormat) Calls the Graphviz 'dot' executable with the given arguments.static String[]
getSupportedExportFormats
(String dotExecutable) static File
renderImage
(File dotExecutablePath, File dotInputFile, String format, File outputFile, String[] outputs)
-
Method Details
-
renderImage
public static File renderImage(File dotExecutablePath, File dotInputFile, String format, File outputFile, String[] outputs) - Parameters:
dotExecutablePath
- The path of the local Graphviz 'dot' executable, e.g. "C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe"dotInputFile
- The DOT content to renderformat
- The image format to export the graph to (e.g. 'pdf' or 'png')outputFile
- The output file ornull
if the input file name and location should be used (where only the file extension is changed dependent on the format)outputs
- A String array with two Strings, where the first contains the output of the input stream and the second contains the output of the error stream.- Returns:
- The image file generated by rendering the dotInputFile with Graphviz, using the specified format
-
executeDot
public static String[] executeDot(File dotExecutablePath, boolean invertYAxis, File dotInputFile, File outputFile, String outputFormat) Calls the Graphviz 'dot' executable with the given arguments.- Parameters:
dotExecutablePath
- The path of the local Graphviz 'dot' executable, e.g. "C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe"invertYAxis
- Whether to invert the y-axis or not.dotInputFile
- The input file to pass to 'dot'.outputFile
- The output file to pass to 'dot' via the -o option. May benull
.outputFormat
- The output format to pass to 'dot' via the -T option. May benull
.- Returns:
- A String array with two Strings, where the first contains the output of the input stream and the second contains the output of the error stream.
-
getSupportedExportFormats
- Parameters:
dotExecutable
- path to the dot executable- Returns:
- String array of the supported export formats
-