5.9.2. Windows¶
The elements of a view can be visualized in graph windows. Graph windows can show a graphical representation of the nodes and edges in a view or a tree representation of just the node hierarchy. Multiple windows can be opened for the same view.
Graphical windows can be flat or hierarchical. A flat window has no special treatment for hierarchical edges and displays them as ordinary edges between nodes. A hierarchical window interprets these edges as an indication of hierarchical nesting, i. e., they indicate which nodes are inside or part of a parent node. Tree windows are always hierarchical.
Operations that take the hierarchical structure of nodes into account are sometimes called “deep operations”.
5.9.2.1. Graphical Windows¶
Graphical windows are opened by double-clicking on a view entry in the View
Box or by choosing
Open →
Flat... or
Open →
Hierarchical...
from the context menu over a view entry.
Summary Edges (“Lifting”)¶
While a node is collapsed, there is no indication of edges from the outside to one or more of its children, as shown on the left side of Figure Before and after expanding node “Compiler”. To provide a better overview of the graph structure, views can be enhanced with summary edges that are shown between collapsed nodes to indicate that there are edges between their children (or even more deeply nested descendants). Views with these extra summary edges are called “lifted” views, and the summary edges are called “lifted” edges.
Gravis can show any view with lifted edges. This is controlled using the checkbox
icons in the Lifting column in the
View Box. If the
checkbox is in state “off” (
), there are no lifted edges. Enabling the
checkbox causes lifted edges to be added to the view. The checkbox shows a tick to
indicate that the view contains lifted edges. By default, lifting is updated
automatically if the view is edited. This is indicated by a green “update” icon next to
the tick (
). Automatic updates can be slow in views with many nodes
and edges, so you can switch from automatic to manual updates by clicking on the
checkbox again. The icon changes to an ordinary tick (
) to indicate
that the lifted edges are no longer updated automatically. Clicking the checkbox once
again deletes the lifted edges and removes them from all open diagrams showing
that view. The checkbox returns to its original state (
).
If automatic updates are disabled and the view is edited in a way that invalidates the
lifted edges (e. g., if edges are deleted or nodes are moved within the hierarchy), the
checkbox displays an “outdated” marker next to the tick (
).
Clicking the marker updates the lifting, and the icon changes back to an ordinary
tick (
).
Alternatively, you can switch between the different states by choosing an option from
the context menu over the Lifting column. It offers
Add lifted edges and
Delete lifted edges to switch lifting on and off,
Update lifting to update lifting that has become
outdated and
Auto-update lifting to switch between manual
and automatic updates.
Caution
The lifted edges shown via this method are not actually part of the graph, so they
cannot be selected, marked, or deleted, and they are not saved to .rfg or
.gxl files.
Note
It is also possible to create a lifted version of any view using the
Lift edges totally operation available in the Analysis Window (
Edit →
Run analysis... from the
main menu). In contrast to dynamic lifting using the lifting icon in the
View Box, this operation creates static edges, i. e., real edges
that can be selected and deleted and that become part of the .rfg or
.gxl file if the graph is saved.
Various lifting states shown in the View Box¶
In Figure Various lifting states shown in the View Box, the view “Architecture” has
automatically updated lifting, “Call + Module” and “Include” have manually updated
lifting, and the lifting for “Call + Module” is out of date. Finally, “Totally lifted 1” has
statically lifted edges created by the Lift edges totally operation; the
tick indicates that there are lifted edges, but the button is grayed out since the
lifting state cannot be changed. The other views are not lifted.
Working with lifted views¶
Double-clicking a lifted edge (regardless of whether it was created by dynamic or static lifting) displays an edge list window (see Section Edge List Windows) containing the real edges that were represented by the lifted edge.
In a window showing a lifted view, the display of summary edges can be switched off by
unticking
Visualization → Show lifted
edges.
Architecture analysis creates dynamically lifted edges for its result edges and for the source code edges that caused architecture violations; see Section Interpreting the Result of Architecture Analysis. Lifted architecture analysis result edges behave more intelligently when double-clicked: instead of showing the real result edges represented by the lifted edge, the opened edge list window shows all the causing edges responsible for the result edges, grouped by result edge. See Section The graphical Architecture Check result view.
Common Operations in Flat and Hierarchical Windows¶
Layout of Nodes¶
The layout of nodes can be changed
by manually dragging the node icons while the
Navigate,
Select,
Mark, or
Hierarchy Toolis active,by applying a layout operation from the
Layout operationssubmenu to lay out all nodes in the area where the context menu was opened,by applying a layout operation from the
Selection layoutsubmenu to lay out only the selected nodes in the area where the context menu was opened.
Opening the context menu on the background of the graph window lays out all top-level nodes. Opening the context menu over an expanded node background lays out the children of that node.
Note
Most
Selection Layout operations lay out the
selected nodes in the space (enclosing rectangle) currently occupied by the nodes.
Bringing Nodes to Front¶
Clicking a node (or, in a hierarchical window, also in its expanded area) brings the
node (and its ancestors) to the front.
Visualization →
Put
node to back in the context menu inside a node area allows you to put the node in the
background (behind all other nodes inside the same parent).
Hiding Elements¶
Elements can be temporarily hidden from a graph window’s visual representation using the
Hide operations from its
Hide and show
context menu. They can be made visible again using the Unhide operations.
Selecting
Hide and
show →
Unhide all makes all elements visible again
that were hidden using Hide operations.
The check boxes next to the type entries shown in the Edge Types and
Node Types palette windows allow elements to be hidden dynamically based
on their types. This is independent of the individual hiding status of each node; for example, if
you hide an individual node, then hide the node type and subsequently make the node type visible
again, the individually hidden node remains hidden.
Note
The individual hiding status of nodes and edges and the hidden node/edge types are stored in layout files.
Focus on Nodes¶
To improve the visibility of elements of interest, you can focus on
a node or a selection of nodes, making those nodes and their environment
temporarily stand out visually from the rest of the graph. Focusing is achieved via
Visualization →
Focus
on node or
Visualization →
Focus
on selection. The focused nodes and all directly attached nodes are displayed normally
in full color, while all other elements are shown in faded colors to make them less prominent.
The focus operation can be stopped by selecting
Visualization →
Stop
focus, which restores all faded elements to their normal display.
To easily find edge endpoints, the context menu over an edge offers the
options
Visualization → Focus
on source node and
Visualization → Focus on
target node, which focus on the specified endpoint of the edge and scroll it into view.
Multiple Edges and Edge Bundling¶
If there are several edges between a pair of nodes (typically with different edge types), these are shown as parallel edges. This allows each edge to be viewed and selected individually. However, this level of detail is not always required, and too many parallel edges can be distracting.
Parallel edges between nodes¶
Edge bundling replaces all parallel edges
between any given pair of nodes with a single “bundle edge” that represents all the
underlying parallel edges. The bundle edge is displayed more prominently to make it stand out.
To enable edge bundling, choose
Visualization →
Edge bundling... from the context menu. This opens a dialog where edge
bundling can be enabled or disabled and the bundling threshold can be specified. The threshold
is the minimum number of parallel edges required for edge bundling to occur. If the number
of parallel edges in the same direction between a given pair of nodes is below the
threshold, the edges are shown individually.
You can also press Ctrl+Shift+B to enable/disable edge bundling.
Cleaner display by enabling edge bundling¶
Each bundle edge is shown using the visualization of the closest common supertype of the
represented edges. For instance, a Set and a Use edge would be
represented by a Reference bundle edge.
Double-clicking on a bundle edge opens an edge list window with the edges that are represented by the bundle.
If some edge types are hidden by filtering (see The Node and Edge Types palettes), a bundle edge remains visible as long as at least one of the edges it represents is visible.
Saving and Loading Layouts¶
The current layout of nodes in a graph window can be saved separately from the RFG and
loaded back later. This is achieved via
Export layout...
and
Import layout... in the
Layout storage submenu of the graph window context
menu. Both options open a file chooser dialog to select the layout file to save or load.
The
Import recent entry opens a submenu with the
most recently exported or imported layout files for quick access.
Layouts are saved as XML files with the extension .gvl. A layout file stores node
positions, expanded node sizes, whether nodes are collapsed or expanded, and
which nodes or edges have been hidden via the operations in the Hide and
show submenu. It also stores the current visualization options and which node and edge
types have been hidden in the Node/Edge Types windows.
Note
The external storage of layouts is especially useful when working with different versions and/or variants of the same system under analysis.
Exporting as PNG, PDF and SVG¶
The current layout of nodes in a graph window can be exported as a bitmap file in PNG
format via
Layout
storage →
Save layout as PNG..., as a
scalable vector PDF file via
Layout
storage →
Save layout as PDF..., or as a
scalable vector SVG file via
Layout
storage →
Save layout as SVG....
Zooming and Scrolling¶
The
Zoom Tool allows you to zoom in by clicking in the
graph window, zoom out by holding Shift while clicking in the graph window,
and zoom to a specific area of the window by dragging a box around it. While the
Zoom Tool is selected, the scroll wheel of the mouse zooms in
and out instead of scrolling up and down.
The Zoom Bar at the bottom of the window shows the current zoom factor.
To change it, enter a percentage value and press Return or drag the slider to the
left of the field.
The Zoom Bar¶
The
Zoom submenu of the context menu provides options to reset
the zoom factor to 100% (
Zoom to 100%, shortcut
Ctrl + 0), fit the entire graph into the window (
Zoom to visible graph, shortcut Ctrl + G), or fit all
selected or marked elements into the window (
Zoom to
selection and
Zoom to marking, respectively). You can
access these actions from the Zoom Bar as well.
You can zoom in and out in all tools using the scroll wheel by holding down Ctrl.
The
Scroll Tool allows you to scroll the window contents by
dragging on the window background as a more direct alternative to dragging the scroll
bars.
Adapting the Graph Style¶
Many aspects of how Gravis displays graphical diagrams can be customized, such as colors, node shapes, line widths, and labels. See Visualization options.
5.9.2.2. Tree Windows¶
The tree window displays the hierarchy of nodes in a view as an Explorer-like tree view.
Standard expand/collapse features are available, as well as
Visualization →
Expand
selected nodes,
Collapse selected nodes,
Expand marked nodes,
Collapse marked nodes,
Expand all, and
Collapse all
via the context menu.
The context menu entries
Visualization →
Expand
to show selected and
Expand to show marked
allow you to locate the selected or marked nodes in the hierarchy.
As in graphical windows, the
Select Tool can be used to
select elements by clicking on them. Note that selecting a
range of elements by holding down Shift while clicking – the standard convention
for tree views – is not supported.
Instead, clicking with Shift behaves as it does in a graphical view; i. e., it
performs a deep selection (see Section Selecting Elements).
Instead of using Shift, you can select a range of elements in a tree
window by dragging a selection box around them. Using the keyboard, Shift + Up and
Shift + Down select the current element and extend the selection to the
element above or below it. Moving back to an already selected element deselects it. In
the
Mark Tool, these keys extend the marking instead.
Nodes in the tree view are sorted alphabetically. By default, name comparison is
case-insensitive unless you select
Visualization → Case
sensitive comparison. Selecting
Visualization → Group by
node type sorts elements by type first, and then by name within each type group.
Filtering elements¶
The Filter Box at the top of each tree window allows you to filter the
entries displayed in the window. Only entries whose attribute, selected in the
Match Attribute control (by default Source.Name), matches the entered
filter string are shown. Pressing Return in the Filter Box expands the entire tree
to reveal all elements.
A Mapping Window with Filter Boxes. The left-hand side is filtered.¶
The three controls next to the Filter Box allow you to fine-tune the filtering:
The Match Mode control allows you to choose between standard substring matching
(
), wildcard matching using *, ? and [...] (
), and
regular expression matching (
).
The Match Attribute control allows you to switch between matching the
Source.Name attribute (), the
Linkage.Name attribute
(), the full file path (
), and the
UML.Stereotypes
attribute (). The full file path is a combination of the
Source.Path
and Source.File attributes. For example, a node with Source.Path =
src/module
and Source.File = file.cpp has a full file path of src/module/file.cpp.
Enabling the A=a option makes the match case-insensitive.
Note
In a Mapping Window showing both the architecture and hierarchy views as
trees, each side has its own independent Filter Box.
Caution
Filtering requires Gravis to examine every node in the view; therefore, editing the filter string may be slow for views containing many nodes.
5.9.2.3. Subset Windows¶
A subset window is a flat graph window that displays only a specific subset of the nodes in a
view. A subset window can be opened via the context menu of the
View Box or a
graph window by selecting
Open →
Extract
selection (flat)... or
Open →
Extract
marking (flat)....
Note
Note that while you can mark nodes from different views simultaneously, extracting them into a single subset window is not possible. The subset window is always clipped to the view for which it was opened.
Aside from the limited number of displayed elements, a subset window behaves exactly like a flat graph window; therefore, the same operations are available.
Although the subset window only displays a portion of the elements in a view, selection
and marking operations still apply to the entire view. For example, an operation such as
Select →
Select
incoming edges may select edges that are not part of the current subset.
You can limit the selection to the displayed subset at any time via
Select →
Clip
selection to visible.
Alternatively, you can add these additional nodes and edges to the subset window by
selecting
Hide and Show →
Add selection to diagram. Note that adding an edge always adds its
source and target nodes to the diagram; otherwise, the edge would not be visible.
Caution
Deletion operations also apply to the entire view. Consequently, using
Edit →
Delete node or
Delete edge, or
Edit →
Delete
selection, removes the element or selection from the entire view, including other
windows showing the same view.
You can remove nodes and edges from the subset window by selecting
Hide and Show →
Remove
selection from diagram. Note that this operation maintains the consistency of the
subset; removing a node also removes its attached edges from the subset.
5.9.2.4. Edge List Windows¶
An edge list window displays a list of edges in a view, typically a subset. Edge list windows are opened by double-clicking a lifted edge, an architecture result edge, or a bundle edge.
Each row in an edge list window represents an edge. You can select, mark, edit, and
delete these edges. The nodes shown in the Source/Target node columns are for
information only and are not affected by any operations. If an edge is selected
or marked, the row background changes to indicate its status. Clicking a row using the
Select Tool or the
Mark Tool
selects or marks the corresponding edge. Note that the selection or marking status of the
source and target nodes is not displayed in the edge list window.
Caution
Deleting an edge in an edge list window removes it from the view, not just from the window. This is consistent with the behavior in all other windows showing graph elements, such as graphical and tree windows.
5.9.2.5. Source Code Windows¶
Graph elements originating from source code analysis (e. g., the nodes and edges
in the Code Facts view) are associated with specific source code positions. You can display a
Source Code window showing the source location of an element by selecting
Open →
Show
source code... from the element’s context menu, or by double-clicking the element in
a graphical or tree window while holding Shift. The associated
source line is highlighted with a yellow background.
You can zoom in and out of the window by holding Ctrl and using the vertical mouse wheel.
In addition to displaying source code, the Source Code window allows
you to select code by dragging the mouse over it and copying it via the
Copy option in the context menu or by pressing Ctrl+C.
Select all in the context menu
(or Ctrl+A) selects the entire file.
Mark graph elements in the context
menu (or Ctrl+M) marks all graph elements whose source position is within the selected
code.
To find a string in the source code window, select Find... from the context
menu (or press Ctrl+F). This opens the search bar at the bottom of the Source Code
window. Enter the search string into the input field and press Return to search forward
or Shift+Return to search backward. If the a=A option is checked, the
search is case-insensitive; otherwise, it is case-sensitive. The up/down arrows next to the
input field allow you to search
forward or backward using the mouse. The close icon next to
the arrows closes the search bar.
Resolving Relative Source Code Paths¶
Graph elements often contain relative file paths. These are resolved by prefixing them
with the source base path, which is stored as a graph attribute. If the source base
path is not configured in the graph or is incorrect, it can be overridden with a
user-defined source base path in Gravis, either via the command-line option
--basepath <path> when starting Gravis or via the base path dialog
(File → Source base path...). The dialog displays the
source base path stored in the graph and allows you to switch to a user-defined base
path. You can enter the base path manually or click
Browse... to open a standard file dialog and select the base path
directory.
The Base Path Dialog.¶
Clone Pair Windows¶
A Clone Pair window is a specialized Source Code window
that displays two source files side by side to compare identical or similar
code regions found in different files or in different locations within the same file. It is
opened by double-clicking a
Clone edge
(typically found in
a Clones view) or by clicking the
Show clone pair... button
in the Edge Information window of a clone edge. Each side provides the
same functionality as a standard
Source Code window.
External Code Viewers¶
Gravis can optionally launch an external editor to display source code instead of
using its internal Source Code window. This behavior is
controlled via the Gravis configuration. The configuration option
/Tools/Gravis/source_view/external_cmd
specifies the command to be
executed. The macros %filename, %linenumber, and
%columnnumber in the command are replaced by the full file path, the line
number, and the column number of the source position, respectively. To return to the
default behavior of using the internal Source Code window, leave the
command empty.
5.9.2.6. Information Windows¶
Quick Element Information¶
The quickest way to view basic information about an element in a graph window is to
hover the mouse pointer over the element while the Navigate,
Select, Mark, Hierarchy, or
Mapping tool is active. This briefly displays information about the
element in the status bar: for a node, its name and type; for an edge, its type and
the names and types of its source and target nodes.
Note
This is particularly useful if a node label is difficult to read because it overlaps with other elements, or if one or both endpoints of an edge are outside the visible window area.
Hint
This behavior can be changed to trigger an update
of the element information in the status bar using the middle mouse button.
To do this, set the option /Tools/Gravis/instant_element_info_in_status_bar to
false in axivion_config.
This may be useful if the default behavior causes excessive flickering or
significantly slows down Gravis.
More information about an element can be obtained by opening a permanent Information Window:
The Node Information Window¶
Selecting
Open →
Node
information... from a node’s context menu opens the Node Information
window. It displays information about the node and lists its incoming and outgoing edges.
The View drop-down menu lists the views in which the node is present.
Selecting a different view from the menu displays
the node’s incoming and outgoing edges for that specific view.
The context menu for an entry in the Incoming edges or
Outgoing edges lists allows you to display the Edge
Information window for the edge, or the Node Information window
for the edge’s other endpoint. It also allows you to select/deselect or mark/unmark the
clicked edge or its other endpoint.
The Edge Information Window¶
Selecting
Open →
Edge
information... from an edge’s context menu opens the Edge Information
window. It displays information about the edge, including details about its source and
target nodes. The Node information buttons allow you to open the
Node Information windows for the edge’s source and target nodes,
respectively.
Common Operations in Node/Edge Information Windows¶
The Select button selects the element in the view shown in the
View field. The Mark button marks the element. The
Show source code... button opens a Source Code window for
the element (see Section Source Code Windows). If the edge is a
clone edge, the button instead reads Show clone pair... and opens a
Clone pair window (see Section
Clone Pair Windows).
Each Information window shows a list of attributes at the bottom. Section Editing Attributes explains how to edit attributes.