UMLGraph allows the declarative specification and drawing of UML class and sequence diagrams.
UMLGraph is an open-source system that allows the declarative specification and drawing of UML class and sequence diagrams.
One specifies a class diagram using the Java syntax complemented by javadoc tags. Running the UmlGraph doclet on the specification will generate a Graphviz diagram specification that can be automatically processed to create Postscript, GIF, SVG, JPEG, fig, or Framemaker drawings.
The following is an example of a class diagram specification and the resulting UML diagram:
class Person {
String Name;
}
class Employee extends Person {}
class Client extends Person {}
Sequence diagrams are specified using pic macros to define objects and method invocations. The GNU plotutils pic2plot program can then process the sequence diagram to create a PNG, PNM, (pseudo)GIF, SVG, AI, Postscript, CGM, FIG, PCL, HPGL, Regis, or TEK drawing.
The following is an example of a sequence diagram specification and the resulting UML diagram:
# Define the objects
object(O,"o:Toolkit");
placeholder_object(P);
step();
# Activation and messages
active(O);
message(O,O,"callbackLoop()");
create_message(O,P,"p:Peer");
message(O,P,"handleExpose()");
active(P);
return_message(P,O,"");
inactive(P);
destroy_message(O,P);
inactive(O);
# Complete the lifeline of O
step();
complete(O);
More information on UMLGraph can be found on the the project's web page. The project's source code is hosted on GitHub.