Using the Graph View

Selecting Model Elements

Using the Viatra Model Editor to Select the Model Elements

Four new menu items are added to the popup menu of the Viatra Model Editor:

Add Selected Subtree to the Graph View
Using this menu item it is possible to add a containment subtree to the graph view. This menu item is enabled if a single model element is selected in the model editor.
Remove Selected Subtree from the Graph View
Using this menu item it is possible to remove a containment subtree from the graph view. This menu item is enabled if a single model element is selected in the model editor.
Add Selected Elements to the Graph View
Using this menu item it is possible to add a list of selected elements (but only the selected elements) to the graph viewer. This menu item is enabled if at least a single model element is selected in the model editor.
Remove Selected Elements from the Graph View
Using this menu item it is possible to remove a list of selected elements (but only the selected elements) from the graph view. This menu item is enabled if at least a single model element is selected in the model editor.

By using any of the described methods when adding a relation to the graph, it makes sure, that both ends of the relation are present in the graph viewer, while removing any model element will make sure that any connected relations will also be removed.

It is also possible to use the Visualise Model Space menu item in the popup menu of the model space in Viatra2 Model Spaces view. This item will add the entire model space to the graph viewer (the same result can be reached when using the Add Selected Subtree to the Graph View menu item of the root element in the menu editor)

Warning! If a lot of model elements are selected for inclusion, the addition process can hang the computer/Eclipse instance for quite a lot of time. To avoid this it is not recommended to select more than a few dozens of model elements.

Using the Model Space Visualisation View to Select Model Elements

The selected elements in the Model Space Visualisation view can be removed by pressing the Del or Backspace keys.

The Filter submenu in the pulldown menu of the view contains options to remove the built-in relationships from the graph view: if checked, the elements respectively will hide the containment, the inheritance and the typeOf relationships.  

View related settings

It is possible to set some display options in the view pulldown menu. These options include the setting of the automatic layout algorithm, setting a visualisation type and changing the zoom level.

To change to zoom level, use the predefined levels in the pulldown menu of the view (these are Page, 50%, 75%, 100%, 150%, 200%, 250%, 300%, 400%), the changes will be visible instantly.

Layout algorithms

Currently five layout algorithms are included: Radial, Spring, Grid, Hierarchy and Simulated Cooling layout.

Radial layout
Tries to represent the graph nodes on concentric circles. A sample of the radial layout algorithm
Spring layout
Models each model arc as a spring, while the nodes shall become as far from each other as possible.A sample of the spring layout algorithm
Grid layout
Places all nodes at a point of a grid and draws the arcs between these grid points. A sample of the grid layout algorithm.
Hierarchy layout
Tries to show a hierarchy of the selected model elements. A sample of the hierarchy layout algorithm
Simulated Cooling layout
Tries to show a graph looking generally good (nodes are far from each other, the arcs should not cross, etc.). A sample of the simulated cooling layout algorithm

Providers

The system allows representing the relations either as nodes or arcs in the graph. To achieve this, you have to choose between the available content providers: full provider and reduced provider.

Full provider
The full provider displays relations as nodes, allowing the visualisation of the relations between the relations. The examples in the layout section were using the full provider.
Reduced provider
The reduced provider displays relations as arcs in the graph, thus making the visualised graph smaller. In this reduced size the containment, inheritance and typeOf relationships can also be presented.A sample of the reduced provider

Other capabilities

It is possible to save the graph as a PNG graphics file using the Save image as file menu item in the pulldown menu.

The view synchronises the selection of the graph model and the model editor: it tries to select exactly the same elements in both representations (it is possible that some elements are selected in the model editor that are not present in the graph - in this case it is not guaranteed that the selection is kept the same in the editor and the view).

If a new model element is added in the model editor it will not be automatically added to the graph viewer - but it is possible that after changing it's settings it will appear (if one of it's containers contained elements are added to the graph previously).

The Properties view can also be used together with the Model Space Visualiser: the selected elements properties will appear there in the same way as they would when using the Model Editor.