Eclipse安装PlantUML插件

新技术的诞生和更新,新工具的发现和使用是两件让人开心的事情。

还记得Visio下苦苦的画流程图的时光吗,现在一切都变得so easy,因为有PlantUML!

官网:http://plantuml.com/

这个工具可以和各种IDE集成,本文主要介绍和Eclipse的整合过程。

一、插件安装

1. 根据Eclipse的版本不同

点击Help->Install new software 或
点击Help->Software Update->Find and install

2. 在弹出的对话框中Work with选项中输入地址

http://files.idi.ntnu.no/publish/plantuml/repository/

3. 全选

4. 下载并安装

5. 重启Eclipse

 

二、安装校验

能够看到如图1的选项(小红框)说明安装成功。

 

三、使用

1. 编辑文件TestPlantUML

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml

2. 显示结果

点击Window->Show View->Other->PlantUML->PlantUML

如果看到图2,恭喜你!可以开启愉快的流程图绘制之旅了。

四、导出

在图2上右键可以导出生成的流程图保存为png等格式。

 

五、另一个绘图工具Graphviz

官网:http://www.graphviz.org/

1. 下载安装不再赘述

2. 和PlantUML的整合配置见图1中的大红框部分。

3. 使用时注意在dot的脚本起始加上PlantUML的标识符。

@startuml
digraph G {
node [peripheries=2 style=filled color="#eecc80"]
edge [color="sienna" fontcolor="green"]
main -> parse -> execute;
main -> init [arrowhead = box];
main -> cleanupi -> main;
make_string[label = once shape=parallelogram style=filled ]
execute -> make_string[label=go style=dashed arrowtail=diamond];
execute -> printf [shape=box];
init -> make_string;
main -> printf[dir=none];
execute -> compare[dir=both];
}
@enduml

 

六、show一下示例dot的产物

 

 

七、更多的PlantUML的学习参考

http://translate.plantuml.com/zh/PlantUML_Language_Reference_Guide_ZH.pdf

posted @ 2017-11-01 20:50  一沙世界  阅读(11653)  评论(0编辑  收藏  举报