Skip to main content
Version: 2.0.0 (latest)

6.15. Layers management

The layers management widget allows the user to move graphical objects to multiple layers to create a contextualization between them or even to improve the model's visualization when the set of objects is too large to fit the entire canvas, for instance. The created layers can be quickly toggled, causing all objects associated with them to be shown or hidden. The user has the option to display layer names as well as colored rectangles around the objects that are within a certain layer. Layer rectangles around objects are currently available only for tables, views, and textboxes, and they are stacked around the objects if they belong to two or more layers. The sample image below shows a model that contains 2 layers (Default layer and rels).

ch6.layers-model.canvas

Layers are not global entities, which means that the loaded database models can have a different set of layers according to the context of each one. The user is free to add or remove any number of layers needed in a model, but at least one layer must be present in the model, so pgModeler denies the removal of a layer if it is the only one in the model. Layer names can contain only the following characters: a-z, A-Z, -, _ and space; any other special character is replaced by _. To change the layers assigned to a set of objects, just right-click them in the canvas and hit the action Quick > Set layers.

Layers can also be generated from schemas: right-click a schema and choose Quick > Add layer from schema to create a layer named after the schema and put in it all the tables, foreign tables, and views of that schema (the rectangle of the schema is hidden afterward, since the layer already groups its objects). The item Quick > Add layers from schemas, available when right-clicking the database or a blank area of the canvas, creates one layer for each schema after asking for confirmation. Unlike tags, layers are cumulative, so objects that already belong to other layers just receive the new one.

ch6.layers.popup123456789

Layers
#FieldDescription
1Add

Adds a new layer to the database model (Ins).

2Delete

Deletes the selected layer (Del). The objects assigned to the deleted layer are moved to the default layer.

3Delete all

Deletes all the layers created by the user (Shift + Del). Objects assigned to the destroyed layers are moved to the first one in the list.

4Visibility

Visibility : opens a menu with the actions Show all and Hide all, which respectively show or hide the objects of all the layers at once.

5Display layer rectangles

Toggles the visibility of the layer rectangles.

6Relationships follow tables' visibility

Relationships are hidden or shown according to the visibility of their tables. When checked, this option ignores the layers' visibility of the affected relationships.

7Display layer names

Toggles the visibility of the layer names. It is enabled only when Display layer rectangles is checked.

8Select objects on selected layers

When checked, selecting one or more layers in the list selects, in the canvas, the objects assigned to them.

9Layers

The layers of the model, including the default one. The check box beside each layer name toggles the visibility of the objects assigned to it; the columns Text color and Rect. color set the colors used to draw the layer name and its rectangle (the dice buttons pick random colors).