Java Reference
In-Depth Information
The three classes will be added to the diagram (as rectangles). The lines connecting the rectangles indicate
“has a” or composition relationships between the classes (see Figure 3-17 ).
Figure 3-17.
Tutorial: Modifying UML Diagrams with RAD
Any of the diagram components (lines, rectangles, etc.) can be repositioned by clicking and dragging. Notice also
that there is more information in each rectangle than we have shown in earlier diagrams. UML diagrams are
much more extensive than you have been led to believe. As an example, we will add the Frame class to show a
superclass-subclass (i.e., “is a”) relationship and the Label class. Then we will simplify the class diagram by hiding
some of the information and edit the diagram to make it more understandable.
1.
In the Package Explorer, expand the JRE System Library, then rt.jar, and java.awt.
2.
Scroll down the java.awt subtree and add Frame.class and Label.class to the diagram.
Of course, this makes the diagram so large it cannot all be displayed in the content window, so we will hide this
detailed information.
3.
On any blank area of the diagram, right-click to display the shortcut menu and choose
Select, then All Shapes.
This will select all the class rectangles in the diagram.
In the command bar, click Diagram , Filters , Show/Hide Compartment , and then
Name Compartment Only .
4.
The class rectangles will only contain the class name (and are therefore much smaller). However, the diagram is
still spread over the same area as earlier and cannot be viewed in its entirety.
5.
Right-click on any class's name text and select Format, Arrange, then All.
 
Search WWH ::




Custom Search