eclipseのUMLプラグインのインストールと使用

9155 ワード

1.据え付け
eclipseはオープンソースです。持参機能を安心して使え!!(
1.1先にGEFを取り付ける
help-->Install New Software-->heliosを入力して、http://download.eclipse.org/releases/helios eclipse的UML插件安装及使用_第1张图片
1.2 AmaterasUMLをインストールする
help-->Install New Software->Amaterasを入力して、http://takezoe.github.io/amateras-update-site eclipse的UML插件安装及使用_第2张图片はインストールが完了するのを待って、再起動すればいいです。
1.3 PlantUMLのインストール
Help-->Install new software->入力PlantUML-http://plantuml.sourceforge.net/updatesite/ 次のような画面があります。eclipse的UML插件安装及使用_第3张图片 next-->アカウントのパスワードを入力したい時はキャンセルすればいいです。インストールが完了したら、PlantUMLが見えないなら、Quick Accessで直接検索できます。そしてダブルクリックして開きます。!在这里插入图片描述次にtxtファイルを作成します。コードを入力すると、対応する図が現れます。
2.クラス図を生成する(class diagram)
File-->new-->otherは、生成するものを選択します。eclipse的UML插件安装及使用_第4张图片は、その後、cldファイルを入手し、工事中のカバンの中のjavaファイルをドラッグして結果を見ることができます。
3.活動図を生成する(activity diagram)
3.1基本文法
3.1.1開始終了
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
stop
@enduml
eclipse的UML插件安装及使用_第5张图片は、endキーを使用してもよい。
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
end
@enduml
eclipse的UML插件安装及使用_第6张图片
3.1.2条件文
if then else
@startuml
start
if (Graphviz installed?) then (yes)
  :process all
diagrams; else (no) :process only __sequence__ and __activity__ diagrams; endif stop @enduml
eclipse的UML插件安装及使用_第7张图片
elseif
@startuml
start
if (condition A) then (yes)
  :Text 1;
elseif (condition B) then (yes)
  :Text 2;
  stop
elseif (condition C) then (yes)
  :Text 3;
elseif (condition D) then (yes)
  :Text 4;
else (nothing)
  :Text else;
endif
stop
@enduml
eclipse的UML插件安装及使用_第8张图片
3.1.3循環構造
繰り返しループ
キーワードrepeatとrepeawhileを使って反復サイクルができます。
@startuml
start
repeat
  :read data;
  :generate diagrams;
repeat while (more data?)
stop
@enduml
eclipse的UML插件安装及使用_第9张图片
whileサイクル
@startuml
start
while (data available?)
  :read data;
  :generate diagrams;
endwhile
stop
@enduml
eclipse的UML插件安装及使用_第10张图片
3.1.4並列処理
fork,fork again,end forkは並列処理を表します。
@startuml
start
if (multiprocessor?) then (yes)
  fork
	:Treatment 1;
  fork again
	:Treatment 2;
  end fork
else (monoproc)
  :Treatment 1;
  :Treatment 2;
endif
@enduml
eclipse的UML插件安装及使用_第11张图片
3.1.5コメント
@startuml

start
:foo1;
floating note left: This is a note
:foo2;
note right
  This note is on several
  //lines// and can
  contain HTML
  ====
  * Calling the method ""foo()"" is prohibited
end note
stop

@enduml
eclipse的UML插件安装及使用_第12张图片
3.1.6色
@startuml

start
:starting progress;
#HotPink:reading configuration files
These files should edited at this point!;
#AAAAAA:ending of the process;

@enduml
eclipse的UML插件安装及使用_第13张图片
3.1.7矢印
マークを使用すると、矢印にテキストを追加したり、矢印の色を変更したりできます。また、ドット状、棒状、太字、または隠し矢印を選択することもできます。
@startuml
:foo1;
-> You can put text on arrows;
if (test) then
  -[#blue]->
  :foo2;
  -[#green,dashed]-> The text can
  also be on several lines
  and **very** long...;
  :foo3;
else
  -[#black,dotted]->
  :foo4;
endif
-[#gray,bold]->
:foo5;
@enduml
eclipse的UML插件安装及使用_第14张图片
3.1.8グループ(grouping)
パーティションを定義することで、複数の活動を組み合わせることができます。
@startuml
start
partition Initialization {
	:read config file;
	:init internal variable;
}
partition Running {
	:wait for user interaction;
	:print information;
}

stop
@enduml
eclipse的UML插件安装及使用_第15张图片
3.1.9コース(swimlans)
パイプを使ってコースを定義したり、コースの色を変えることができます。
@startuml
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
@enduml
eclipse的UML插件安装及使用_第16张图片
3.1.10分離(detach)
矢印はdetachで削除できます。
@startuml
 :start;
 fork
   :foo1;
   :foo2;
 fork again
   :foo3;
   detach
 endfork
 if (foo4) then
   :foo5;
   detach
 endif
 :foo6;
 detach
 :foo7;
 stop
@enduml
eclipse的UML插件安装及使用_第17张图片
4.判例図を生成する(usecase diagram)