viernes, 7 de octubre de 2011

graphviz Ubuntu, reverse-engineer-source-code-to UML


REVERSE ENGINEER : SOURCE CODE TO UML
References: http://java.dzone.com/articles/reverse-engineer-source-code-u?page=1

S.O. Linux UBUNTU 10.04LTS

1. Download :
* UmlGraph-5.4.jar: UmlGraph binary - UmlGraph-5.4.jar (jar file containing only the UmlGraph classes; please use this only for pulling UmlGraph into other projects).

*graphviz : sudo apt-get install graphviz

2. Probe both of them:

*copy the jar into java libs:

cp UmlGraph-5.4.jar /usr/lib/jvm/java-6-sun-1.6.0.24/lib/

*and probe it:

root@silvia-desktop:/home/silvia/Escritorio# java -jar /usr/lib/jvm/java-6-sun-1.6.0.24/lib/UmlGraph-5.4.jar -private /home/silvia/Escritorio/persona.java
Loading source file /home/silvia/Escritorio/persona.java...
Constructing Javadoc information...
UMLGraph doclet version 5.4 started
Building general class diagram

*Locate the dot: which dot


root@silvia-desktop:/usr/bin# which dot
/usr/bin/dot

*and probe it:
$ dot -Tps graph1.dot -o graph1.ps

*Copy the dot to java libs:
cp /usr/bin/dot /usr/lib/jvm/java-6-sun-1.6.0.24/lib/


3. Then in eclipse Helios, go to:


1- Project-generate javadoc

2.select Doctlet option

name: org.umlgraph.doclet.UmlGraphDoc
classpath: /usr/lib/jvm/java-6-sun-1.6.0.24/lib/UmlGraph-5.4.jar

3. select the project and clic in next
Write the following line inside extra java options, to get the full class and packages

'-attributes' '-operations' '-qualify' '-types' '-visibility'

4. Click on Finish Button

Go to eclipse_path/ and open the index.html file :D you get it :D UML diagrams inside Javadoc :D



hopefully that helps to you, and Cheers:)


















.------------------------------------------------------------another steps of install
Installing graphviz on Ubuntu Lucid Lynx 10.04

If you want sfdp (a great layout for large graphs), then you need the .debs from the graphviz site (not through the ubuntu repos).

Download the develpment snapshots here
note, if you don't use the language specific bindings listed, you don't need to download those.

sudo aptitude install libdevil1c2 libgtkglext1
sudo dpkg -i graphviz_*.deb graphviz-dev*_all.deb
graphviz-doc*_all.deb libgraphviz4_*.deb libgraphviz-dev_*.deb libgv-ruby_*.deb

Now, you can run sfdp!

No hay comentarios: