Yesterday, I upgraded my Eclipse to Kepler. I needed to create a UML class diagram and decided to try out Papyrus – an Eclipse incubator project. It wasn’t as straightforward as I expected so blogging about what to do and what not to do.
I think this project needs more documentation (and a few more features) before using it seriously. Luckily, my diagram was trivial. In fact, it was so trivial, I decided to switch to PowerPoint (or in my clas – Open Office Drawing)
Regardless, here’s what I learned before giving up on it.
Creating a diagram
- File > New > Papyrus Project
- Enter project name
- Click NEXT (Do not click Finish. I was unable to use papyrus > new diagram > create new class diagram when I didn’t create one right away)
- UML
- Click next
- Enter diagram name and click “UML Class Diagram”
- Click finish
Adding a class
- Switch to the Papyrus Perspective
- Drag a “Class” node from the palette view at right
- Click the “Class 1” name once and then type the name of your class. (Do not double click the class box as it opens a hyberlink view. Do not click the class box and expect to type in it
- Drag an ‘Operation” node from the palette at right onto your class
- Click “Operation 1” and type the name of your method (Do not add an operation to the model explorer view at left as it will not show up in the diagram)
Preferences
In the Eclipse preferences, you can set a number of view preferences. They are extremely granular. For example, I wanted to hide the fourth “section” of the UML diagram showing just class name, attributes and operations. To do this, I had to:
- Preferences > Papyrus > Diagrams > PapyrusUMLClassDiagram > Class Node
- Uncheck “show compartment” in NestedClassifierComponent section
- Preferences > Papyrus > Diagrams > PapyrusUMLClassDiagram > Interface Node
- Uncheck “show compartment” in NestedClassifierComponent section
- Delete my diagram and create a new one as I could not figure out how to get preferences to take effect on an existing diagram.
What still puzzles me
There has to be a way to refresh the graphical view to sync with the model explorer and update based on workspace preferences.
Pingback: eclipse kepler (4.3) on a mac | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Hi Jeanne !
At first,thank you for your post .
Secondly , Your diagram wasn’t trivial it is very useful for a beginner.
I agree with you that this project needs more documentation.
I am reading UML specification and trying to implement those concepts using Papyrus as a modeling environment.
At first , this was very hard for me to implement those UML concepts with limited documentation plus
UML is an extremely complex language, not self-consistent and too imprecise for direct interpretation.
However, I take advantage from the following blog, it is managed by amazing guy
http://lowcoupling.com/modeling
I Hope this can help you:)
Safa
Thanks for sharing that Safa!
This page is actually great documentation: http://lowcoupling.com/post/47802411601/uml-diagrams-and-models-with-papyrus
Hi Jeanne and Safa, thank you for your very kind comments. I find this blog very interesting as well and I would be glad to collaborate.
I have recently updated the MDA page (http://lowcoupling.com/modeling) and I am working on ambitious open source framework from Project Management based on Eclipse you can find on http://www.lowcoupling.com/mdpm.
I am going to share a link to your blog in my home page among my favorite links.
Let me know if there anything I can do to help you exploiting Eclipse and the whole MDA suite
Don’t bother to try Papyrus. Such simple thing as creating a class attribute is so complicated.
Hi, we have option to reflect changes done in model explorer in graphical view. Right click your class Filters > Show Hide Contents
Select the contents added from model explorer
Is this same as rational rose? I dont see any colorful diagrams drawn from papyrus. However your tutorial was very useful for me to try papyrus for the first time. Thanks
No. Rational Rose is more powerful than Papyrus as near as I can tell.