由於學習java做課程作業需要花類的uml圖,上網搜了很多方法。這是安裝Green這個外掛程式的方法。
有時候希望把我們寫好的類產生一個UML圖,是代碼看上去更清晰,於是就找了下在eclipse下自動產生java類的UML圖的外掛程式,找了很多,發現了Green UML這麼一個外掛程式,很好用,下面是外掛程式安裝方法:
1.到http://green.sourceforge.net/builds.html頁面尋找對應自己Eclipse版本的GEF版本和Green UML版本
首先看最後列eclipse版本找到相應version列Green UML版本,點擊Version列裡面版本後進入到Green UML相應版本下載頁面。下載下來後解壓,把plugins目錄下的所有東西拷貝到Eclipse安裝目錄下的plugins目錄下,當然如果你不想和eclipse下的plugins混在一塊,你可以單獨出來用links目錄配置eclipse外掛程式,具體方法網上一大堆,很easy。
2.到http://www.eclipse.org/gef/downloads.php下載表格中GET version列對應的GEF版本,下載後我直接解壓了,然後把其中的plugins目錄的所有東西拷貝到Eclipse安裝目錄下的plugins目錄下,如上所說,也可以單獨配置。
安裝好後,重啟eclipse,可以發現右鍵點擊某個java類後,在出現的菜單中有一項Green UML,點擊下面的子功能表就可以幫我們產生這個類的UML圖
當然,我們也可以右鍵點擊包產生整個包下類的UML,其中各個類的關聯都可以幫我們展現出來,很好很方便
補充:現在Green軟體不支援下載更下版本了,只支援在eclipse中用輸入網站的方式安裝,官網上市這麼說的:
green will now be distributed via update site instead of direct download. The latest build of green can be found at the following update site:
http://www.cse.buffalo.edu/faculty/alphonce/green
To install or update green, go to Help->Install New Software... Type in (or copy/paste) the above site URL and click Add. After the update site has been added, you can install from that same dialog.
Green的使用方法http://wenku.baidu.com/view/7ec0b519ff00bed5b9f31d1b.html
摘要:
Create a New Diagram
Important Note: Green UML will not work with classes in the default package! In practice, this is not really a restriction because you should always put all of your classes in packages and never have code in the default package.
Create a New Blank Diagram
In the Package Explorer, right-click anywhere in the desired project and select
"New/Other/Green UML Class Diagram"
Create a New Diagram from an Existing Class or Interface -- creates a new class diagram with
New class diagram with only one class/interface in it:
Right-click the class or interface in the Package Explorer and select "Green UML/Add to New Class Diagram"
New class diagram with the specified class/interface and its immediate
superclass: Right-click the class or interface in the Package Explorer and select "Green UML/Incrementally Explore in New Class Diagram" Green UML will create an XXX.grn file in the root of the src folder (the default package location). To rename a class diagram, highlight it's *.grnfile and go to the Eclipse main menu and select File/Rename or hit the F2
安裝完成後如下: