netbeans 6.1 - reverse engineer java source code to UML class diagrams - netbeans

i was using netbeans 7.1.2 and it didn't have any UML plug in capabilities and now i have had to resort to netbeans 6.1 and i already have two classes from which i would like to create UML Class diagrams but the reverse engineering option yields no results. I cannot generate any class diagrams. Does anyone know how to utilize the UML plug in to reverse engineer source code and create class diagrams.

This isn't possible anymore I think, I looked for it as well and found nothing but that was a year ago. Something might have happened since.
Check out EIDOS_UML, it's a community effort to recreate the UML capabilities I think, don't know the current status of it.

I hope you have followed the procedure correctly to generate the class diagram:
Right Click the Project (or select the specific packages or java files you want) then select Reverse Engineer option in the right click menu, this will generate model based on the selection. This is a necessary step before creating diagrams.
Then browse the model and select the package (or all the classes) for which you want Class Diagram, right click and select Create Diagram from Selected Elements...
Select diagram type (in this case "Class Diagram"), give a name and click finish.
I have tested it in both Netbeans 6.1 and 6.5, and it works fine.
Hope this solves your problem.

Related

Draw a graphical UML diagram from .uml files of Eclipse UML2

I have created MyExample.uml file through Eclipse UML2 package.
(I followed http://wiki.eclipse.org/MDT/UML2/Getting_Started_with_UML2 )
Then I got the XMI file defining UML components and relations.
Then, how can I draw a graphical UML diagram from this XMI automatically?
Disclaimer: I haven't tested this so can't confirm it works. It is documented however.
Install Papyrus.
Follow these instructions to generate a diagram.
Like you I suspect, I assumed the standard Eclipse Modelling Tools would include graphical editors. If they do I didn't find them. By installing Papyrus I was able to create uml diagrams manually; hopefully you can generate one too.
If you try this, it would be good to know if it works. Again apologies for not testing before posting, I don't have access to a suitable environment at the moment.
hth.

How to create Class Diagram in Eclipse?

I just wanted to create the class diagram of my project in Eclipse.The project is already implemented,suggest me any tool that sketch the Diagram of this project in Eclipse.
Take a look at Model Development Tools (MDT).
For reverse engineering, you can use JUPE.
ObjectAid generates classes diagram when you are simply drag and dropping classes from Project manager to the diagram.
UMLGraph creates class/activities diagrams automatically from the code and append them to javadocs.
As far as I know, both work for Java. I don't know if they support other languages.
Papyrus is the very powerful tool for hand creation of any UML and other diagrams

Magicdraw plugin for Eclipse

I want to create a sequence diagram for some Java code, using Magicdraw. I have Magicdraw Enterprise version installed.
Is there a plug-in I can install, in Eclipse, which can generate a sequence diagram from the code?
Magicdraw Enterprise has this out of the box - there is no need for Eclipse.
I don't have the tool available at the moment, but I will try to explain from memory.
You need to create a Code Engineering Set for Java.
Configure it using the tab named "Select from disk" (or something similar), and select your Java file from disk.
It should detect the class and its content and create a Code Engineering Set.
Unfold the Code Engineering Set, and your class underneath it. Nested under the class will be the different methods (here, I can't remember if it is in the right pane of the configuration menu or, after you close it, in the containment tree).
Now, if you right click on the method, you should have an option to generate the method implementation as a sequence diagram.
I hope this approximate explanation helps. If you need something more step-by-step (for instance, I assumed you know what a Code Engeneering Set is), feel free to ask.
Did you try this yet? http://jdocs.nomagic.com/190/index.html?overview-summary.html (Class: ModelElementsManager --> CreateDiagram()
Magicdraw offers a java API. It is possible to create a sequence diagram programmatically.
You might need to follow these instructions before developing: https://docs.nomagic.com/display/MD185/Development+in+Eclipse
I hope, I was able to help.

How to generate code by Papyrus on Eclipse?

I install Papyrus at here. So how to generate code using Papyrus ?
To generate the java code from UML you can follow the below steps.
New Project->EMF Project Press Next
give the project name
In Model Importer page select UML model and press Next
Select UML model which is created by using Papyrus.Press next
In Package selection page select all the root packages
click finish, it will generate genmodel.
Use the genmodel to generate Java code.
I hope this information helps.
In order to generate any text artifacts from UML models in the Eclipse Modelling Environment (i.e. Papyrus, TopCased, etc.) you should use Acceleo which is an eclipse implementation of the MOF models to text transformation language, the OMG standard language for models to text transformations.
It is a very well made technology but it could take some time to become familiar with it especially if you do not know MOF and the Model Driven Architecture.
QVT is another OMG language but its aim is models to models transformations (not models to text). It is therefore not the right answer to your question.
These can help you.
Papyrus Tutorials
Papyrus is an Eclipse lugin for modeling, you need to use additional Eclipse plugin to do model transformations. In the other answer you can find link to tutorials. First of them indicates you should use QVTo.
Resources:
http://wiki.eclipse.org/M2M/Operational_QVT_Language_%28QVTO%29
http://www.eclipse.org/m2m/qvto/doc
http://www.eclipse.org/modeling/m2m/downloads/index.php?project=qvtoml
To generate code from a UML diagram created with Papyrus must create a run configuration for Papyrus.
More information and a demo video at the following links.
http://www.papyrusuml.org/scripts/home/publigen/content/templates/show.asp?P=140&L=EN
http://www.papyrusuml.org/home/liblocal/docs/Documentation/Java-Code-Gen/Papyrus-GenJava-GenerateCode.swf
You need to install Papyrus Java Classes Generator.
Help --> install new software
work with : http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars
Check group items by category
Check show only the latest version of available software
Check Papyrus Java
Next --> accept terms and conditions
finish
Now, in your model.di : right click on your class --> Java --> Generate java code.
And you're done !
It doesn't work with Java because even if you get a code from a class diagram then this code is so dirty that it is totally unusable.
It seems that this tool has been written by modelers who have never done any java codding :-)

UML tool for reverse engineering an eclipse project

I am currently working on a project in Eclipse but the problem is that this project is very big (a lot of codes, classes, packages, etc) and undocumented. Since, the project is written in Java, my idea was to make a reverse enineering of the project to see his architecture in UML. Do you know an eclipse plugin who can complete this task very easily? Thanks for your answer !!
I think MoDisco is what you are looking for ( here for a short intro)
It seems that the question is dealing with Eclipse plugin therefore Modisco and StartUML are not a possible choice because they are either not a graphical class diagram viewwer or an Eclipse plugin.
The tools that I have evaluated and selected are:
Topcased can reverse a project and gives an UML view. The reverse is good even if not recursive. I mean that you can detect only object having their own information such as class, interface, package, method and attributes but you can not detect calls between classes because this require a recursive reverse.
eUML will give you a visual class diagrams and the possibility to navigate but no model only EMF tags inserted inside your own code. I like the visual representation of the class diagram but having EMF tags in my code is too intrusive !!
You can try RSA which is a pretty good reverse having a real UML model but you will also get EMF tag in your code
The best for me and with no doubt is EclipseUML Omondo with no tag in the code and a high quality UML model but it is really too expensive !!
I'd advise StarUML or StavrUML, the unofficial fork. It reverse engineers code compliant with Java versions before 1.6 or something. Yes, the project was abandoned years ago, but the UML editor remains incredibly strong and powerful.
However, I'd avoid using reverse engineering a UML diagram. You'll probably get an unreadable mess out if it. Just get stuck in and make it manually :)
I'm sure you can find a suitable tool for your needs if you check these.