分享一个Eclipse的UML插件-AmaterasUML

转自: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

 

  • Please select "File"->"New"->"Other"->"AmaterasUML"->"Class diagram". Then class diagram file (*.cld) was created.
  • Opened Class diagam editor, and you can edit diagram using pallete. Then fields/methods can add from a context menu.
  • Some properties (ex class name) are edit directry in diagram. but some property(is abstract class or concrete class) are edit only property view.
  • If you want import/export Java, choose "Java" from a context menu.

AmaterasUML automaticaly parse field/methods when edit directry.

  • edit directy
  • parse your input
  • Please select "File"->"New"->"Other"->"AmaterasUML"->"Class diagram". Then class diagram file (*.sqd) was created.
  • Opened Sequence diagram editor, and you can edit diagram using pallete.
  • If you want add a Message, choose "Message". Then select source "Lifeline" or "Activation" and target "Lifeline" or "Activation"
  • If you want add a Creation message, choose "Message". Then select source "Lifeline" or "Activation" and target "Instance" (Target instance must be none of imcoming/outgoing message)
  • If you want add a Self-call message, choose "Message". Then select source "Activation" and same "Activation" by target.
  • You can select a class of Instance. Select the instance and choose "Import and Assign Class model" from a context menu. Then you can code assist on diagram or property view. Please hit CTRL + SPACE(limitation: can't use mouse when select the proposal, and if you escape the edit on diagram, hit esc key 2 times...)

Please connect Lifeline/Activation to Instance.

分享一个Eclipse的UML插件-AmaterasUML_第1张图片

Please connect same Activation.

分享一个Eclipse的UML插件-AmaterasUML_第2张图片
分享一个Eclipse的UML插件-AmaterasUML_第3张图片

 

Please hit CTRL+SPACE on message.

分享一个Eclipse的UML插件-AmaterasUML_第4张图片

 

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.

  • paste stack trace.
分享一个Eclipse的UML插件-AmaterasUML_第5张图片
  • generated stack trace sequence diagram.

If you use Sequence API, you can create such plugin easily. This is a sample code, how to use Sequence API.

  • Sample code
//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());
  • generated sequence diagram
分享一个Eclipse的UML插件-AmaterasUML_第6张图片

 Usecase diagram editor

  • Please select "File"->"New"->"Other"->"AmaterasUML"->"Usecase diagram". Then class diagram file (*.ucd) was created.
  • Opened Usecase diagram editor, and you can edit diagram using pallete.
  • You can change the Actor image using property.
  • You can also attach any file to Usecase using property.
  • If you double click the Usecase, attached file will open in Eclipse.

 

  • Please select "File"->"New"->"Other"->"AmaterasUML"->"Activity diagram". Then class diagram file (*.acd) was created.
  • Opened Usecase diagram editor, and you can edit diagram using pallete.

你可能感兴趣的:(分享一个Eclipse的UML插件-AmaterasUML)