Rendering views
A rendering feature specifies how a particular view and its exposed elements are supposed to be rendered, i.e., displayed for viewing. Once you have created a view, specified the exposed elements, filtered the exposed elements, you can specify the renderer for the view.
Renderings, rendering styles, and view definitions
The following table maps renderings and rendering styles available in the modeling tool to corresponding predefined view definitions.
| View rendering kind | Rendering style | Renderings | Subsets of the renderings | Rendering definitions |
|---|---|---|---|---|
| Graphical | Nested-view | Views::asInterconnectionDiagram View definitions using the renderer:
| - | Views::GraphicalRendering |
| Tree-view | Views::asTreeDiagram View definitions using the renderer:
| - | Views::GraphicalRendering | |
| Tabular | - | Views::asElementTable | DS_Views::CoreViews::asTable View definitions using the renderer:
| Views::TabularRendering |
Rendering views
Ways to render views:
- Inheriting a renderer. You can render views through inheritance, e.g., if the view is defined by a view definition that contains a renderer, the renderer is inherited by and applied to the defined view.
- Specifying a renderer. You can specify a renderer after the expose and filter declarations directly for the specific view, using the keyword render.
Inheriting a renderer
Generally, renderings are specified for view definitions, which are then used to define specific view usages, the latter inheriting the renderer specified for its definition.
See the Renderings, rendering styles, and view definitions table for all renderings available in the modeling tool and the predefined view definitions that use them. Choose the view definition based on the renderer specified for it that would be the most suitable for your view, then define the view by the view definition. However, many predefined view definitions carry specific filters and other customizations that will be inherited in addition to the renderer, thus choose accordingly. For more information, see the Symbolic views and Tabular views pages.
The corresponding procedures are:
- Creating symbolic views via the Create View command on the Creating symbolic views page.
- Creating symbolic views via the Textual Editor on the Creating symbolic views page.
- Creating tabular views via the Create View command on the Creating tabular views page.
- Creating tabular views via the Textual Editor on the Creating tabular views page.
// explanation and example of a symbolic view General View inheriting a renderer through subclassification
abstract view def <sv> 'Symbolic View' :> Visualization {
//...
render Views::asInterconnectionDiagram; // view definition has the Views::asInterconnectionDiagram renderer specified for it
}
abstract view def <bsv> 'Base Symbolic View' :> sv { // view definition 'Base Symbolic View' inherits the Views::asInterconnectionDiagram renderer through subclassification of 'Symbolic View'
part baseViewPalette : ViewPalettes::BasePalette :>> palette;
}
view def <gv> 'General View' :> bsv, StandardViewDefinitions::gv { // view definition 'General View' inherits the Views::asInterconnectionDiagram renderer through subclassification of 'Base Symbolic View'
part generalViewPalette : GeneralPalette :>> baseViewPalette; // view definition also contains a specific view palette
}
view 'General View' : DS_Views::SymbolicViews::gv; // the specific view is defined by the view definition 'General View', inheriting its renderer and view palette
// explanation and example of a tabular view Generic Table inheriting a renderer through subclassification
abstract view def <bt> 'Base Table' :> bgv { // view definition 'Base Table' has the asTable renderer specified for it
render asTable;
}
view def <gt> 'Generic Table' :> DS_Views::CoreViews::bt { // view definition 'Generic Table' subsets the asTable renderer inherited through subclassification of 'Base Table'
render rendering asTable :>> asTable;
}
view 'Generic Table' : DS_Views::TabularViews::gt; // the specific view is defined by the view definition 'Generic Table', inheriting its renderer
Specifying a renderer
Instead of creating views defined by view definitions that already have specified renderers, you can specify the renderer directly for the new view.
The corresponding procedures are:
- Creating undefined symbolic views using renderers via the Textual Editor on the Creating symbolic views page.
- Creating undefined tabular views using renderers via the Textual Editor on the Creating tabular views page.
view newView { // new view element is not defined by any view definition
render Views::asInterconnectionDiagram; // the view has a renderer asInterconnectionDiagram, rendering it as a 'General View' symbolic view with nested-view rendering style
}