|
|
Model Visualizer |
A powerful visualization engine for models.
|
Applicable To |
All |
|
Menu
Entry |
Power
Pack Model Visualizer Visualize Structure Power
Pack Model Visualizer Visualize Dependencies Power
Pack Model Visualizer Visualize Dependents Power
Pack Model Visualizer Visualize References Power
Pack Model Visualizer Visualize Path Power
Pack Model Visualizer Visualize Child References
All Power
Pack Model Visualizer Visualize Child References
External |
|
Demonstration |
The helper collects a set of model elements (as described below) and presents them in a graphical tree:

· Drag the background to pan around the canvas.
· Double-click or right-click the background to zoom-to-fit
· Use the mouse wheel to zoom in / out
· Hover over a node to display the model element type and name as a tooltip (for requirements the specification is shown)

If the node represents a diagram, then instead of its description, the image is displayed:

This may be disabled using the following property:
RhapsodyPowerPack.ModelVisualizer.DiagramsInTooltips
· Click a node to dynamically expand just that node

· Use the Expansion Level menu to expand the entire tree:

The tree may be auto-expanded on generation using the following package-level properties:
RhapsodyPowerPack.VisualizeStructure.NumberOfLevelsToExpand
RhapsodyPowerPack.VisualizeRelations.NumberOfLevelsToExpand
RhapsodyPowerPack.VisualizePaths.NumberOfLevelsToExpand
The options menu contains several options for navigating from the graph back into Rhapsody:

In addition, hovering your mouse over a node and pressing the spacebar will navigate into Rhapsody. this allows the navigation options to be switched off but still retail the ability to navigate back into the model.
Typing into the Search box will highlight any visible nodes that contain words that start with that text. For example, in the graph below P highlights nodes Purify Water and Water Properties. (searching for ‘er’ would not highlight any node). The search is not case-sensitive so ‘o’ would highlight open, out and Original Statement.

The Export menu allows the currently displayed graph to be exported as an image:

The location of the exported image is controlled by two other (checkbox) menus:
Ask for Export Location
If this menu is selected, then the helper presents a file chooser so you can choose the exported file location and name. If not, then images are automatically exported into an Images folder in the same folder as the project .rpy file. Images are named [Starting Element]_[Menu] where ‘Starting Element’ is the name of the model element from which the helper was launched, and ‘Menu’ is the menu that was selected to launch it.
Add as Controlled File
If this is true, then the Ask for Export Location menu is ignored. Images are generated into the user temp folder and then added as controlled files into the same package as the starting element (which automatically copies them into the rpy folder). File names are generated as above.
Depending on the menu used to launch the helper, the following visualizations are available:
An important consideration is recursion. Rhapsody model elements may appear multiple times in a structure (for example an element in a package may also be found at the end of one or more dependencies). The first time a model element is encountered, it is ‘fully processed’ – that is its children etc are processed and added to the graph. To prevent infinite recursion whilst still allowing graphical representation of model elements that may appear multiple times – every time after the first, the model element is only added to the graph as a non-expandable reference.
Non-expandable nodes are automatically formatted (according to the formatting properties described below) and their tooltips are automatically appended. Note that nodes that have no children (that is they are naturally a ‘dead end’) are not formatted as non-expandable:
A good example of this is processing structure for a package containing a diagram. If the model elements on the diagram are also in the package, and the diagram has been set to process its graphical elements (see Visualizing Structure) then the elements will appear twice in the graph. Only the first ‘instance’ of those nodes will be expandable.
Both the nodes in the generated graph and the dynamic behavior look-and-feel may be customized
Nodes are formatted in one of two ways (in order of priority):
1. By Profile
2. By Color Map
If an element in the graph is a new term and that new term stereotype has been formatted, then those colors are used in the graph. For example, the <<Visualization>> stereotype has been formatted to use a red line color and so this is the border color used in the generated graph for that model element:

Profile-based coloring may be disabled using the following package-level property:
RhapsodyPowerPack.ModelVisualizer.UseProfileFormatting
Color Maps may be provided that define the custom color scheme for specific types of model element.
The following package-level properties control the space between nodes on the graph, the connection colors, non-expandable node colors and the dynamic behavior look and feel:

The Model Visualizer works by generating an XML file for the visualization which is then in turn visualized in the UI. By default, these XML files are temporary and stored in the user temp folder. However for large models it may be advantageous to store the generated XML and re-use it later. This may be achieved by setting the following property at project / package level:
RhapsodyPowerPack.ModelVisualizer.StoreLocally
The location of the generated XML files is then controlled by the following property which may be an absolute path or a path relative to the project .rpy file:
RhapsodyPowerPack.ModelVisualizer.VisualizationsFolder
The default value is ‘Visualizations’ which will create a folder in the same folder as the .rpy file.
In addition to the generated XML file, this folder will contain any icons and images required by the visualization, allowing the visualization to be generated and re-used on another machine.
Visualization files are named [Starting Element]_[Mode] where Starting Element is the type and name of the element from which the visualization was launched, and Mode is a truncated version of the menu used to launch it. These names are also modified to exclude non-word which improves portability and makes it easier to embed them into URLs, XML attributes and so on. For example:

The following additional menus allow opening of existing visualizations (be aware that if the model has subsequently changed you will of course be visualizing potentially stale data):
|
Applicable To |
All |
|
Menu
Entry |
Power
Pack Model Visualizer Open Visualization Structure Power
Pack Model Visualizer Open Visualization Dependencies Power
Pack Model Visualizer Open Visualization Dependents Power
Pack Model Visualizer Open Visualization References Power
Pack Model Visualizer Open Visualization Path |