* PlantUML のインストール [#e0b5759a]
- VSCode 1.11
- PlantUML 1.4.0 (VSCode plugin)
- JavaとGraphvizが必要
$ sudo apt install default-jdk-headless graphviz
* 作ることができるUML [#vca334be]
- シーケンス図 / Sequence diagram
- ユースケース図 / Usecase diagram
- クラス図 / Class diagram
- アクティビティ図 / Activity diagram
- コンポーネント図 / Component diagram
- 状態遷移図 / State diagram
- オブジェクト図 / Object diagram
#ref(plantuml_vscode.png)
* UMLの作成方法 [#l6abfcf5]
- UMLの拡張子は *.pu
#code(plain){{{
@startuml
title シーケンス図
アリス -> ボブ: リクエスト
ボブ --> アリス: レスポンス
@enduml
}}}
-プレビュー Alt+D
-画像化 [右クリック]-[Export Current Diagram]
* 各ダイアグラム [#o7a6fc74]
http://plantuml.com/ja/index
** シーケンス図 [#df7a37ff]
#code(plain){{{
@startuml
Title Sequence Diagram
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
}}}
** ユースケース図 [#v66a0d31]
#code(plain){{{
@startuml
left to right direction
skinparam packageStyle rectangle
actor customer
actor clerk
rectangle checkout {
customer -- (checkout)
(checkout) .> (payment) : include
(help) .> (checkout) : extends
(checkout) -- clerk
}
@enduml
}}}
** クラス図 [#b3578aa5]
#code(plain){{{
@startuml
class Student {
Name
}
Student "0..*" - "1..*" Course
(Student, Course) .. Enrollment
class Enrollment {
drop()
cancel()
}
@enduml
}}}
** アクティビティ図 [#u0dd6b75]
#code(plain){{{
@startuml
(*) --> "Initialization"
if "Some Test" then
-->[true] "Some Activity"
--> "Another activity"
-right-> (*)
else
->[false] "Something else"
-->[Ending process] (*)
endif
@enduml
}}}
** ステートチャート図 [#r81eb248]
#code(plain){{{
@startuml
[*] --> NotShooting
state "Not Shooting State" as NotShooting {
state "Idle mode" as Idle
state "Configuring mode" as Configuring
[*] --> Idle
Idle --> Configuring : EvConfig
Configuring --> Idle : EvConfig
}
note right of NotShooting : This is a note on a composite state
@enduml
}}}
----
[[VSCode]]