PlantUML工具书之三(对象图|样式调整)

对象图


1
2
3
4
@startuml
object firstObject
object "My Second Object" as o2
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
@startuml
object Object01
object Object02
object Object03
object Object04
object Object05
object Object06
object Object07
object Object08
Object01 <|-- Object02
Object03 *-- Object04
Object05 o-- "4" Object06
Object07 .. Object08 : some labels
@enduml

1
2
3
4
5
@startuml
object user
user : name = "Dummy"
user : id = 123
@enduml

1
2
3
4
5
6
@startuml
object user {
name = "Dummy"
id = 123
}
@enduml

样式


1
2
3
4
5
6
@startuml
object user {
name = "Dummy"
id = 123
}
@enduml

1
2
3
4
@startuml
scale 180*90
Bob->Alice : hello
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
@startuml
Alice -> Bob : hello --there --
... Some ~~long delay~~ ...
Bob -> Alice : ok
note left
This is **bold**
This is //italics//
This is ""monospaced""
This is --stroked --
This is __underlined__
This is ~~waved~~
end note
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
@startuml
object demo {
* Bullet list
* Second item
** Sub item
}
legend
# Numbered list
# Second item
## Sub item
## Another sub item
# Third item
end legend
@enduml

1
2
3
4
5
6
@startuml
object demo {
This is not ~___underscored__.
This is not ~""monospaced"".
}
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@startuml
database DB1 as "
You can have horizontal line
----
Or double line
====
Or strong line
____
Or dotted line
..My title..
Enjoy!
"
note right
This is working also in notes
You can also add title in all these lines
==Title==
--Another title --
end note
@enduml

1
2
3
4
5
6
7
8
9
10
11
12

@startuml
usecase UC1 as "
= Extra -large heading
Some text
== Large heading
Other text
=== Medium heading
Information
....
==== Small heading"
@enduml

1
2
3
4
5
6
7
8
9
10
@startuml
skinparam titleFontSize 14
title
Example of simple table
|= |= table |= header |
| a | table | row |
| b | table | row |
end title
[*] --> State1
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
@startuml
skinparam titleFontSize 14
title
Example of Tree
|_ First line
|_ **Bom(Model)**
|_ prop1
|_ prop2
|_ prop3
|_ Last line
end title
[*] --> State1
@enduml

1
2
3
4
5
6
7
@startuml
title: <size:20><&heart >Use of OpenIconic <&heart ></size>
class Wifi
note left
Click on <&wifi>
end note
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@startuml
skinparam monochrome true
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@startuml
skinparam monochrome true
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml

1
2
3
4
5
@startuml
!define send(a,b,c) a->b : c
send(Alice , Bob, Hello)
send(Bob, Alice , ok)
@enduml

1
2
3
4
5
6
7
8
@startuml
!define DOUBLE(x) x x
!definelong AUTHEN(x,y)
x -> y : DOUBLE(hello)
y -> x : ok
!enddefinelong
AUTHEN(Bob,Alice)
@enduml