Android Studio UML 插件 PlantUML 使用语法
活动标签(activity label)以冒号开始,以分号结束。
文本格式支持creole wiki语法。
活动默认安装它们定义的顺序就行连接。
@startuml
:Hello world;
:This is on defined on
several **lines**;
@enduml

开始/结束
你可以使用关键字start
和stop
表示图示的开始和结束。
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
stop
@enduml

也可以使用 end
关键字。
@startuml
start
:Hello world;
:This is on defined on
several **lines**;
end
@enduml

条件语句
在图示中可以使用关键字if
,then
和else
设置分支测试。标注文字则放在括号中。
@startuml start if (Graphviz installed?) then (yes)
:process all\ndiagrams;
else (no)
:process only
__sequence__ and __activity__ diagrams;
endif stop @enduml

也可以使用关键字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

重复循环
你可以使用关键字repeat
和repeatwhile
进行重复循环。
@startuml start repeat
:read data;
:generate diagrams;
repeat while (more data?) stop @enduml

while循环
可以使用关键字while
和end while
进行while循环。
@startuml start while (data available?)
:read data;
:generate diagrams;
endwhile stop @enduml

还可以在关键字endwhile
后添加标注,还有一种方式是使用关键字is
。
@startuml
while (check filesize ?) is (not empty)
:read file;
endwhile (empty)
:close file;
@enduml

并行处理
你可以使用关键字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

注释
文本格式支持creole wiki语法。
A note can be floating, using floating
keyword.
@startuml start
:foo1;
floating note left: This is a note
:foo2;
note right
This note is on several
//lines// and can
contain <b>HTML</b>
====
* Calling the method ""foo()"" is prohibited
end note
stop @enduml

标题和图例
你可以给图表(diagram)添加标题、标头、脚注和图例。
@startuml
title this is my title
if (condition?) then (yes)
:yes;
else (no)
:no;
note right
this is a note
end note
endif
stop legend
this is the legend
endlegend footer dummy footer
header
this is
a long __dummy__ header
end header @enduml

颜色
你可以为活动(activity)指定一种颜色。
@startuml start
:starting progress;
#HotPink:reading configuration files
These files should edited at this point!;
#AAAAAA:ending of the process; @enduml

箭头
使用->
标记,你可以给箭头添加文字或者修改箭头颜色。
It's also possible to have dotted, dashed, bold or hidden arrows.
@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

组合(grouping)
通过定义分区(partition),你可以把多个活动组合(group)在一起。
@startuml
start
partition Initialization {
:read config file;
:init internal variable;
}
partition Running {
:wait for user interaction;
:print information;
} stop
@enduml

泳道(Swimlanes)
你可以使用管道符|
来定义泳道。
还可以改变泳道的颜色。
@startuml
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
@enduml

分离(detach)
可以使用关键字detach
移除箭头。
@startuml
:start;
fork
:foo1;
:foo2;
fork again
:foo3;
detach
endfork
if (foo4) then
:foo5;
detach
endif
:foo6;
detach
:foo7;
stop
@enduml

特殊领域语言(SDL)
通过修改活动标签最后的分号分隔符(;
),可以为活动设置不同的形状。
|
<
>
/
]
}
@startuml
:Ready;
:next(o)|
:Receiving;
split
:nak(i)<
:ack(o)>
split again
:ack(i)<
:next(o)
on several line|
:i := i + 1]
:ack(o)>
split again
:err(i)<
:nak(o)>
split again
:foo/
split again
:i > 5}
stop
end split
:finish;
@enduml

一个完整的例子
@startuml start
:ClickServlet.handleRequest();
:new page;
if (Page.onSecurityCheck) then (true)
:Page.onInit();
if (isForward?) then (no)
:Process controls;
if (continue processing?) then (no)
stop
endif if (isPost?) then (yes)
:Page.onPost();
else (no)
:Page.onGet();
endif
:Page.onRender();
endif
else (false)
endif if (do redirect?) then (yes)
:redirect process;
else
if (do forward?) then (yes)
:Forward request;
else (no)
:Render page template;
endif
endif stop @enduml

