PlantUML

PlantUML est un outil écrit en java qui s’appuie sur [[Graphviz]] pour créer des diagrammes UML.

On peut le télécharger sur ce lien http://plantuml.sourceforge.net

son utilisation est simple: * installer graphivz (et ajouter les binaires dans le path) * pour l’install de plantuml

java -jar plantuml.jar -testdot
  • créer sequenceDiagram.txt contenant
@startuml

abstract class AbstractList
abstract AbstractCollection
interface List {
 -field1
 #field2
 ~method1()
 +method2()
}
interface Collection

List <|-- AbstractList
Collection <|-- AbstractCollection

Collection <|- List
AbstractCollection <|- AbstractList
AbstractList <|-- ArrayList

ArrayList : Object[] elementData
ArrayList : size()

enum TimeUnit
TimeUnit : DAYS
TimeUnit : HOURS
TimeUnit : MINUTES

@enduml
  • et on lance
java -jar plantuml.jar -verbose sequenceDiagram.txt
  • pour garder les fichiers temporaires
java -jar plantuml.jar -keepfiles -verbose sequenceDiagram.txt

le fichier temporaire est

    digraph unix {
    nodesep=.35;
    ranksep=0.8;
    edge [fontsize=11,labelfontsize=11];
    node [fontsize=11,height=.35,width=.55];
    bgcolor="#FFFFFF";
    ratio=auto;
    compound=true;
    remincross=true;
    searchsize=500;
    cl2 [fontcolor="#000000",margin=0,fillcolor="#FEFECE",color="#A80036",style=filled,shape=box,label=<<TABLE BGCOLOR="#FEFECE" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD ALIGN="RIGHT"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\circle5856651840852288928.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="12" FACE="italic" COLOR="#000000">AbstractCollection</FONT></TD></TR></TABLE></TD></TR><TR><TD WIDTH="55"></TD></TR><TR><TD></TD></TR></TABLE>>];
    cl1 [fontcolor="#000000",margin=0,fillcolor="#FEFECE",color="#A80036",style=filled,shape=box,label=<<TABLE BGCOLOR="#FEFECE" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD ALIGN="RIGHT"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\circle5856651840852288928.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="12" FACE="italic" COLOR="#000000">AbstractList</FONT></TD></TR></TABLE></TD></TR><TR><TD WIDTH="55"></TD></TR><TR><TD></TD></TR></TABLE>>];
    cl9 [fontcolor="#000000",margin=0,fillcolor="#FEFECE",color="#A80036",style=filled,shape=box,label=<<TABLE BGCOLOR="#FEFECE" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD FIXEDSIZE="TRUE" WIDTH="27" HEIGHT="23"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\circle544599204648036918.png"/></TD><TD><FONT POINT-SIZE="12"  COLOR="#000000">ArrayList</FONT></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD
    ></TR></TABLE></TD></TR><TR><TD WIDTH="55"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD WIDTH="10"></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">Object[] elementData</FONT></TD></TR></TABLE></TD></TR><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD WIDTH="10"></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">size()</FONT></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR></TABLE></TD></TR></TABLE>>];
    cl4 [fontcolor="#000000",margin=0,fillcolor="#FEFECE",color="#A80036",style=filled,shape=box,label=<<TABLE BGCOLOR="#FEFECE" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD ALIGN="RIGHT"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\circle8094574228174251804.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="12" FACE="italic" COLOR="#000000">Collection</FONT></TD></TR></TABLE></TD></TR><TR><TD WIDTH="55"></TD></TR><TR><TD></TD></TR></TABLE>>];
    cl3 [fontcolor="#000000",margin=0,fillcolor="#FEFECE",color="#A80036",style=filled,shape=box,label=<<TABLE BGCOLOR="#FEFECE" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD FIXEDSIZE="TRUE" WIDTH="27" HEIGHT="23"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\circle8094574228174251804.png"/></TD><TD><FONT POINT-SIZE="12" FACE="italic" COLOR="#000000">List</FONT></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR></TABLE></TD></TR><TR><TD WIDTH="55"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD WIDTH="10"><IMG SRC="C:\Users\
    FRAOUS~1\AppData\Local\Temp\visi8989490476549437542.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">field1</FONT></TD><TD></TD><TD></TD><TD></TD></TR><TR><TD WIDTH="10"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\visi4567468292013807907.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">field2</FONT></TD><TD></TD><TD></TD><TD></TD></TR></TABLE></TD></TR><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD WIDTH="10"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\visi5503907509149590656.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">method1()</FONT></TD></TR><TR><TD WIDTH="10"><IMG SRC="C:\Users\FRAOUS~1\AppData\
    Local\Temp\visi7784548357979551781.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">method2()</FONT></TD></TR></TABLE></TD></TR></TABLE>>];
    cl11 [fontcolor="#000000",margin=0,fillcolor="#FEFECE",color="#A80036",style=filled,shape=box,label=<<TABLE BGCOLOR="#FEFECE" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"><TR><TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD ALIGN="RIGHT"><IMG SRC="C:\Users\FRAOUS~1\AppData\Local\Temp\circle1598435081110693830.png"/></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="12"  COLOR="#000000">TimeUnit</FONT></TD></TR></TABLE></TD></TR><TR><TD WIDTH="55"><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD WIDTH="10"></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">DAYS</FONT></TD><TD></TD></TR><TR><TD WIDTH="10"></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">HOURS</FONT></TD>&l
    t;TD></TD></TR><TR><TD WIDTH="10"></TD><TD ALIGN="LEFT"><FONT POINT-SIZE="10"  COLOR="#000000">MINUTES</FONT></TD><TD></TD></TR></TABLE></TD></TR><TR><TD></TD></TR></TABLE>>];
    cl3 -> cl1[color="#A80036",fontcolor="#000000",fontsize="10",labeldistance=1.7,labelangle=25,dir=back,arrowtail=empty,arrowhead=none,arrowsize=2];
    cl4 -> cl2[color="#A80036",fontcolor="#000000",fontsize="10",labeldistance=1.7,labelangle=25,dir=back,arrowtail=empty,arrowhead=none,arrowsize=2];
    cl4 -> cl3[color="#A80036",fontcolor="#000000",fontsize="10",labeldistance=1.7,labelangle=25,dir=back,arrowtail=empty,arrowhead=none,arrowsize=2];
    {rank=same; cl4; cl3}cl2 -> cl1[color="#A80036",fontcolor="#000000",fontsize="10",labeldistance=1.7,labelangle=25,dir=back,arrowtail=empty,arrowhead=none,arrowsize=2];
    {rank=same; cl2; cl1}cl1 -> cl9[color="#A80036",fontcolor="#000000",fontsize="10",labeldistance=1.7,labelangle=25,dir=back,arrowtail=empty,arrowhead=none,arrowsize=2];

}