通信图
创建通信图
要创建通信图:
- 选择一个元素,其中新通信图将被包含.
- 在菜单栏选择 Model | Add Diagram | Communication Diagram 或在上下文菜单选择 Add Diagram | Communication Diagram .
另请参见
UML 通信图 - 更多有关 UML 通信图.
你可以显示或隐藏消息的序号. 要显示或隐藏消息的序号:
- 检查 顺序图 or 通信图 的
showSequenceNumber
属性是否选中.
生命线
要创建生命线:
- 在 工具栏 选择 Lifeline.
- 图上拖放控制生命线大小.
通过拖放从一个分类 (类、接口等) 创建生命线:
- 从 Explorer 拖动一个分类.
- 放在图上.
可以在已选取的生命线上通过双击或按Enter
使用 快速编辑 .
-
Lifeline Expression : 编辑生命线表达式.
生命线表达式语法
lifeline ::= [ '<<' stereotype `>>` ] [ visibility ] name [ '[' selector ']' ] [ ':' type ] stereotype ::= (identifier) visibility ::= '+' | '#' | '-' | '~' name ::= (identifier) selector ::= (string) type ::= (identifier)
-
Visibility : 更改可见性.
-
Add Note : 增加链接注释.
-
Select Type : 选择生命线类型.
-
Create Type : 创建一个类作为生命线的类型.
-
Add Message with Lifeline : 给消息增加一个生命线.
-
Add Create Message with Lifeline :给创建消息增加一个生命线.
-
Add Self Message : 增加自关联消息.
-
Add Found Message : 增加可寻消息.
-
Add Lost Message : 增加丢失消息.
-
Add Message from Gate : 从外部增加消息(门外).
-
Add Message to Gate : 向外部增加消息(门外).
连接件
要创建连接 (或自连接件):
- 在 工具栏 选择 Connector (或 Self Connector).
- 从一个生命线拖动到另一个生命线. (若想创建自连接件,只需点击生命线.)
可以在已选取的连接件上通过双击或按Enter
使用 快速编辑 .
-
Name Expression : 编辑名称表达式.
名称表达式语法
expression ::= [ '<<' stereotype `>>` ] [ visibility ] name stereotype ::= (identifier) visibility ::= '+' | '#' | '-' | '~' name ::= (identifier)
-
Visibility : 更改可见性.
-
Navigability : 更改方向属性.
-
Add Forward Message : 在连接件上增加转发消息.
-
Add Reverse Message : 在连接件上增加逆向消息.
消息
要创建转发消息:
- 在 工具栏 选择 Forward Message.
- 点击连接件.
要创建逆向消息:
- 在 工具栏 选择 Reverse Message.
- 点击连接件.
可以使用自定义排序数字替换自动生成的整数排序数字.
- 在每个消息的
sequenceNumber
属性 输入序号. - 更改 Sequence Diagram 或 Communication Diagram 的
sequenceNumbering
属性 为custom
.
可以在已选取的消息上通过双击或按Enter
使用 快速编辑 .