diff --git a/doc/cd-oper.xml b/doc/cd-oper.xml index b58b31a..167a0f8 100644 --- a/doc/cd-oper.xml +++ b/doc/cd-oper.xml @@ -20,7 +20,7 @@ You can hide these details from the UML diagram using the javadoc @hidden tag applied to classes, methods, and fields. In theory you can also use UMLGraph to reverse engineer existing Java code. -Note however that UMLGraph is not designed for this purpose; +Note however that UMLGraph was not originally designed for this purpose; the resulting graphs may be large and unwieldy.

UMLGraph is implemented as a javadoc doclet (a program satisfying the @@ -29,15 +29,22 @@ generated by the javadoc tool). Javadoc is part of the Sun JDK, so a typical JDK installation will also include javadoc. Before running javadoc you need to place the UmlGraph.jar -file in a location accessible by javadoc -(e.g. the Java class path or the current directory). -You then run javadoc with arguments -doclet gr.spinellis.umlgraph.doclet.UmlGraph --docletpath /path/to/UmlGraph.jar -and append at the end the file(s) that contain your diagram -specification. -You can of course use any of the javadoc general options; +file in a directory that also contains the Java SDK tools.jar file. +You can accomplish this either by copying UmlGraph.jar to the SDK +lib directory where tools.jar resides, +or by copying the JDK tools.jar file into the directory +where you install UmlGraph. +You then run + +java -jar /path/to/UmlGraph.jar yourfile1.java ... + +You can use any of the javadoc general options; -private is usually needed to avoid having to explicitly specify public elements. +Example: + +java -jar /usr/jvm/java-1.5.0/lib/UmlGraph.jar -private Simple.java +

Specifying some packages before the list of source files will designate those packages as local. @@ -46,22 +53,43 @@ the SVG output UmlGraph generates will contain local hyperlinks for the local classes and hyperlinks to the Sun Java API documentation for all other classes.

-Example: - -javadoc -docletpath UmlGraph.jar -doclet gr.spinellis.umlgraph.doclet.UmlGraph -private Simple.java - javadoc will create by default a file named graph.dot -in the current directory; option to -this is a text file that can be processed by the Graphviz +in the current directory. +This is a text file that can be processed by the Graphviz dot program to layout and draw the graph. A command line like the following will convert the graph.dot file into Postscript: dot -Tps -ograph.ps graph.dot +or PNG + +dot -Tpng -ograph.png graph.dot + Refer to the dot documentation for information on creating other file formats or adjusting the UMLGraph output.

+You also can pipe the result of UMLGraph directly into dot: + +java -jar /.../UmlGraph.jar -private -output - Simple.java | dot -Tgif -ograph.gif + +In the bin directory of the UMLGraph distribution you will +find a Unix shell script and a Microsoft Windows batch file that you can +customize to invoke UmlGraph and dot through a single command. + +

+Alternatively, you can also run UMLGraph from within javadoc. +This can be useful if your IDE provides additional support for running javadoc. +In this case you run +javadoc with arguments -doclet gr.spinellis.umlgraph.doclet.UmlGraph +-docletpath /path/to/UmlGraph.jar +and append at the end the file(s) that contain your diagram +specification. +Example: + +javadoc -docletpath UmlGraph.jar -doclet gr.spinellis.umlgraph.doclet.UmlGraph -private Simple.java + +

Note that when you use dot for generating SVG diagrams your should specify the -outputencoding UTF-8 option to UMLGraph. This option will correctly render the stereotype guillemot characters