Working with Containers in Diagram Editor

The container is a type of diagram element that can contain other nested elements (e.g. UML Package, UI Window, etc.). The article shows how to work with the containers, describes their capabilities, and explains various configuration options.

Moving Container

An empty container (container without any nested elements) can be moved in the same way as any other diagram element. Just press the left mouse button over the container bounds and drag it to a new position.

If a container contains some nested elements, you cannot move it this way by default. The selection within the container is preferred. However, you can still use the Move grip (four arrows icon ✢) placed near the left top corner of the container.

If you do not want the behavior to be changed depending on container content - you can turn off the option 'Prefer selection over move inside containers' - it is available in Options / Diagram Editor / Container. Then if you want to select the elements inside a container, you can still do it, when you hold the ALT key during the mouse actions.

Adding Elements to Container

If you want to add an element to a container, just drag the desired element and drop it over the container. You can insert a new element directly into a container. If you have several elements placed close to each other in the diagram you can draw a new container around them and the elements will be included in the created container.

There are several variations of this behavior. You can choose when an element will be added to a container from these options:

  • Partially overlapped elements
  • Fully overlapped elements
  • When cursor over container

Container Inflation

There are several settings according to container inflation. If you add a new element to a container and the element overlaps it, there are several options for how the editor can react:

  • ask whether you want to inflate the container (turn on the setting Options/Diagram Editor/Container/Ask for container inflation)
  • always inflate the container (turn on the setting Options/Diagram Editor/Container/Auto inflate)
  • do nothing about it (turn off both settings mentioned above - Options/Diagram Editor/Container/Ask for container inflation and Auto inflate)

Container Header

Sometimes, a container can be so large that does not fit in the editor window. Then you can see the nested content, but it may be not certain what it belongs to. There is an option (turned on by default) called 'Pin container headers' (Options/Diagram Editor/Container) that ensures that the name (or header) of the container will be always visible within the diagram editor window. It is especially useful for UML swimlanes or lifelines.

Container Layout

Software Ideas Modeler offers a variety of automatic layout options for organizing nested elements within a container, providing flexibility and ease in creating structured diagrams. The available container layouts include:

  • Simple: This is the default layout where elements maintain their initial positions relative to the container, offering a straightforward approach to element arrangement without automatic adjustments.
  • Stack: Elements are sequentially arranged either vertically or horizontally, depending on the stack settings. This layout ensures that the width (in vertical stacking) or height (in horizontal stacking) of nested elements aligns with that of the container, creating a neat, linear arrangement.
  • Flow: In the flow layout, nested elements are organized into rows or columns while preserving their original sizes. This layout adapts to the dimensions of the container, ensuring efficient use of space by wrapping elements as needed.
  • Table: Elements are precisely aligned within a grid, similar to a table structure. This layout offers a systematic arrangement, with nested elements placed in specific grid cells.
  • Grid: Similar to the table layout but with enhanced flexibility, allowing elements to occupy any cell within the grid. Elements can also span multiple cells, providing a versatile approach to arranging components.
  • Linear: Elements are evenly spaced and centered along a predefined polyline, offering a unique, linear path for the arrangement of nested elements.
  • Bezier: This layout mirrors the linear arrangement but utilizes a Bezier curve instead of a straight polyline, adding a dynamic and visually appealing curvature to the element organization.
  • Circular: Nested elements are arranged in a circular pattern, creating a harmonious and visually engaging layout ideal for representing cyclical relationships.
  • Radial: Building on the circular layout, the radial arrangement places one element at the center with the others distributed around it, effectively highlighting central elements or core concepts.
  • Tree: Designed for hierarchical structures, this layout organizes elements in a tree formation, following connectors to represent parent-child relationships clearly and intuitively.
  • Pyramid: Elements are positioned in a pyramid shape, starting with a single element at the top and increasing the number of elements in each subsequent row, ideal for representing layered or hierarchical data in a visually structured manner.

To change the container layout, right-click on it to show the context menu and choose the desired option from the Container Layout submenu. The submenu also provides a setting for the layout direction. For advanced container settings, choose the Container Layout Setting item.

Container Layouts
Container Layouts

New Comment

Comment