Figure 9.4:
Manipulating attributes
|
(make <graph-view> :graph graph :xpixels xpixels :ypixels ypixels :layout layout ) |
Create and return a toplevel window containing a view of graph.
The keyword arguments are optional, where
graph is a <graph*>
object,
xpixels and
ypixels are integer values, and
layout
is a symbol naming the layout algorithm. At this time, the
layouts available are: 'circular, 'random, 'spring, and 'bipartite.
A copy of
graph is made and retained in the <graph-view> object.
(slot) Holds the name of the graph, which corresponds to the
name attribute of the
Graphclass in C++.
(slot) Holds the associated <graph*> object, which
name attribute of the
Graphclass in C++.
(slot) Defines the width of the graph's canvas widget.
Changing its value causes the graph to be redrawn. Note that
the window can be resized using the mouse. Such an operation
does not automatically cause the graph to be redrawn (that would
be too slow). Instead, there is a ``redraw'' option in the
``Graph-View'' menu which modifies xpixels and ypixels.
(slot) Defines the height of the graph's canvas widget.
The discussion of xpixels pertains to this slot also.
(slot) Stores the title displayed in the toplevel
window of the <graph-view> object (not necessarily the name
of the graph).
(slot) Holds the Tk toplevel window in which the graph window's
menu and canvas are packed.
(slot) Holds the Tk canvas widget in which the graph's vertices
and edges are drawn.
(slot) Holds the STk hash table which allows the user or
programmer to search, given a <vertex*> object, for the
associated <vertex-item>.
(slot) Holds the STk hash table which allows the user or
programmer to search, given a <edge*> object, for the
associated <edge-item>.
(slot) Holds the STk hash table which, allows the user or
programmer to search, given a the integer tag of a <line> or
<text-time> return the associated <edge-segment-item> object.
This is used by the selection and dragging mechanism and may not
be of any interest to the user.
(slot) Holds the STk hash table which allows the user or
programmer to search, given the tag of an <oval> or <text-item>
for the associated <vertex-item> object.
This is used by the selection and dragging mechanism and may not
be of any interest to the user.
(slot) Holds the STk hash table which allows the user or
programmer to search, given the tag of an <oval> or <text-item>
for the associated <edge-item> object.
This is used by the selection and dragging mechanism and may not
be of any interest to the user.
(method) Returns a list of all <vertex-item> objects in
gv .
(method) Returns a list of all <edge-item> objects in
gv .
(method) Updates the attributes of the <graph-view> and its
associated <graph*>.
(method) Changes the visual appearance of each <edge-item> in
the graph to be ``path-draw,'' i.e., a single path of line segments
through the member vertices. This is the default edge drawing
style.
(method) Changes the visual appearance of each <edge-item> in
the graph to be ``star-draw,'' i.e., a central edge label with
line segments to each member vertex.
(method) Is used primarily to view hyperedges. It changes the
drawing mode of <edge-item>
ei to be ``star-draw,'' and updates
the location of the central edge label.
(method) Calls layout-edge for each <edge-item> in
gv.
(method) Makes the label associated with <vertex-item>
vi
invisible.
(method) Makes the label associated with <vertex-item>
vi
visible.
(hide-labels gv) |
|
(show-labels gv) |
|
These methods hide and show all labels associated with the vertices
and edges of
gv.
(hide-vertex-labels gv) |
|
(show-vertex-labels gv) |
|
(method) Hides all labels associated with the vertices
of
gv.
(hide-edge-labels gv) |
|
(show-edge-labels gv) |
|
(method) Hides all labels associated with the edges
of
gv.
(reset-label vi ) |
|
(reset-label ei) |
|
(method) Resets the label slots of the given <vertex-item> or
<edge-item> to be the name of the associated <vertex*> or <edge*>
C++ object.
(method) Calls reset-label for each <vertex-item> and <edge-item>
of
gv.
(method) Resets the colors of each <vertex-item> and <edge-item>
to their default values.
(method) Calls reset-colors and reset-labels.
(method) Returns the <vertex-item> object associated with
<vertex*>
vertex in <graph-view>
gv .
(method) Returns the <edge-item> object associated with
<edge*>
edge in <graph-view>
gv.
(vertex-items vlist gv) |
|
(vertex-items mset-vertex gv)
(vertex-items set-vertex gv) |
|
(method) Returns the list of <vertex-item> objects of
<graph-view>
gv associated with the <vertex*> objects in
list
vlist , <mset<vertex*>>
mset-
vertex, or <set<vertex*>>
set-
vertex.
(edge-items elist gv) |
|
(edge-items mset-edge gv)
(edge-items set-edge gv) |
|
(method) Returns the list of <edge-item> objects of
<graph-view>
gv associated with the <edge*> objects in
list
elist , <mset<vertex*>>
mset-
edge, or <set<vertex*>>
set-
edge.
(method) Returns #t if
gv is a <graph-view> object.
The graph displayed in graph-view
gv is replaced by
g. The
former is deleted.
|
(collapse-subgraph <list-of-vertex-items> gv) |
The vertices in <list-of-vertex-items> are identified into a
subgraph, which can later be expanded. The latter is represented
by a ``super-vertex,'' which is returned.
If <vertex-item>
vg is a super-vertex, replace it with the
subgraph is represents. The return value is the set of
vertices which comprised the subgraph (or
vg if it is not
a super-vertex.