JFA - Java Graphical Editor for Forlan Automata


Introduction

JFA is a Java program for creating and editing Forlan Finite Automata. It can be invoked by Forlan or run as a standalone application. It was designed and implemented by Leonard Lee, as his honors research project during his studies at K-State.

Installation

JFA requires JRE (Java Runtime Environment) to be installed. It can be downloaded for free from http://www.java.com. JFA has been tested on JRE 1.4, but some features of the application did not behave as expected. Therefore, it is recommended that users install JRE 1.5 or later. Forlan itself must be installed separately.

Installing JFA on Windows

Download and place the JAR archive JFA.jar in a folder on the computer. Download and place the file jfa.bat in a folder that's on the search path, e.g., to the folder where sml.bat was installed. Edit jfa.bat so that the variable jardir is set to the directory where JFA.jar is located. Finally, create a shortcut to JFA.jar.

Installing JFA on Linux or Mac OS X

Download and place the JAR archive JFA.jar in a directory on the computer. Download and place the file jfa in a directory on the shell's search path. Edit jfa so that the variable jardir is set to the directory where JFA.jar is located.

Using JFA

Understanding the Interface

JFA appears slightly different depending on whether or not it was invoked by Forlan or not. If it was not invoked by Forlan, JFA works as a standalone application.

In standalone mode, users can work on multiple FAs simultaneously. Each FA is on its own tab. Also, standalone has a Close button as opposed to a Commit button. Other than this, the features for editing a FA are the same.

modes

state mode This button puts JFA in state mode. Clicking on an empty spot on the drawing area will create a new state. Editing operations may be aborted by pressing the escape key. An existing state can be dragged to a new position with the mouse. Right-clicking on a state will bring up a popup menu that will allow you to edit the state's properties or delete the state. (On Mac OS X, control-clicking should always be used instead of right-clicking.) Double clicking on an existing state will allow you to edit the state's label. Right-clicking on a transition will allow you to edit the label of the transition, or to reverse or delete the transition.

transition mode This button puts JFA in transition mode. Create new transitions by dragging the mouse pointer from the source state to the destination state. Edit, remove, or reverse an existing transition by right-clicking on the transition. A transition's label can also be edited by dragging the mouse pointer from the source state to the destination state.

snap to grid mode When the snap to grid mode is selected, states will be positioned at the lines of an invisible grid. This feature may be used to assist in FA layout. Snap to grid can also be activated temporarily by holding down the shift key.

FA Representation and Rules

JFA's visual representation of FAs resembles that used in the Forlan textbook. JFA also follows Forlan's rules for state names and transition labels (state names must be valid symbols, transition labels must be valid strings). JFA also performs simplification on all symbols and strings.

When a state's name is too long to be displayed entirely within the state, the name will be displayed simply as "...". The state's name has not been lost and can be seen by attempting to edit it.

Similarly, a transition's label is abbreviated to "..." when the transition's arc is too short. The label have not been lost and can be seen by attempting to edit it or by rearranging states so that the transition's arc is long enough.

File Formats

JFA currently supports 3 file formats:

Running JFA in Standalone Mode

JFA.jar is an executable JAR archive. On Windows, it can be executed by (double-)clicking on its shortcut, or by running jfa from the shell. On Mac OS X, it can be executed by double-clicking on it from the Finder, or by running jfa from the shell. On Linux, it can be executed by running jfa from the shell.

Running JFA from Forlan

Creating a New FA

To create a new FA using JFA, use the function

  jfaNew : unit -> fa

of the FA module:

  val fa = FA.jfaNew();

Forlan will launch a new instance of JFA, with a blank drawing area. After finishing changes to the FA, you must commit the FA in order for Forlan to obtain it.

Editing an Existing FA

To edit an existing FA using JFA, use the function

  jfaEdit : fa -> fa

of the FA module:

  val fa' = FA.jfaEdit fa;

Forlan will launch a new instance of JFA, with the FA that is being edited in the drawing area. After finishing changes to the FA, you must commit the FA in order for Forlan to obtain it.

Committing

JFA will prompt the user to commit the FA when the Commit button is clicked. The user can also commit the FA by attempting to close/exit JFA. If you do not commit an FA, all changes will be lost. Please note that JFA will only allow valid FAs to be committed.

Distribution

JFA is open source, released under the GNU General Public License. Its source is included as part of the Forlan distribution.


Alley Stoughton (stough@cis.ksu.edu)
Valid XHTML 1.0!   Valid CSS!