Menu for work with filters is Diagram/Filter. It offers following options:
- Show All Elements - removes the applied filter (if any) – all elements of diagram will be shown.
- Create New Filter - shows a dialog which allows you to create a new custom filter and apply it to diagram. You can create global or project filter - read more in Filter Definition chapter
- Hide Comments - applies the filter to current active diagram, which hides all comments also with its connector lines.
- Hide Relations - applies the filter to current active diagram, which hides all relations of any type.
- Hide Collaborations - applies the filter to current active diagram, which hides the collaboration elements.
- (List of global filters)
- (List of project filters)
- Filter Manager - shows Filter Manager window, which allows you create, edit and delete filters.
Filter Manager shows all global filters (saved in user profile) and all filters defined in the current project. It allows you to add, duplicate, edit, delete, import and export filters. The window of Filter Manager consists of a toolbar and a list of all filters. The type of filter is given in parentheses - it can be Project filter or Global filter.
- Add ( ) - adds a new filter, which you define in Filter Definition window.
- Duplicate ( ) - adds a new filter based on the filter selected in the list of filters. Filter Definition window will show, where you can adjust the filter definition.
- Edit ( ) - opens the selected filter in Filter Definition window where you can adjust settings and conditions of the filter.
- Delete ( ) - deletes the selected filter from the project (Project filter) or from the user profile (Global filter).
- More - shows menu with other options:
- Import - imports a new filter from the file on disk.
- Export - exports the selected filter to the file.
When you create a new filter, you have to define its name (1) and type - Project (2) or Global (3).
Filter can be one of two types - Project and Global. Project filter is saved in the project file and can be used only in the project where it is defined. Global filter is saved in independent file and can be used in any projects.
Filter definition consists of list of disjunctive conditions/subfilters (4). If any of these conditions is fulfilled for an element, the element will be shown after applying filter. There are 4 basic types of simple filters, which can be easily add to list of conditions:
- Element Types - simple filters, which can filter elements by their type
- Stereotypes - simple filters, which can filter elements by their stereotype
- Collaborations - simple filters, which can filter elements by collaboration which are connected with
- Persons - simple filters, which can filter elements by their creator
You can select the type of simple filters from drop down list (5). Simple filters will be shown in list below (10). Just click on simple filter name in the list (10) and add it using Add (<) button (6) or using Add negative(< neg.) button (7). Add button adds positive condition and Add negative button adds negative condition. For example, if you choose Element Types / Use Case simple filter and add it to using Add button, only use cases will be shown after applying filter. If you add the same simple filter using Add negative button, all elements except for use cases will be shown.
If you want to add some combination to the list of conditions (e.g. Actor with <<system>> stereotype), use Add Combination button (11).
You can remove the selected condition from list of conditions using Remove (>) button (8). If you want clear the whole list of conditions, use Clear (>>) button (9).
You can filter elements also by their names - type a text which should be part of element name in the Name text box (12).
If your filter is completed you can save it using OK button (13). If you want to close the window and discard all changes you made, click on Cancel button (14) .
You don't need to use only simple subfilters in the list of conditions, but also the combinations. If you click on Add Combination button (11), Add Combination dialog will show. You can define, what the element has to fulfill to be displayed after applying filter. All these parameters have to be fulfilled at the same time.
You can set any combination of these parameters:
- Name (1) - part of the name which has to be matched
- Type (2) - type of the element
- Stereotype (3) - stereotype, which has to present among the stereotypes of the element
- Collaboration (4) - name of collaboration, which has to connected with the element
- Tagged values - tag (5) - tag, which has to be defined for the element
- Tagged values - value (6) - value, which has to be set for the tag defined in 'Tagged values - tag' or for any tag, if 'Tagged values - tag' field is empty
Filter combination will be added to the list of conditions after clicking the OK button (7), or it will be discarded, if you use the Cancel button (8).
You can add any number of combinations and simple filters to the list of conditions.