在 doxygen文档中嵌入 sequence diagram (PNG格式)
来源:互联网 发布:知乎穆勒名学 编辑:程序博客网 时间:2024/06/02 14:37
今天,公司的一位牛人说,在 doxygen 中借助于mscgen工具支持在生成的文档中嵌入 sequence diagram.
自己在网上搜了一下,大体上知道了怎么用这个工具了。
1. 下载 mscgen 工具
http://www.mcternan.me.uk/mscgen/yum/fedora/15/i386/mscgen-0.20-1.fc15.i686.rpm
yum localinstall /mscgen-0.20-1.fc15.i686.rpm
上面的网址(http://www.mcternan.me.uk/mscgen)还介绍了 mscgen的语法。如下所示:
/n
is encountered, it will be interpreted as a newline, placing text below the arc as well as above it in the normal position, or expanding entity tiles onto more lines.URLWhen generating the image, colour the label in blue. If generating an image map, create an entry for the label to the specified URL. If the message sequence chart is to be embedded in Doxygen documentation, the URL maybe specified as /ref xxx
where xxx
is the name of some documented element; in this case a link to the element will automatically be made.IDAdds a superscript identifier to the label. Typically this maybe a number such that specific elements can be identified and referred to in surrounding descriptive text.IDURLSimilar to the URL attribute, but links from the ID text rather than the message label. This has the same semantics as the URL attribute, but is only of use if an arc also has an ID.arcskipThis offsets the vertical position at which an arc reaches its destination entity.linecolour, linecolorFor arcs or entities, set the line to the specified colour.textcolour, textcolorFor arcs or entities, set label text to the specified colour.textbgcolour, textbgcolorFor arcs or entities, set a colour for the text background block. Sets the fill colour for 'box', 'abox', 'rbox' and 'note' shapes.arclinecolour, arclinecolorOnly meaningful on a entity, this sets the default line colour for all arcs that originating from that entity. This can be overridden by linecolour attributes on specific arcs as desired.arctextcolour, arctextcolorOnly meaningful on a entity, this sets the default text colour for all arcs that originating from that entity. This can be overridden by textcolour attributes on specific arcs as desired.arctextbgcolour, arctextbgcolorOnly meaningful on a entity, this sets the default colour for the text background for all arc oriniationg from that entity. This can be overridden by textbgcolour attributes on specific arcs as desired. 2. 写一段测试代码如下:
/** Sender class. Can be used to send a command to the server. The receiver will acknowlegde the command by calling Ack(). /msc Sender,Receiver; Sender->Receiver [label="Command()", URL="/ref Receiver::Command()"]; Sender<-Receiver [label="Ack()", URL="/ref Ack()", ID="1"]; /endmsc */class Sender{ public: /** Acknowledgement from server */ void Ack(bool ok);};/** Receiver class. Can be used to receive and execute commands. After execution of a command, the receiver will send an acknowledgement /msc Receiver,Sender; Receiver<-Sender [label="Command()", URL="/ref Command()"]; Receiver->Sender [label="Ack()", URL="/ref Sender::Ack()", ID="1"]; /endmsc */class Receiver{ public: /** Executable a command on the server */ void Command(int commandId);};
注意,sequence diagam 部分相应的注释要在 msc block内。
运行 doxgen 后,可以看到确实生成了 sequence diagam:
- 在 doxygen文档中嵌入 sequence diagram (PNG格式)
- 在 doxygen文档中嵌入 sequence diagram (PNG格式)
- png 文档格式
- 顺序图(Sequence Diagram)
- 时序图(Sequence Diagram)
- 在网页中嵌入 Office 文档
- 在PB中嵌入Word文档
- 在文档视图中嵌入对话框
- 在RCP程序中嵌入Word文档
- 在shell 中使用嵌入文档
- 在word文档中嵌入另外的word文档
- 在IE6中使用透明格式的PNG图片
- 在ie6中使用png格式的透明图像
- UML 时序图(Sequence Diagram)
- [OOAD]----之时序图(Sequence Diagram)
- UML之时序图(Sequence Diagram)
- UML建模----时序图(Sequence diagram)
- doxygen文档工具在Eclipse中的集成
- Java Class文件解析实例
- java1.5新特性 静态导入 及如何在eclipse中方便使用
- System.columns, System.objects, System.tables
- YFMapEditor
- 好久没写了
- 在 doxygen文档中嵌入 sequence diagram (PNG格式)
- Windows下Redmine的安装步骤。
- 关于Sybase IQ空间问题
- 自己也写的小的学生管理系统
- 转:IE6终极备忘:修复IE6下 25+ Bugs
- Hibernate VS iBATIS
- 项目/产品开发---项目/产品功能范围界定
- vim功能
- Playing Poker中的话语权