UML is a graphical language; therefore, from a user's perspective at least, the most important part of a UML tool is the graphical editor. This chapter introduces the general features of the diagram editor that are available for all or most of the diagram types, then takes a detailed look at the graphical editor and explains Poseidon's most important functionalities for editing diagrams.
Creating new diagrams is the core of creating new models. After all, it is the diagrams that communicate the design. With Poseidon for UML, generating new diagrams is a very simple process.
Diagrams are considered model elements themselves; therefore, you must decide where the diagram will fit into the hierarchy of the model before you create the diagram. The Package Centric view of the Navigation pane displays the distinct hierarchy. New diagrams are created in the topmost package of this hierarchy by default, but you can also create new diagrams for a specific package. If you select a specific package and then create a new diagram, the diagram will be created within that package. If anything else is selected in the Navigation pane, the new diagram will be created in the topmost package.
There are two ways to create a new diagram. The first is through the main toolbar. Simply click one of the create diagram buttons. The new diagram will be placed in the navigation tree to the left. Where it is placed depends on what was selected in the Navigation pane prior to the creation of the new diagram. By default, new diagrams are placed in the top level of the model, which can be easily seen in the package centric view. A diagram can be created elsewhere by first selecting the package in which it should be placed, then clicking the create button.
Some diagrams are specific to certain model elements. State and Activity diagrams, for example, are used to design the details of a class or a use case. Such a diagram needs to be associated with a class or a use case. To do so, you need to select the class or use case prior creating the new state or activity diagram. Notice that this association is fixed and cannot be changed later.
New diagrams can be created in several ways:
Main Toolbar - Click the appropriate button for the corresponding diagram type.
Main Menu - Select the diagram type from the 'Create Diagram' menu in the main menu.
Quick-Key Combinations - Use these shortcuts to create a new diagram:
Class Diagram - Ctrl-L
Collaboration Diagram - Ctrl-B
Deployment / Object / Component Diagram - Ctrl-D
Sequence Diagram - Ctrl-Q
State Machine Diagram - Ctrl-T
Activity Diagram - Ctrl-Y
Use Case Diagram - Ctrl-U
Beginning with Poseidon for UML version 3.1, entire diagrams can be cloned. This is extremely useful when a diagram gets very busy or cluttered and you would like to break down the diagram into several diagrams. You can then clone the big diagram and remove (but not delete) elements that are not essential to the smaller diagram. Cloning creates new representations of all of the elements in the diagram, it does not duplicate the elements themselves.
Take, for example, a class diagram with a single class. When this diagram is cloned, there are now two representations of a single class element, each in a different diagram. If the name of the class is changed in one diagram, it is also automatically changed in the other, as well as in the navigation tree.
This should not be confused with the complete copy function, which makes a duplicate of the element itself, resulting in two separate and unconnected elements. Complete copy is only available for elements, not for entire diagrams. It is possible, however, to select all of the elements in a single diagram, complete copy them, and then paste them into a new diagram. In this case, changing the name of an element in the new diagram will not affect the element in the original diagram.
To clone a diagram:
To clone a diagram, select the diagram and then click the 'Clone Diagram' button in the toolbar. A new diagram will be created with the name 'Copy of <diagram name>'.
Cloning diagrams is not available for sequence diagrams in version 3.1. However, it is still possible to effectively clone a sequence diagram. Select the containing collaboration of the sequence diagram you would like to clone, then click the 'Copy Complete' button. Select any other diagram in the model and click the 'Paste' button. A clone of the sequence diagram will be added to the collaboration. If the model is selected when you click 'Paste', a representation copy of the entire collaboration and all of its elements and diagrams will be added to the model.