Work with containers on a diagram

Containers are resizable colored boxes that you can use to organize and group diagram objects and shapes. You can customize the appearance of containers and use them to arrange related items logically in your diagram. You can place any diagram object inside a container, including other containers. When you move a container, the objects inside it move together, which helps you maintain organized layouts.

You can create multiple containers, each with a unique name and color. For example, when a diagram contains tables from multiple schemas, you can create containers for each schema, label them accordingly, and place objects in the corresponding containers.

Note

Table relationships remain intact even when tables are placed in different containers.

Containers

Add a container

You can add a container in one of these ways:

  • Right-click a diagram and select New > Container.
  • On the Database Diagram toolbar, click Container, then click the diagram to insert the container.

Add objects to a container

To add an existing object to the container, drag the required object from Database Explorer or from the diagram.

Note

When you drag a shape over a container and release the mouse button, the shape is added to the container, even if most of the shape remains outside the container.

When you drag a shape outside a container and release the mouse button, the shape is removed from the container.

To add a new object to the container:

1. Right-click the container and select New, then choose the object type.

2. In the editor that opens, configure object details. The available options depend on the selected object type. For more information, navigate to Database objects and see the documentation of the required editor.

3. Save the changes.

4. Close the editor.

Containers have their internal grid for positioning shapes. If there isn’t enough space, scroll bars appear, which you can use to navigate within the container.

Add objects to the container

Rename a container

You can rename a container in one of these ways:

  • Click the container title and enter a new name.
  • Select the container, press F2, then enter a new name.

Resize a container

To resize a container, select it and use the vertical and horizontal resize handles.

Resize the container

Change the container color

The default container color is yellow.

To change the color, right-click the container, select Color, then choose the color.

To use a custom color, select Color > Custom. In the Color dialog, configure the color properties, then click OK.

Assign a color to the container

Change the container opacity

To change the container opacity, right-click the container, select Opacity, then choose the value. The available options are 20%, 40%, 60%, 80%, and 100%.

Adjust container shapes

To adjust container shapes, right-click the container, select Shapes, then select one of the following options:

  • Collapse – Hides all the shapes inside the container. Only the container caption is visible. Alternatively, double-click the container caption or click the collapsible arrow in the upper-right corner of the container.
  • Expand – Displays all the collapsed shapes in the container.
  • Bring to Front – Moves the container in front of overlapping objects.
  • Send to Back – Moves the container behind overlapping objects.
  • Align to Grid – Arranges shapes with even horizontal and vertical spacing within the container.
  • Best Fit – Adjusts the container width to display all its content.

Select all object relationships in a container

To select all relationships between objects, right-click the container and choose Select All Relations, or press Ctrl+Shift+A.

Synchronize a container with Document Outline

To display the newly created container in Document Outline, right-click the container and select Synchronize Document Outline.

Synchronize a container with Document Outline

Remove a container from the diagram

To remove a container from the diagram, right-click the container and select Remove from Diagram, or press Delete.

Note

When you remove a container from the diagram, all shapes it contains are also removed. The corresponding database objects remain in the database and are not deleted.