Once we have arrived at a desired element, we may need to make some modifications. Poseidon provides several ways of changing information relating to an element.
The quickest and easiest way to change information relevant to an element is to change it directly in the diagram. Be aware, however, that not all information can be changed in this way.
At this point in the tour, the Diagram pane should be displaying the class diagram titled, 'Entity Class Model Overview' and the Details pane should be displaying information about the attribute 'number'. This diagram has been set to hide attributes and operations, so we will change to a new diagram that displays this information. Select the diagram titled, 'Member Identification: Design-Class Model' from the Navigation pane. We will now change the name of an operation from the class 'MemberIdentificationController'.
In the Diagram pane, double-click on the operation 'findMember()' in the class 'MemberIdentificationController'.The Details pane will now display information about this operation, and the text in the Diagram pane itself is now editable from a text box. Change the name of the operation to 'searchMember()' and then press return or click elsewhere in the diagram.
The name change will be propagated throughout the model, with 'MemberIdentificationController.findMember()' replaced by 'MemberIdentificationController.searchMember()' in every instance.
Another method of changing information is via the Details pane. Select the operation 'searchMember()' again. Notice that the Details pane provides lots of information about this operation. In the 'name' field, change the name from 'searchMember()' back to 'findMember()' and press return or change the focus of the window by moving the mouse out of the Details pane. The change will now be reflected back in the diagram.
Creating new elements is just as simple as modifying existing ones. And just like changing elements, there are several ways to create new ones.
Perhaps we would like to associate a discount program with members.
Let's create a new package, Discount. In the 'Package Dependencies Overview'
class diagram, click on the 'Package' button from the Diagram pane toolbar. A cross-hair
appears. Click in the Diagram pane to place the new package into the diagram.
Rename this class 'discount' using one of the methods outlined in the previous
section.
Now that we have the package, we need to associate it with the package 'member'. We could do this by creating a new association through the toolbar and connecting the association ends to the classes, or we could speed things up and use the aptly-named 'Rapid Buttons'. Click on the new package 'discount'. Several buttons appear around the edges of the package. Click and hold the mouse button down on the left rapid button. Drag the crosshair that appears onto the package 'member' and release the mouse button. An association has now been created.
Now perhaps we need to make a connection between 'discount' and a region because different discount schemes are offered in different regions.. This will require the addition of another package and another association. One rapid button can take care of everything. Select 'discount' in the diagram. Click (and this time do not hold) the mouse button on the right rapid button for the package 'discount'. An new package and an association have been added to the diagram. Rename the new package 'region'.
So after further review, we have decided that the package 'discount' is a good idea, but not for this diagram. We have further decided that the 'region' package is unnecessary and will not be used elsewhere in the model. Let's first delete 'region' completely.
Select the package 'region' in the Diagram pane. Now press the 'Del' key. A dialog box will prompt you before removing the class. Notice that the association has been deleted as well, as there is no point to an association with only one end.
The package 'discount' is a different story. We may need to use this again elsewhere, so we just want to remove it from this one diagram, not from the entire model. To remove it from this diagram, select the class in the Diagram pane. Now cut it from the diagram using either the Cut option from the main toolbar, Cut from the Edit menu, or the shortcut Ctrl-X. You will encounter a warning here as well, but it explains that the element is not deleted completely.
Notice that the element no longer appears in the Navigation pane under the class diagram. Change the Navigation pane to display the Model Index view and take a look at the packages listed there. You will see that, although it is not included in any current diagrams, the package 'discount' still exists and is ready to be used in another diagram.
Take some time now to experiment with the example. Our introductory tour through the default example Stattauto ends here. You received an impression of how the main tools are used, saw that most operations can be accomplished in more than one way, and eventually saw that there is a lot more to discover in and about Poseidon for UML. The next chapters will show you how edit a model and how to create your own model.