17 static final Sys.ExternalProgram DOT =
24 "/opt/homebrew/bin/dot"+
37 File out=
new File(dotfile.getPath()+
"."+format);
38 String command=DOT.getPath()+
" -T"+format+
" "+dotfile.getPath()+
" -o "+out;
42 ProcessBuilder pb =
new ProcessBuilder
43 (DOT.getPath(),
"-T" + format,dotfile.getPath(),
"-o",out.getPath());
44 Process dot=pb.start();
46 if (dot.waitFor()!=0) {
47 System.err.println(
"ERROR: '"+command+
"' failed");
50 catch (IOException e) {
51 System.err.println(
"ERROR: "+e.getMessage());
54 catch (InterruptedException e) {
55 System.err.println(
"ERROR: "+e.getMessage());
Simple viewer for Graphvizable.
static DotViewer displayWindow(Graphvizable object, String caption)
create new DotViewer (toplevel window) and display object
Use GraphViz to render graph structures.
DotViewer display(String dotCode)
Render and display dotCode.
File renderDotFileToFile(File dotfile, String format)
Render dot file.
void displayAsPDF(String dotCode)
Render and display dotCode.
void displayAsPDF(Graphvizable object)
Display object.
DotViewer display(Graphvizable object)
Display object.
System related utilities.
static File writeToTempFile(String text, String suffix)
write text to temporary file
static void viewPDFFile(String filename)
open PDF viewer
Interface for GraphViz rendering.