LoginSignup
6
10

More than 5 years have passed since last update.

AtomでPlantUMLを利用する

Last updated at Posted at 2018-11-04

ATOMでライブプレビューしながらPlantUMLを利用できるようにしてみました。

環境

  • macOS High Sierra 10.13.6
  • ATOM 1.31.2

Atom

Atomのインストール

ATOMの公式サイトからZIPファイルをダウンロードする。
ダウンロードしたZIPファイルを解凍し、Atom.app/Applications配下に置くだけです。

Atomの設定

以下2つのプラグインをインストールする。

  • plantuml-viewer
  • language-plantuml

Graphviz

シーケンス図以外の図を描画するには、レンダリングライブラリであるGraphvizのインストールが必要です。
HomebrewでGraphvizをインストールします。

インストール手順

$ brew install graphviz
Updating Homebrew...

==> Installing dependencies for graphviz: libpng, freetype, fontconfig, jpeg, libtiff, webp and gd
==> Installing graphviz dependency: libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.35.high_sierra.bottle.tar.gz
######################################################################## 100.0%
...(中略)...
🍺  /usr/local/Cellar/gd/2.2.5: 35 files, 1.1MB
==> Installing graphviz
==> Downloading https://homebrew.bintray.com/bottles/graphviz-2.40.1.high_sierra.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring graphviz-2.40.1.high_sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/graphviz/2.40.1: 500 files, 11.2MB

インストール確認

$ dot -V
dot - graphviz version 2.40.1 (20161225.0304)

Java

PlanuUMLはJavaで動くため、Javaランタイムのインストールが必要です。

インストール手順

  1. Java SE Development Kit 8 Downloadサイトにアクセスする。
  2. Accept License Agreementにチェックをいれる。
  3. jdk-8u191-macosx-x64.dmg をダウンロードする。
  4. 手順に従ってJavaをインストールする。

インストール確認

  $ java -version
  java version "1.8.0_191"
  Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

PlantUML Viewerの起動

Command + Option + P を押し、Viewerに描画されればOK。

サンプル

sample.pu
@startuml
:Main Admin: as Admin
(Use the application) as (Use)

User -> (Start)
User --> (Use)

Admin ---> (Use)

note right of Admin : This is an example.

note right of (Use)
  A note can also
  be on several lines
end note

note "This note is connected\nto several objects." as N2
(Start) .. N2
N2 .. (Use)
@enduml

cf.) http://plantuml.com/use-case-diagram

実行結果

スクリーンショット 2018-11-04 13.02.30.png

6
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
10