5.9.5. Working with Selections and the Marking¶
There are two mechanisms for working with multiple graph elements at the same time: selections and the marking.
A selection is a subset of elements within a single view and is therefore specific to that view. Selected elements are highlighted in blue.
The marking is a graph-global subset of elements. Marked elements are highlighted in red.
Note
There is only one marking, whereas there are as many selections as there are views (a selection for a view can, of course, be empty).
Figures Example of selections of nodes and edges in multiple views. and Example of a marking of nodes and edges in multiple views. illustrate the difference between selections and the marking.
Example of selections of nodes and edges in multiple views.¶
Example of a marking of nodes and edges in multiple views.¶
The
View Box shows the count of selected elements per view. The
marked elements are also counted per view.
See Figure View Box showing the marking and selections..
Selections are used for manipulation and query operations, while the marking is used for transferring results between views and for cross-view querying.
View Box showing the marking and selections.¶
5.9.5.1. Selecting Elements¶
Elements can be selected manually using the
Select Tool.
While this tool is active, clicking an element clears the current selection and selects the
clicked element. Holding Ctrl preserves the existing selection and toggles the
selection state of the clicked element (i.e., it selects the element if it was unselected, and
deselects it if it was selected). Holding Shift while clicking a node also
selects all its direct and indirect children (a “deep selection”).
Dragging a selection box around several elements clears the current selection and selects all enclosed elements. Holding Shift during this operation performs a deep selection, as with individual clicks. Holding Ctrl preserves the selection and toggles the selection state of all enclosed objects as follows: if all of them were already selected, they are deselected; if none or only some of them were already selected, they are all selected.
Graph Structure Based Selection¶
The following selection operations are available in the context menu of a view in
the
View Box, a graphical window, or a tree window.
If at least one node is selected, the
Select submenu
allows the additional selection of:
Select attached edges. Selects all edges whose source or target nodes are already selected.
Select incoming edges. Selects all edges whose target nodes are already selected.
Select outgoing edges. Selects all edges whose source nodes are already selected.
Select connecting edges. Selects all edges whose source and target nodes are already selected.
Select ancestors. Selects the parents of selected nodes, their parents, and so on.
Select children. Selects the immediate children of selected nodes.
Select backward closure. Selects the source nodes of all incoming edges of the selected nodes, repeating this process until no further nodes are added. This selects all nodes from which a selected node can be reached via a directed edge path. For example, in aCallview, this represents all routines that can directly or indirectly (transitively) call the selected routines.
Select forward closure. Selects the target nodes of all outgoing edges of the selected nodes, repeating this process until no further nodes are added. This selects all nodes reachable from a selected node via a directed edge path. For example, in aCallview, this represents all routines that the selected routines can directly or indirectly (transitively) call.
Select two-way closure. Selects the source nodes of all incoming edges and the target nodes of all outgoing edges of the selected nodes, repeating this process until no further nodes are added. This selects all nodes reachable from a selected node via an undirected edge path (ignoring edge direction), i.e., all nodes directly or indirectly connected to a selected node.
If at least one edge is selected, the
Select submenu
allows the additional selection of:
Select attached nodes. Selects all source and target nodes of the selected edges.
Select source nodes. Selects all source nodes of the selected edges.
Select target nodes. Selects all target nodes of the selected edges.
General Selection Operations¶
The following general selection operations are available from the
Select submenu:
Select allelements in a view.
Deselect allelements.
Deselect nodes.
Deselect edges.
Select top-level nodes.
Invert selection. Inverts the selection. The scope of this operation is the current view.
Clip selection to visibleelements. “Visible” elements are those that can potentially be made visible by zooming or scrolling in the current graph window.
Select by query.... Opens a dialog to define a property-based selection condition; see Section Query-based operations.
Deselect by query.... Functions as above, but for deselecting objects.
5.9.5.2. Marking Elements¶
The marking is operated similarly to the selection; the
Mark
Tool is used for manual marking.
The operation
Mark →
Clip
marking to view keeps only those elements in the marking that are present in the current view.
The operations
Select →
Select
marking and
Mark →
Mark selection
allow users to select the marking or mark the current selection.
5.9.5.3. Query-based operations¶
The query mechanism allows users to
Select by query,
Deselect by query,
Mark by query,
Unmark
by query,
Hide by query, and
Unhide by query.
This feature is explained using selection as an example:
The “Select by Query” feature allows you to specify which types of elements should be selected
and which attribute-based predicates must hold for the newly selected elements. Open the
dialog via
Select →
Select
by query... from the context menu of the
View Box or from the context
menu of a graph window.
Select by query dialog.¶
The Nodes and Edges tabs are used to specify the conditions
for nodes and edges. Both tabs are active simultaneously, allowing you to select nodes and
edges in a single operation. By default, the tabs are configured so that nothing is
selected; therefore, if you only want to select nodes, you can ignore the
Edges tab.
In the type tree, check the types of elements you wish to select. If a parent type is checked, its children are also checked; however, this behavior can be overridden by unchecking individual child types.
Buttons are provided to check all types, uncheck all types, and invert the check pattern, as well as to expand and collapse the type hierarchy tree.
Additional predicates for attribute values can be added below the type tree. Selecting
an attribute name activates a predicate row. Each attribute type has its own specific
set of available comparison operations. The comparison value can be
entered as the last item in the predicate row. For string attribute comparisons, you can
specify whether the comparison should be case-insensitive (a=A). The
special operators set and unset in the operator menu test
whether the specified attribute is present or absent from the element.
Once a predicate is activated, a new empty predicate row appears at the bottom. Unnecessary predicate rows can be removed using the trash can icon on the right.
The And and Or radio buttons below the predicate rows
determine whether an element must satisfy all predicates (the default) or at least one
of them. In both cases, the element must also be one of the checked types.
The most recently used query is saved and can be recalled using the Recall
previous button to repeat or refine the query.
The Select by query and Mark by query dialogs include a
button labeled Clear selection (or Clear marking,
respectively) to clear the current selection or marking before applying the query.
Pseudo-attributes for structural matching¶
If the Query window is opened from the context menu of a view entry in
the View Box or from the context menu of a window displaying a view, a
new Pseudo attributes entry with additional attributes appears in the
attributes menu of the Nodes tab. The following attributes can be used in
attribute queries for nodes:
Number of incoming edges
Number of outgoing edges
Number of attached edges
These pseudo node attributes are not stored in the graph but are computed based on the graph structure for the current context view.
Caution
The computed edge counts always include all edges present in the view, including those
that are currently hidden or belong to hidden types. They also
include hierarchical edges (e.g., of type Part_Of and Enclosing) that
are not displayed as edges in hierarchical diagrams.