Class ::tycho::EditBubbleAndArc


Inherits: ::tycho::Graphics - Related constructs - Source File - Contents: public methods - protected methods - protected variables
This class define a basic graphical editor for editing bubble and arc graph, which can be used as a base class.

Public constructs

Public Methods

clear
Clear the display, discarding the current graphics and corresponding data structure.
setReadOnly bool
Specify whether or not modifications are allowed in the displayed text. Note that this is independent of whether the associated file is readonly. It merely determines whether the buffer can be modified, not whether the file can be modified. To control the file, use toggleReadOnly.
deleteItem item
Invoked by the Cut command in the Edit menu. This method deletes the specified item from the canvas along with its corresponding entries in the data structures. It invokes the "deleteNode" or "deleteArc" methods below depending on whether the item is a node or an arc.
smoothToggleArc item
Toggle the mode of an arc between smooth (Bezier curve) or zigzag.
addPoint
Add a new point downstream (towards the arrow) to the doubly-selected point. The new point will be the midpoint between the doubly-selected point and its downstream neighbor.
deletePoint
Delete the doubly-selected point on an arc.
getInfo
Get information about the # of nodes/arcs.
newNode
Item creation commands.
newArc
bind_B1 x y
Canvas-wide bindings.
bind_B1_Motion x y
bind_BR1 x y
bind_Motion x y
bind_node_B1 x y
Select and un-select When a node is selected, its outline becomes red. When it's un-selected, its outline is black. Click mouse button 1 over a node to select it. Click mouse button 1 in the empty area to un-select the selected node, if there is any.
bind_arc_B1 x y
bind_selected_Enter x y
These methods are handlers for events on the "selected" tag.
bind_selected_Leave
bind_selected_B1_Motion x y
bind_selected_node_B1_Motion x y
bind_selected_BR1 x y
bind_selectedpoint_B1 x y
These methods are handlers for events on the "selectedpoint" tag.
bind_selectedpoint_B1_Motion x y
bind_selarclabel_B1 x y
These methods are handlers for events on the "selarclabel" tag.
bind_selarclabel_B1_Motion x y
bind_selarclabel_BR1
chooseCursor x y
Following are utility functions.

Protected constructs

Protected Methods

deleteNode node
Delete the specified node and its incident edges from the canvas along with the relevant entries in the data structures. This method is only used by the "deleteItem" method.
deleteArc arc
Delete the specified arc from the canvas along with the relevant entries in the data structures. This method is only used by the "deleteItem" method.
mkNode x y
Create new node at (x,y).
mkArc x y
Draw arc on canvas, used by bind_BR1.
resizeNode tag x1 y1 x2 y2
Only used by bind_selected_node_B1_Motion.
oval_slope oval m xneg
Only used by resizeNode.
adjustArcLabel arc
Adjust the arc label when the arc has changed.
chooseCursorOverArc x y
chooseCursorOverNode x y
find_close_node x y
return the close node within "gravity", if none, return empty list.
lineMidpoint arc
Return the (x,y) coordinates of the midpoint of a line.
snap_to_oval oval x y
Snap point (x,y) to the oval. Return the snapped-to point on the oval.
unselect
setUpCanvasBindings
Establish bindings for the canvas.

Protected Variables

create_item
This is needed for creating new node/arc.
nodeInfo
Array that stores info about the nodes/states.
edgeInfo
Array that stores info about the edges/transitions.
dblselpt_index
point_to_draw
oldx
oldy
node_id
node_create_state
arc_coords
arc_id
drag_action
button1_down 0
over_selected 0

Index of classes



Author: Wan-Teh Chang, Bilung Lee
Version: @(#)EditBubbleAndArc.itcl 1.11 10/29/96
Copyright: (c) 1995-1996 The Regents of the University of California.