「VisualStudioCode/PlantUML」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==PlantUMLのプラグイン== https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml 参考:https://gist.github.com/yoggy/bd68b3f1f55dbd742bea71424ca66564」) |
|||
(同じ利用者による、間の8版が非表示) | |||
行1: | 行1: | ||
==PlantUMLのプラグイン== | ==PlantUMLのプラグイン== | ||
− | https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml | + | *DL(https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml) |
+ | *Installボタンを押す | ||
+ | *codeエディタでクラス図を記述 | ||
+ | *code上プレビューするoption+d | ||
+ | ===クラス図=== | ||
+ | |||
+ | class.pu | ||
+ | <pre> | ||
+ | @startuml | ||
+ | class Enemy { | ||
+ | + string type | ||
+ | ~ string name | ||
+ | # void SayHello() | ||
+ | - void Attack() | ||
+ | } | ||
+ | @enduml | ||
+ | </pre> | ||
参考:https://gist.github.com/yoggy/bd68b3f1f55dbd742bea71424ca66564 | 参考:https://gist.github.com/yoggy/bd68b3f1f55dbd742bea71424ca66564 | ||
+ | |||
+ | ===クラス図関連系=== | ||
+ | |||
+ | relation.pu | ||
+ | <pre> | ||
+ | @startuml | ||
+ | Cat --|> Animal : 継承 | ||
+ | Wheel "4" --* "1" Car : コンポジション | ||
+ | Employee "many" --o "1" Company : 集約 | ||
+ | Car -- VehicleInspection : 関連 | ||
+ | UseCase ..|> IUseCase: 実現 | ||
+ | Runner ..> Marathon : 依存 | ||
+ | |||
+ | interface IUseCase | ||
+ | abstract class Human | ||
+ | @enduml | ||
+ | </pre> | ||
+ | |||
+ | 参考:https://qiita.com/opengl-8080/items/98c510b8ca060bdd2ea3 | ||
+ | |||
+ | ===コメントなど=== | ||
+ | <pre> | ||
+ | @startuml | ||
+ | title タイトルです | ||
+ | |||
+ | ' クラスAnimalの定義 | ||
+ | class Animal { | ||
+ | +int foot | ||
+ | +void call() | ||
+ | } | ||
+ | note right of Animal { | ||
+ | 基底クラス | ||
+ | } | ||
+ | |||
+ | ' クラス間の関係 | ||
+ | Cat --|> Animal : 継承 | ||
+ | @enduml | ||
+ | </pre> | ||
+ | |||
+ | ==関連== | ||
+ | [[Android/開発環境/AndroidStudio/UMLクラス図]] [ショートカット] |
2023年12月7日 (木) 09:35時点における最新版
PlantUMLのプラグイン
- DL(https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml)
- Installボタンを押す
- codeエディタでクラス図を記述
- code上プレビューするoption+d
クラス図
class.pu
@startuml class Enemy { + string type ~ string name # void SayHello() - void Attack() } @enduml
参考:https://gist.github.com/yoggy/bd68b3f1f55dbd742bea71424ca66564
クラス図関連系
relation.pu
@startuml Cat --|> Animal : 継承 Wheel "4" --* "1" Car : コンポジション Employee "many" --o "1" Company : 集約 Car -- VehicleInspection : 関連 UseCase ..|> IUseCase: 実現 Runner ..> Marathon : 依存 interface IUseCase abstract class Human @enduml
参考:https://qiita.com/opengl-8080/items/98c510b8ca060bdd2ea3
コメントなど
@startuml title タイトルです ' クラスAnimalの定義 class Animal { +int foot +void call() } note right of Animal { 基底クラス } ' クラス間の関係 Cat --|> Animal : 継承 @enduml
関連
Android/開発環境/AndroidStudio/UMLクラス図 [ショートカット]