OSDN Git Service

Regular updates
[twpd/master.git] / plantuml.md
1 ---
2 title: PlantUML
3 layout: 2017/sheet
4 ---
5
6 ### About
7 {: .-intro}
8
9 PlantUML is a markup language for creating diagrams.
10
11 - <https://plantuml.com/>
12
13 ### Format
14
15     @startuml
16     Car : drive()
17     Dog : bark()
18     @enduml
19
20     # plantuml file.uml && open file.png
21
22 ## Classes
23
24  * http://plantuml.sourceforge.net/classes.html
25
26 ### Methods
27
28     Car : drive()
29
30 ### Methods (alt)
31
32     class Car {
33       String make
34       year : Integer
35       void drive()
36
37       -private()
38       #protected()
39       ~package private()
40       +public()
41
42       {static} String id
43       {abstract} void methods()
44     }
45
46 ### Lines
47
48     class Car {
49       These are separated by lines.
50       The next line is a dotted line
51       ..
52       Next is a double-stroke
53       ==
54       Next is a plain line
55       --
56       Next is a strong line
57       __
58       You can make headers with it
59       .. header ..
60     }
61
62 ### Associations
63
64     Car <|-- SmallCar      # extension
65     Car *-- Engine         # composition
66     Cars o-- Car           # aggregation
67     Car <|.. SmallCar      # dotted line (use .. instead of --)
68     Car <|--* Car
69
70     -left->
71     -right->
72
73 ### Relations
74
75     Driver - Car : drives >
76     Car -- Owner : < owns
77     Car *-- Wheel : has 4 >
78
79 ### Notes
80
81     class Car {
82     }
83     note left: Something something
84
85     note top of Car : This is a car.
86
87 ### Namespaces
88
89     namespace Client {
90       class Driver {
91       }
92     }
93
94     Car -- Client.Driver : owns >
95
96
97 ## Activities
98
99     (*) --> "First Activity"
100     -->[You can put also labels] "Second Activity"
101     --> (*)
102