活动标签(activity label)以冒号开始,以分号结束。

文本格式支持creole wiki语法。

活动默认安装它们定义的顺序就行连接。

@startuml
:Hello world;
:This is on defined on
several **lines**;
@enduml

开始/结束

你可以使用关键字startstop表示图示的开始和结束。

@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

条件语句

在图示中可以使用关键字ifthenelse设置分支测试。标注文字则放在括号中。

@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

重复循环

你可以使用关键字repeatrepeatwhile进行重复循环。

@startuml

start

repeat
:read data;
:generate diagrams;
repeat while (more data?) stop @enduml

while循环

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

并行处理

你可以使用关键字forkfork againend 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 使用语法的更多相关文章

  1. [Android Studio]SQLScout插件安装破解

    以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/5972138.html [Android Studio]SQLS ...

  2. Android Studio 工具插件

    1.Android Studio 翻译插件,可以将英文翻译为中文. https://github.com/Skykai521/ECTranslation 2.Android Studio之Androi ...

  3. Android项目实战(十九):Android Studio 优秀插件: Parcelable Code Generator

    Android Studio 优秀插件系列: Android Studio 优秀插件(一):GsonFormat Android Studio 优秀插件(二): Parcelable Code Gen ...

  4. Android开发实战(十八):Android Studio 优秀插件:GsonFormat

    Android Studio 优秀插件系列: Android Studio 优秀插件(一):GsonFormat Android Studio 优秀插件(二): Parcelable Code Gen ...

  5. Android Studio常用插件续

    这个月因为各种事情在忙,包括赶项目,回老家,还有准备旅游的事,所以应该写不了四篇博客了.今天介绍一下关于Android Studio 的几个好用的插件,都是我在用的,它们或能帮你节省时间,或者让你心情 ...

  6. Android Studio安装插件Genymotion

    Android Studio安装插件的方式其实和Eclipse大同小异.废话不多说,直接上图: 区域1:你当前已经安装了的插件 区域2:在线安装 区域3:从硬盘安装,即针对你已经下载好了的插件,可通过 ...

  7. Android Studio加入插件(Genymotion)

    官方模拟器的龟速已让我们无力吐槽.幸好有genymotion这款逆天的Android虚拟机,它有着高速的开启速度,良好的交互界面. 是Android开发必备的良品.甚至有些玩家已经用genymotio ...

  8. [Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系

    [Android] Android studio gradle 插件的版本号和 gradle 的版本号 的对应关系 本博客地址: wukong1688 本文原文地址:https://www.cnblo ...

  9. Android Studio 优秀插件汇总

    第一部分 插件的介绍 Google 在2013年5月的I/O开发者大会推出了基于IntelliJ IDEA java ide上的Android Studio.AndroidStudio是一个功能齐全的 ...

随机推荐

  1. 移动表格行 解决低版本IE fadeIn fadeOut 失效问题

    在维护一个内部使用的web工具的时候,需要在表格里配置参数,并且支持参数列的上下移动,有jQuery-UI工具支持对表格列的拖动,但是此处不追求效果,而且旧系统页面兼容性很差,无奈只能做上下移动的按钮 ...

  2. How to prevent SQL injection attacks?

    In our earlier tutorial on SQL Injection, one way to have prevented the SQL injection attack was by ...

  3. 我的面经(ing)

    爱立信: C和C++区别 堆和栈的区别 多态性:类的继承 重载与重复声明的区别 大端和小端的概念 一个排序程序(任意) 三次握手过程,优点 为什么UDP没有三次握手 TCP,UDP的区别 五层协议,各 ...

  4. ios数据库SQLite实现

    SQLite嵌入式数据库 1.支持时间,不需要配置,不需要安装,不需要管理员; 2.支持大部分SQL92; 3.完整的数据库保存在磁盘上面的一个文件,同一个数据库文件可以在不同机器上面使用.最大支持数 ...

  5. Simple JavaScript Inheritance--一个极简JS面向对象-类库

    面向对象 面向对象思想的几个重要特征(针对类的要求): 抽象-封装.信息隐藏(将内部实现的方法和数据隐藏, 定义开放的接口) 继承-子类可以使用父类的资源,并可以定制自己的资源, 资源包括方法和数据 ...

  6. 一个简易的dota改键助手

    那年,刚开始玩dota的时候, 发现物品栏的快捷键太不好按鸟(集中在小键盘的数字键).于是各种改键工具应运而生,像最经典的warkey, 不知不觉就用了好多年.如今,各种改键工具越来越强大了, 支持各 ...

  7. 使用ocr的自动备份还原ocr

    1.查看ocr自动备份ocrconfig -showbackup 2.停止所有节点的集群件 3.还原ocr文件ocrconfig -restore <file-name> 4.重启crs, ...

  8. adop - ERRORMSG: Since earlier patching session failed and you are invoking apply again

    $ adop phase=apply patches= hotpatch=yes *******FATAL ERROR******* PROGRAM : (/app/oracle/apps/VIS/f ...

  9. oracle数据导出工具sqluldr2

    oracle数据导出工具sqluldr2可以将数据以csv.txt等格式导出,适用于大批量数据的导出,导出速度非常快.导出后可以使用oracle loader工具将数据导入.下载完sqluldr2,工 ...

  10. java学习:Hibernate入门

    相对微软的linq-to-sql或EF框架而言,"Hibernate对于eclipse的集成开发“ 新手并不容易掌握,下面是新手上路的步骤: 一.准备工作: 1.先下载eclipse (官网 ...