contents index next

14. The Graphical User Interface

This section discusses the graphical user interface for FSA. It's mostly extremely obvious. So this is a kind of `If you click on the help button, a help text will be displayed' explanation. Note that currently the graphical user interface is available only under SICStus Prolog. Take a look at http://www.let.rug.nl/~vannoord/Fsa/Manual/dump.png if you would like to know what the graphical user interface looks like.

MENU

The menu consists of a number of menu buttons. Really. The actions associated with the menu buttons are:

[Load]: Loads a file that is assumed to contain an automaton.

[LoadAux]: Loads a file that is assumed to contain auxiliary regular expression macro's and operators.

[ReconsultAux]: Reconsults a file that is assumed to contain auxiliary regular expression macro's and operators. This allows tracing of your code.

[SaveAs]: Saves the automaton and the associated geometry information in a file. Such a file can be read-in using the Load button, or as the startup file. Various formats are available under various [SaveAsX] buttons.

[Revert] Redraws the current automaton without the current layout; a new layout will be computed.

[Redraw] Redraws the current automaton with the current layout.

[Close] Halts the graphical user interface, but FSA continues.

[Quit] Halts.

Now let's consider some of the other widgets maintained by the graphical user interface:

If a regular expression is typed in the field, then after hitting <CR> the corresponding automaton will be visualised on the canvas.

The [Expand User Macro's] and [Expand All Macro's] can be used to expand all the macro's of the current regular expression.

If a sequence of symbols (separated by whatever the symbol_separator flag requires) is typed in this field, then (after hitting <CR>, or after pushing the `Submit' button) the system runs the current automaton on the input you provided. The actual way in which the automaton is run depends on the value displayed in the radio-button available to the right of the `Submit' button.

The large canvas contains a picture of the current regular expression (or automaton read-in from a file). Note that you can drag states to alter the layout interactively. If you point your mouse to a label of an edge, then the corresponding edge will become red temporarily (this is useful for large labels). Also note that for states P and Q all edges from P to Q are combined in a single edge. Start states are green, final states are red and have a sunken relief. If a state is both a start state and a final state, then it is green with a sunken relief.

The tool bar at the bottom consists of the following sub parts:

[EdgeAngle]: Text field should contain a real. Does a redraw using the current (typically) new angle variable upon &lt;CR&gt;. Does not require re-computation of layout.

[Xdistance]: Text field should contain an integer. Re-computes and re-draws using the current (typically new) distance of states parameter.

[Quality]: Re-computes and re-draws using the current (typically new) parameters.

[DisplaySigma]: Displays internal representation of alphabet and symbols list of current automaton.

[DisplayFa]: Displays internal representation of current automaton.

[CountFa]: Provides numerical information of current automaton.

[ClearCache]: Clears the cache of the regular expression compiler.

[ZoomIn]: This does the opposite of ZoomOut.

[ZoomOut]: This does the opposite of ZoomIn.

Finally, the [Interp] button can be used to get the name of the current Tcl/Tc interpreter. This is of interest only for development work.

As an experimental feature, you can include a widget displaying standard input and standard output. If you want to try out this new feature, you have to set the global variable tkconsol to on. E.g.:

fsa tkconsol=on -tk

Note that this is currently not very robust.

The following global variables are relevant for this module:

14.1. tk_fsa_file(+File)

Starts a Tcl/Tk widget for the automaton read from File

14.2. tk_fsa(+Fa)

Starts a Tcl/Tk widget for the automaton Fa

14.3. tk_regex(+Atom)

Atom is an atom, converted to regular expression and compiled into automaton. A Tcl/Tk widget is started for that automaton.

14.4. tk_rx(+Expr)

Atom is a regular expression and compiled into automaton. A Tcl/Tk widget is started for that automaton.

contents index next