III. SYSTEM HIGRES
A. Graph models in Higres
A hierarchical graph supported by the Higres consists of
vertices, fragments and edges which we call objects. Vertices
and edges form an underlying graph. This graph can be
directed or undirected. Multiple edges and loops are also
allowed.
The semantics of a hierarchical graph is represented in
Higres by means of object types and external modules (see
below). Each object in the graph belongs to an object type
with a defined set of labels. Each label has its data type,
name and several other parameters. A set of values is
associated with each object according to the set of labels
defined for the object type to which this object belongs.
These values, along with partitioning of objects to types,
represent the semantics of the graph. New object types and
labels can be created by the user.
B. Visualization
In the Higres system each fragment is represented by a
rectangle. All vertices of this fragment and all subfragments
are located inside this rectangle. Fragments, as well as
vertices, never overlap each other. Each fragment can be
closed or open. When a fragment is open, its content is
visible; when it is closed, it is drawn as an empty rectangle
with only label text inside it. A separate window can be
opened to observe each fragment. Only content of this
fragment is shown in this window, though it is possible to
see this content inside windows of parent fragments if the
fragment is open.
Most part of visual attributes of an object is defined by its
type. This means that semantically relative objects have
similar visual representation. The Higres system uses a
flexible technique to visualize object labels. The user
specifies a text template for each object type. This template
is used to create the label text of objects of the given type by
inserting labels' values of an object.
Other visualization features include the following:
various shapes and styles for vertices; polyline and smooth
curved edges; various styles for edge lines and arrows; the
possibility to scale graph image to an arbitrary size; edge text
movable along the edge line; colour selection for all graph
components; external vertex text movable around the vertex;
font selection for labels text; two graphical output formats; a
number of options to control the graph visualization.
Now Higres uses three graph drawing algorithms for
automatic graph allocation. The first one is a force method,
which is very close to original algorithm from [3]. The
second one is our improvement of the first. The third one
allocates rooted trees on layers.
C. The user interface
The comfortable and intuitive user interface was one of
our main objectives in developing Higres. The system's main
window contains a toolbar that provides a quick access to
frequently used menu commands and object type selection
for creation of new objects. The status bar displays menu and
toolbar hints and other useful information on current edit
operation.
The system uses two basic modes: view and edit. In the
view mode it is possible only to open/close fragments and
fragment windows, but the scrolling operations are extended
with mouse scrolling. In the edit mode the left mouse button
is used to select objects and the right mouse button displays
the popup menu, in which the user can choose the operation
he/she wants to perform. It is also possible to create new
objects by selecting commands in this menu. The left mouse
button can be also used to move vertices, fragments, labels
texts and edge bends, and resize vertices and fragments. All
edit operations are gathered in a single edit mode. To our
opinion, it is more useful approach (especially for
inexperienced users) than division into several modes.
However, for adherents of the last case we provide two
additional modes. Their usage is optional but in some cases
they may be useful: the "creation" mode for object creation
and "labels" mode for labels editing.
Other interface features include the following: almost
unlimited number of undo levels; optimized screen update;
automatic elimination of objects overlapping; automatic
vertex size adjusting; grid with several parameters; a number
of options that configure the user interface; online help
available for each menu, dialog box and editor mode.
D. Algorithm animation
To run an algorithm in the Higres system, the user should
select an external module in the dialog box. The system
starts this module and opens the process window that is used
to control the algorithm execution. Higres provides the run-
time animation of algorithms. It also caches samples for the
repeated and backward animation. A set of parameters is
defined inside a module. These parameters can be changed by the user at any execution step. The module can ask user to
input strings and numbers. It can also send any textual
information to the protocol that is shown in the process
window.
A wide range of semantic and graph drawing algorithms
can be implemented as external modules. As examples now
we have modules that simulate finite automata, Petry nets
and imperative program schemes. The animation feature can
be used for algorithm debugging, educational purposes and
exploration of iteration processes such as force methods in
graph drawing.
A special C++ API that can be used to create external
modules is provided. This API includes functions for graph
modification and functions that provide interaction with the
Higres system. It is unnecessary for programmer, who uses
this API, to know the details of the internal representation of
graphs and system/module communication interface. Hence,
the creation of new modules in the Higres system is a rather
simple work.