Using Sun WorkShop

Changing and Printing Graph Displays

The commands in the Graph and Nodes menus of the two grapher windows allow you to magnify or shrink the graph; expand, collapse, show, or hide nodes; and print the graph.

Changing the Look of a Call or Class Graph

You can change the magnification and rearrange the layout of your nodes to vary your view of the graph. If you want to get a birds-eye view of a graph, you can shrink it. You can also fit the entire graph into the window.

To enlarge the graph, choose Graph > Magnify. Use the scrollbars to view the entire display or resize the window. You can incrementally enlarge the graph with the Magnify command.

To reduce the graph, choose Graph > Shrink. You can shrink the graph until it is reduced to a dot on the pane. Reset it to a readable size with the Reset Magnification command.

To see the entire graph, choose Graph > Fit to Window. The graph shrinks or enlarges to fit within the pane. If you resize the window, choosing Fit to Window will resize the graph to fit within the new size of the pane.

To reset the magnification, choose Graph > Reset Magnification. If you changed the size of the graph, use this command to reset the display to its original size. You might have to use the scrollbars to find the location of the graph in the pane.

Showing or Hiding Nodes

You can simplify a complicated graph by showing only relevant nodes and hiding the rest of the nodes in the background. You can view just nodes that have nodes connected to them, or those with connected nodes in only one direction.

Expanding Nodes

Nodes that are expandable appear with a thicker box border. Double-clicking these nodes displays the child and parent nodes (do the same thing by choosing Expand Both).

To expand nodes:

  1. Select one or more nodes by holding down the Shift key and clicking on each node.

  2. From the Nodes menu, choose one of the Expand commands, or double-click on the node to expand a single node in both directions.

Showing Nodes

To show all nodes in the database, choose Nodes > Show All.

To restore a previous node:

  1. Click the arrow button at the end of the Function or Class text box to open the history list.

  2. Click the desired function name or class name to return the node to the pane.

    Only the original nodes for the selected item are redisplayed in the pane. The relationship of the chosen node to other nodes must be reconstructed.

Hiding Nodes

To hide nodes, choose one of the following commands from the Nodes menu:

Hide Selected 

Hides the selected nodes from view. 

Hide Non-Selected 

Hides all nodes but selected nodes from view 

Hide Unconnected 

Hides all nodes that do not have connections to another node. You don't have to select a node to use this command. 

To clear all nodes from the pane, choose Nodes > Clear All.

Changing the Node Layout

You can set default options to:

To change the layout of the nodes:

  1. Choose Graph > Options.

  2. Choose from among the following:

     Graph Layout Select horizontal or vertical
     Use Arrowheads Select yes or no
     Function Names Select short or long (Call Grapher only)

  3. Click OK.

To reset the layout, choose Graph > Reset Layout. All nodes return to their original positions in the graph. You can select nodes and drag them to other positions in the pane.

To select multiple nodes in the graph, hold down the Shift key and click each additional node.

Printing a Graph

You can print the graph display from either the Call Graph or Class Graph window.

To print the graph:

  1. Choose Graph > Print to open the Print Graph dialog box.

  2. Type the number of copies and select the print parameters.

  3. Type the name of the printer or the name of a file to which to print.

  4. Click OK.