An Interactive Editor for the Statecharts Graphical Language
Stephen Edwards
Overview
The objective of this project was to produce a graphical, interactive
editor for the Statecharts graphical language, which uses
hierarchically-arranged finite state machines. I chose this model
after users requested I extend my previous finite-state machine editor
to include hierarchy.
A Statechart contains two sorts of entities: states, which are boxes
with names, and transitions, which are curved arrows connecting two
states. A Statechart drawn with my editor is shown here
The editor can
- add and delete states and transitions
- move states and transitions, either preserving hierarchy or
modifying it
When states move, transitions remain attached. Transitions' shapes
either come from a single index of curvature, or can be specified
arbitrarily by the user.
- edit multiple views of the database, each starting from a
different state in the hierarchy, going down a different depth, and
with different magnification
For example, the Statechart above can be
displayed with a depth of 2 and starting with state A in
two windows simultaneously:
- edit attributes (fonts, colors, shape) of states and transitions
in dialogs
- read and write the database to disk
- print a view of the database to a PostScript file
This editor is written using McLennan's [incr Tcl] package,
which brings an object-oriented data model to Tcl. My previous
editor, written in straight Tcl, made it clear that the more elaborate
database required for the Statecharts editor would be difficult to
implement in straight Tcl.
In the Architecture section, I
describe the architecture of the editor in detail by describing the
major classes. In the Dead Ends section,
some later-corrected bad design decisions are listed. Finally, the Conclusions section contains the
conclusions I reached from building this editor.
Last updated 941202
Written by
Stephen Edwards.