Filtering compartment items in UML diagrams

In UML diagrams, several diagram elements have compartments that display textual and graphical information. You can reduce the visual clutter and complexity in diagrams by filtering the contents of these compartments. Filtering hides information based on criteria that you specify.
You can filter compartment items by visibility or by selecting specific items that you want to hide.

To filter compartment items in a UML diagram:

  1. In the diagram editor, right-click a diagram element; then click Filters > Sort/Filter Compartment Items.
  2. In the Sort/Filter Compartment Items window, complete one of the following steps:
    • To filter items by visibility, in the list on the left, select All Compartments, Attribute, or Operation. On the right, use the arrow buttons to move the appropriate filter criteria into the Filter Items Containing list.
    • To filter items by selection, in the list on the left, select Attribute or Operation. In the table on the right, select the check boxes for the items that you want to show.
    Note: The changes that you make in one set of filter controls overrides any changes that you make in the other. If you change the visibility categories that are selected in the filtering lists, these changes override any individual selections that you make in the table.
  3. Click Apply.
  4. Click OK.
The UML diagram is updated to show or hide the attributes and operations based on the filtering selections that you made.
For example, you have a class that has four attributes. One of the attributes has private visibility, one has protected visibility, and two have public visibility. As the following figure illustrates, in the Sort/Filter Compartment Items window, if you move private and public into the Filter Items Containing list, this clears the check boxes for the attributes with public visibility and private visibility. Only the attribute with protected visibility remains selected.

The Sort/Filter Compartment Items dialog box shows that the public and private visibility categories are selected in the Filter Items Containing list, and the check boxes for the attributes with private or public visibility are cleared in the table.

Now, as the following figure illustrates, if you select the check box for attribute1 in the table, private and public move from the Filter Items Containing list back into the Filter Criteria list. The check boxes for attribute1 and attribute4 are selected in the table.

The Sort/Filter Compartment Items dialog box shows that the public and private visibility categories are no longer selected in the Filter Items Containing list, and the check boxes for attribute1 and attribute4 are selected in the table.

Finally, as the following figure illustrates, if you move private back into the Filter Items Containing list, all of the check boxes are selected except for the attribute with private visibility.

The Sort/Filter Compartment Items dialog box shows that the private visibility category is selected in the Filter Items Containing list, and the check boxes for attributes with public and protected visibility are selected in the table.

Related tasks
Sorting compartment items in UML diagrams

Feedback