Using the Class Grapher, you can graphically inspect the inheritance structure of classes in C++ programs.
The Class Graph window provides a graphic representation of class hierarchies. Figure 3-6 shows the Class Graph window.
To change the colors used for node background, graph pane background, node border, node text, and arrows between nodes in the Class Graph window, edit the WORKSHOP resource file (see "Call Graph and Class Graph Window Colors"). Any color changes you make apply to both the Class Graphi and Call Graph windows (see "Call Graph Window").
Graph menu |
Provides commands for modifying the graph of the class hierarchies. |
Nodes menu |
Provides commands for modifying the nodes displayed. |
Class text box |
Allows you to enter the class you want to graph. Click the arrow at the end of the Class text box to access the list of classes previously graphed. |
Add button |
Adds a node with the given class to the Class Graph pane. |
Find button |
Moves the ClassGraph pane to show the node for the given class. |
Class Graph pane |
Displays a graphical presentation of class hierarchies. |
Expand Left button |
Shows all parent classes of the selected class (one level of parents). |
Expand Right button |
Shows all child classes of the selected class (one level of children). |
Expand Both button |
Shows all parent and child classes of the selected class (one level of parents and children). |
Collapse Left button |
Hides all parent classes of the selected class (one level of parents). |
Collapse Right button |
Hides all child classes of the selected class (one level of children). |
Collapse Both button |
Hides all parent and child classes of the selected class (one level of parents and children). |
Show Source button |
Displays the source file containing the selected class in an editor window. Sun WorkShop starts an editor if one is not presently open. |
Message footer |
Reports the number of nodes displayed, the number of nodes added, and the number of nodes not displayed, as well as error messages. |
To graph a class hierarchy:
Choose Browse > Graph Classes, or select a class in the source code or Debugging window and choose Browse > Graph Classes.
Type a class name in the Class text box and click Add Current Class or press Return.
To display information about a class:
Click a node to select it.
Click one of the buttons below the Class Graph pane to display the information you want. The footer of the window displays the number of nodes added and the number of nodes displayed out of the number that exist for the current function.
From the Nodes menu, choose commands for other viewing options such as showing, hiding, expanding, or collapsing nodes (see "Showing or Hiding Nodes").
Select a node and click Show Source to view the source in the editor window.
You can change the display of the Class Graph window using the commands on the Graph menu (see "Changing the Look of a Call or Class Graph"). You can also print the class graph, as described in "Printing a Graph".