Laying Out a Diagram Automatically

From RAD Studio
Jump to: navigation, search

Go Up to Customizing Diagram Appearance and Viewing Diagrams

In the Diagram View, the Layout submenu of the context menu provides commands for automatic layout. The commands of the context menu of diagrams lay out all elements of the diagram and the commands of the context menu of diagram elements lay out only the selected diagram elements.

The following Layout submenu commands can be available: Do Full Layout and Layout Selected Elements, Layout for Printing, Route All Links and Route Links, Optimize Sizes, Expand All, Collapse All, and Brief View.

To set up the diagram layout algorithm

  1. On the main menu, choose Tools > Options; the Options dialog box opens.
  2. In the left-hand pane, select the Modeling > (level) > Diagram > Layout command; the Layout page opens.
  3. In the Layout algorithm option, select the desired diagram layout algorithm. Available layout algorithms are: Standard, Hierarchical, Orthogonal, Spring Embedder, Tree, and <autoselect>. See the descriptions of these algorithms and their options in Diagram Layout options.
  4. Expand the node for the desired algorithm and specify the algorithm-specific options (if any).
  5. Click OK to apply the changes.
Result: You can observe the results of applying the selected layout algorithm after you execute one of the Do Full Layout or Layout Selected Elements commands on the diagram.
Tip: To enable the layout of the inner substructure in diagrams, select True in the Recursive layout option in the Layout page of the Options dialog box.

To lay out a diagram using the selected layout algorithm

  1. In the Diagram View, right-click the diagram background (or one of the selected elements).
  2. In the Layout submenu, click Do Full Layout (or Layout Selected Elements).
Result: The Modeling lays out all elements on the diagram (or all selected elements) according to the layout algorithm defined for the current diagram in the Layout page in the Options dialog box.

To prepare the diagram layout for printing

  1. In the Diagram View, right-click the diagram background.
  2. In the Layout submenu, click Layout for Printing.
Result: The Modeling lays out all diagram elements, optimizing the diagram for printing. The Modeling ignores the layout algorithm selected for this diagram in the Layout page. All node elements will be positioned so that each element can be printed on one page.

To optimize sizes of node elements

  1. In the Diagram View, right-click the diagram background (or one of the selected elements).
  2. In the Layout submenu, click Optimize Sizes.
Result: The Modeling enlarges or shrinks all node elements on the diagram (or all selected node elements) to the optimal sizes, leaving enough space for their labels and any sub-elements they may contain.

To show or hide compartments in node elements

  1. In the Diagram View, right-click the background (or right-click one of the selected elements). The context menu containing the Layout submenu opens.
  2. In the Layout submenu, set the check mark before the Brief View menu item.
Result: All container elements in the diagram (all selected container elements) appear with hidden compartments.
Tip: To show compartments, clear the check mark before the Brief View menu item.

To show or hide members in compartments

  1. In the Diagram View, right-click the diagram background (or right-click one of the selected elements.)
  2. In the Layout submenu, click Expand All or Collapse All. All elements in the diagram show (or hide) all internal members in all compartments (or in compartments of selected elements).

To streamline links removing bending points

  1. Right-click in the Diagram View; the context menu opens.
    • If you right-click the diagrams background, then the Layout submenu provides the Route All Links command.
    • If you right-click an element, then the context menu provides the Route Links command.
  2. Click the available Route command (if such command is available).
    • The Route All Links command streamlines all links (removing any bending points) on the diagram.
    • The Route Links command streamlines all links (if any) connected with the selected element.
Result: This streamlines all the links on the diagram (or all links connected with the selected element), removing bending points.
Tip: You also can manually drag bending points on links.

See Also