Using Custom Views to filter elements in diagrams and browser
You can define Custom View elements for your model to act as filters in determining which elements should be displayed in a given diagram and to control how the elements should be formatted. Custom Views can be applied individually or in combination in order to customize the appearance of a diagram. Custom Views can also be used to filter the display of model elements in the browser.
Creating a Custom View
To add a new Custom View to your model:
- Right-click a package to display the pop-up menu, and select Add New > CustomView.
- When the Features window is displayed, do the following steps on the
General tab:
- Specify the Criteria Type:
- Element Types - for selecting specific types of elements, such as classes and ports
- Queries - for selecting queries that you have defined in your model
- Model Elements - for limiting the display to only the specific model elements that you select
- Specify the Criteria. Depending on the criteria type that you selected, this will be specific element types, specific queries, or specific model elements
- Select the Show relations on diagrams option if you also want to display the connectors that exist between visible elements.
- Click Format... if you want to customize the appearance of the elements in the diagrams. This opens the standard Formatting window.
- For each type of element you want to format, select the metaclass from the list and click Format selected metaclass.
- Specify the Criteria Type:
Applying Custom Views to filter elements in browser
Once you have defined one or more custom views in your model, you can follow these steps to apply these custom views in order to filter elements in the model browser:
- In the filter list of the model browser, select Custom Views. All of the custom views that you have defined in your model will be listed in the Output window.
- Make sure that the Activate Custom View button is pressed.
- Select the individual custom views that you want to apply to the browser. The elements in the browser are filtered . When you have multiple custom views activated in Rhapsody® , the way diagrams are formatted depends on the order in which they are processed. This means that a model element is formatted according to the first custom view that overrides the format for the respective metaclass. If you have multiple custom views active, the diagrams are processed in the same order as they are displayed in the CustomView dialog.
- If you want the same filters to be applied to displayed diagrams, select the Apply on diagrams option.
Applying Custom Views to customize diagram appearance
Once you have defined one or more custom views in your model, you can follow these steps to apply Custom Views in order to filter elements and control the formatting of elements in individual diagrams:
- Right-click the diagram, and select Custom View. The Custom View window is displayed.
- Verify that the Activate Custom View button is pressed.
- Select the custom views that you want to apply to the diagram.
- Click Dismiss.