Android Studio UML 插件 PlantUML 使用语法的更多相关文章
- [Android Studio]SQLScout插件安装破解
以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/5972138.html [Android Studio]SQLS ...
- Android Studio 工具插件
1.Android Studio 翻译插件,可以将英文翻译为中文. https://github.com/Skykai521/ECTranslation 2.Android Studio之Androi ...
- Android项目实战(十九):Android Studio 优秀插件: Parcelable Code Generator
Android Studio 优秀插件系列: Android Studio 优秀插件(一):GsonFormat Android Studio 优秀插件(二): Parcelable Code Gen ...
- Android开发实战(十八):Android Studio 优秀插件:GsonFormat
Android Studio 优秀插件系列: Android Studio 优秀插件(一):GsonFormat Android Studio 优秀插件(二): Parcelable Code Gen ...
- Android Studio常用插件续
这个月因为各种事情在忙,包括赶项目,回老家,还有准备旅游的事,所以应该写不了四篇博客了.今天介绍一下关于Android Studio 的几个好用的插件,都是我在用的,它们或能帮你节省时间,或者让你心情 ...
- Android Studio安装插件Genymotion
Android Studio安装插件的方式其实和Eclipse大同小异.废话不多说,直接上图: 区域1:你当前已经安装了的插件 区域2:在线安装 区域3:从硬盘安装,即针对你已经下载好了的插件,可通过 ...
- Android Studio加入插件(Genymotion)
官方模拟器的龟速已让我们无力吐槽.幸好有genymotion这款逆天的Android虚拟机,它有着高速的开启速度,良好的交互界面. 是Android开发必备的良品.甚至有些玩家已经用genymotio ...
- [Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系
[Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系 本博客地址: wukong1688 本文原文地址:https://www.cnblo ...
- Android Studio 优秀插件汇总
第一部分 插件的介绍 Google 在2013年5月的I/O开发者大会推出了基于IntelliJ IDEA java ide上的Android Studio.AndroidStudio是一个功能齐全的 ...
随机推荐
- HTML中的图像
格式: 1.JPEG:文件品质高,内存大,文件大小为GIF的1/4,色彩丰富 2.PNG:内存最小,图像不失真,支持透明度设置 3.GIF:适合显示色调不连续或具有大面积单一颜色的图像,比如导航条.按 ...
- JAVA 打出jar包
1.eclipse下导出 jar包:选择项目右键--->Export...----> 选择java下的JAR file---->next--->选择存入路径--->nex ...
- mysql重点--执行计划
explain SQL: 在sql语句前面加explain实现"执行计划"的功能.功能是比较准确的显示将要执行这条sql语句的运行状况. select_simple 是查询类型:t ...
- 整理常用的iOS第三方资源
一:第三方插件 1:基于响应式编程思想的oc 地址:https://github.com/ReactiveCocoa/ReactiveCocoa 2:hud提示框 地址:https://github. ...
- perl基础
perl比较好的博客:http://www.cnblogs.com/cosiray/archive/2012/03/18/2404371.html 以分析一个简单的pm文件为例 # # オプションの取 ...
- Eclipse设置自动换行
Eclipse 使用系统内置的“ Text Editor ”做为文本编辑器,这个文本编辑器有一个问题,就是文本无法换行.这个问题在显示上给人们带来不少麻烦. 终于有人忍不住开发了一个扩展插件 Word ...
- jq选中问题
var objs = $("div[id^='offer_details_']"); //遍历点击事件监听问题 onclick="details("+offer ...
- svg学习(七)polygon
<polygon> 标签用来创建含有不少于三个边的图形. <?xml version="1.0" standalone="no"?> & ...
- [学习Vulkan之一] 初识Vulkan
Vulkan是Khronos组织制定的"下一代"开放的图形显示API,是与DirectX12可以匹敌的GPU API标准.Vulkan是基于AMD的Mantle API演化而来,目 ...
- composer--------------今天遇到几个奇葩问题,记录一下
1.就是composer跟xdebug有冲突,每次用composer命令的时候都要报xdebug的错误,其实这个只要你去php的配置文件里面将xdebug注释掉就可以了,但是我注释掉了以后还是不行.找 ...