Since DOT is used by JDD to visualize all types of graph, we felt it would be important to give some information about the dot support in JDD.
In JDD, each package that uses DOT, has a class named XXXPrinter. For example, there exists a ZDDPrinter and a GraphPrinter.
These classes produce, among others, graphs in DOT format which is then converted to a graphic file by starting the DOT utility from a class in JDD called Dot:
Class jdd.util.Dot | ||
return type | method | parameters |
void | setType | ( int ) |
void | showDot | ( java.lang.String ) |
void | showString | ( java.lang.String, java.lang.String ) |
boolean | scaleable | |
void | setExecuteDot | ( boolean ) |
void | setRemoveDotFile | ( boolean ) |
Field | type | |
Field TYPE_EPS | public static final int jdd.util.Dot.TYPE_EPS | |
Field TYPE_PNG | public static final int jdd.util.Dot.TYPE_PNG | |
Field TYPE_DOT | public static final int jdd.util.Dot.TYPE_DOT | |
Field TYPE_FIG | public static final int jdd.util.Dot.TYPE_FIG | |
Field TYPE_GIF | public static final int jdd.util.Dot.TYPE_GIF | |
Field TYPE_JPG | public static final int jdd.util.Dot.TYPE_JPG |
It is important to know that a call to Dot.showDot(file) will remove you textual description file (here 'file') from your system! You can turn this off by the call to Dot.setRemoveDotFile(false);
You can choose from a set of possible file formats, such as EPS and JPEG. For example, Dot.setType( Dot.TYPE_TYPE_PNG) will set the output format to PNG. Furthermore, Dot.scaleable() returns true if the requested format is scalable (such as EPS).
graph ER { node [shape=box]; course; institute; student; node [shape=ellipse]; {node [label="name"] name0; name1; name2;} code; grade; number; node [shape=diamond,style=filled,color=lightgrey]; "C-I"; "S-C"; "S-I"; name0 -- course; code -- course; course -- "C-I" [label="n",len=1.00]; "C-I" -- institute [label="1",len=1.00]; institute -- name1; institute -- "S-I" [label="1",len=1.00]; "S-I" -- student [label="n",len=1.00]; student -- grade; student -- name2; student -- number; student -- "S-C" [label="m",len=1.00]; "S-C" -- course [label="n",len=1.00]; label = "\n\nEntity Relation Diagram\ndrawn by NEATO"; fontsize=20; } |
/* The command line is dot -Tps -Grankdir=LR states.dot > states.ps and the file is: */ digraph states { size="3,2"; rankdir=LR; node [shape=ellipse]; empty [label = "Empty"]; stolen [label = "Stolen"]; waiting [label = "Waiting"]; full [label = "Full"]; empty -> full [label = "return"] empty -> stolen [label = "dispatch", wt=28] stolen -> full [label = "return"]; stolen -> waiting [label = "touch"]; waiting -> full [label = "return"]; } |