uml2re
Class GvDiagram

java.lang.Object
  |
  +--uml2re.GvDiagram

public class GvDiagram
extends java.lang.Object

This class is able to load a UML2 diagram from an XMI file and generate the corresponding diagrams in Graphviz format. The XMI must be 2.0 and conforming to what the Eclipse UML2 tool generates.

Version:
0.1, 04/21/2005
Author:
Marco Torchiano
See Also:
Graphviz home page, Eclipse UML2 project page

Constructor Summary
GvDiagram(java.lang.String fileName)
          Constructor from an XMI file.
 
Method Summary
 void generateClassDiagram(java.lang.String dotFileName)
          Generates a class diagram containing all the classes of the model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GvDiagram

public GvDiagram(java.lang.String fileName)
          throws java.io.IOException
Constructor from an XMI file.

Parameters:
fileName - path of the XMI file containing the model
Throws:
java.io.IOException - if anything goes wring with the file
Method Detail

generateClassDiagram

public void generateClassDiagram(java.lang.String dotFileName)
                          throws java.io.FileNotFoundException
Generates a class diagram containing all the classes of the model. The diagram is generated as a Graphviz digraph diagram. It can be rendered to an image file (e.g. jpg, png, ps) with the dot program. Be aware that if many classes are present in the model the diagram becomes easily unmanageable. TODO: implement options e.g. show/hide attributes, methods

Parameters:
dotFileName - the path of the file that will contain the diagram (.dot)
Throws:
java.io.FileNotFoundException