Aligning elements in UML diagrams

In UML diagrams, you can better organize the diagram layout by aligning elements in various ways.
You can align elements vertically or horizontally. When you align selected elements, they align to the diagram element that you select last and that has filled sizing handles. Grouped diagram elements, that you select by using the Marquee selection tool in the Palette, are aligned by the boundary of the group, not by the individual diagram elements in the group.

You can also use rulers and guidelines or a grid coordinate system to align the elements in a diagram.

To align diagram elements:

  1. In the diagram editor, select the diagram elements that you want to align.
  2. Right-click Format > Align and click a type of alignment.
  3. Optional: To align elements by using the ruler, right-click an empty space in the diagram; then click View > Rulers. Move the diagram elements to align with the guidelines.
  4. Optional: To align elements with the grid, right-click an empty space in the diagram; then click View > Grid and complete one of the following steps:
    • To manually align elements with the grid, move the elements into place.
    • To automatically align elements with the grid, right-click an empty space in the diagram; then click View > Snap to Grid.
    Tip: To set a default preference so that all diagram elements snap to the grid automatically click Window > Preferences > Modeling > Diagrams > Rulers and Grid.
Related tasks
Setting preferences for UML diagrams
Opening UML diagrams
Selecting elements in UML diagrams
Arranging elements in UML diagrams
Sorting compartment items in UML diagrams

Feedback