用代码画流程图和时序图快餐教程(3) - PlantUML画时序图
2016-06-02 18:33
861 查看
PlantUML画时序图
用描述性的语言来写UML,尤其是Sequence Diagram,PlantUML应该是很多同学的首选了吧。网址:
http://plantuml.com/
我们可以使用eclipse的plugin来写PlantUML,如下:
速成教程
@startuml和@enduml
这个没啥说的,开始的时候用@startuml,结束的时候要加个@enduml。标题
格式: title 标题名participant
格式:participant 类名 #颜色例:
@startuml title Android Broadcast procedure participant Activity #Lime participant ContextWrapper #Cyan @enduml
消息传递
格式:类1 -> 类2 : 消息例:
@startuml title Android Broadcast procedure participant Activity #Lime participant ContextWrapper #Cyan Activity -> ContextWrapper : registerReceiver() @enduml
自动编号
加一句话:autonumber例子
好了,快餐教程讲多了大家就烦了,所以基本够用的讲完了我们就看个例子吧:@startuml title Android Broadcast procedure participant Activity #Lime participant ContextWrapper #Cyan participant ContextImpl #Cyan participant ActivityManagerService #Cyan participant ActivityStackSupervisor #Cyan participant ActivityStack #Cyan participant ApplicationThreadProxy #Silver participant InnerReceiver #Magenta participant ReceiverDispatcher #Magenta participant BroadcastReceiver #Magenta autonumber Activity -> ContextWrapper : registerReceiver() ContextWrapper -> ContextImpl : registerReceiver() ContextImpl -> LoadedApk : getReceiverDispatcher() LoadedApk -> ActivityManagerProxy : registerReceiver() ActivityManagerProxy -> ActivityManagerService : registerReceiver() Activity -> ContextWrapper : sendBroadcast() ContextWrapper -> ContextImpl : sendBroadcast() ContextImpl -> ActivityManagerService: broadcastIntent() ActivityManagerService -> ActivityManagerService : broadcastIntentLocked() ActivityManagerService -> ActivityManagerService : collectReceiverComponents() ActivityManagerService -> ActivityManagerService : scheduleBroadcastsLocked() ActivityManagerService -> ActivityManagerService : processNextBroadcast() ActivityManagerService -> ActivityManagerService : deliverToRegisteredReceiverLocked() ActivityManagerService -> ActivityManagerService : performReceiveLocked() ActivityManagerService -> ApplicationThreadProxy : scheduleRegisteredReceiver() ApplicationThreadProxy -> InnerReceiver : performReceive() InnerReceiver -> ReceiverDispatcher : performReceive() ReceiverDispatcher -> BroadcastReceiver : onReceive() Activity -> ContextWrapper : sendOrderedBroadcast() ContextWrapper -> ContextImpl : sendOrderedBroadcast() ContextImpl -> ActivityManagerService: broadcastIntent() @enduml
显示的结果如下:
相关文章推荐
- UML类图中的六种关系
- MyEclipse Web Project转Eclipse Dynamic Web Project
- Windows Clang开发环境备忘
- 傻瓜式用Eclipse连接MySQL数据库
- Eclipse引入jquery报错如何解决
- 让Flex Builder 3.0与Eclipse3.4整合起来
- Eclipse配置Javascript开发环境图文教程
- 使用zend studio for eclipse不能激活代码提示功能的解决办法
- 图解Eclipse j2ee开发环境的搭建过程
- 两种Eclipse部署动态web项目方法
- ext for eclipse插件安装方法
- 解决Fedora14下eclipse进行android开发,ibus提示没有输入窗口的方法详解
- eclipse导入jquery包后报错的解决方法
- Eclipse 格式化代码时不换行与自动换行的实现方法
- Eclipse下jQuery文件报错出现错误提示红叉
- eclipse如何忽略js文件报错(附图)
- eclipse3.2.2 + MyEclipse5.5 + Tomcat5.5.27 配置数据库连接池
- jquery库或JS文件在eclipse下报错问题解决方法
- 什么是eclipse,eclipse的意思解析
- Zend Studio for Eclipse的java.lang.NullPointerException错误的解决方法