转自:http://simpleframework.net/blog/v/6295.html
工欲善其事,必先利其器。为了更清楚的表达想法,今天又沉浸多年的uml熟悉了一下,下面分享一个自己以前使用的小工具。Eclipse的UML插件:AmaterasUML
网址是:
http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasUML
操作起来很方便,虽然功能上不能和专业的UML工具相比,但是也不错了。
安装方式:
1) 先下载附件中的zip文件,官方地址: http://sourceforge.jp/projects/amateras/downloads/38882/AmaterasUML_1.3.2.zip/
2)解压zip文件,将其中的三个jar文件直接COPY到你的Eclipse安装目录/plugins 下面。
3)重启Eclipse
具体如何使用,可以参考官网:
http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasUML
AmaterasUML automaticaly parse field/methods when edit directry.
Please connect Lifeline/Activation to Instance.
Please connect same Activation.
Please hit CTRL+SPACE on message.
Please select "Window"->"Show View"->"Other"->"AmaterasUML"->"Stack Trace Sample".Then paste Java stack trace to opened view, and execute action. New stacktrace.sqd file is created on selected project/folder.
If you use Sequence API, you can create such plugin easily. This is a sample code, how to use Sequence API.
//Add net.java.amateras.umleditor plugin in your plugin dependency. //instanciate builder. SequenceModelBuilder builder = new SequenceModelBuilder(); // create instances InstanceModel start = builder.createInstance("Start"); InstanceModel next = builder.createInstance("Next"); InstanceModel last = builder.createInstance("Last"); InstanceModel instanciated = builder.createInstance("NewObject"); // ready to create message builder.init(start); // create message from Start to Next MessageModel msg = builder.createMessage("Message to Next", next); // create message from Next to Last builder.createCreationMessage("Message to Last", last); // create message from Last to Start builder.createMessage("Return to Start", start); // create self-call message on Start builder.createSelfCallMessage("Self-Call"); // back to pointer builder.back(msg); // create message from Start to Last on next to first message. builder.createMessage("Message to Last", last); // add creation message. builder.createCreationMessage("create", instanciated); // convert to xml System.out.println(builder.toXML());