Rebecca V1.0 User's Guide

Rebeccca v1.0 is a basic Java record/playback bean for Java applications that use the AWT or JFC classes.

Installation

Rebecca requires the following:

User's Guide

Main Console
The image to the left is Rebecca's main console.  It consists of a set of buttons similar to a VCR, a progress bar, an event display window, a timer, and an option button.  These controls are described in detail below.

Record Button
Press this button when you want to start recording events in your application. The events will be appended to the end of the list of events already recorded.

Play Button
Press this button when you want to playback recorded events. Playback will begin with the event highlighted in the event display window. To get to the beginning of the event list, press the Rewind Button. To get to the end of the list press the Fast Forward button.

Pause Button
Press this button when you want stop playback of events. Has the same effect as the Stop button. When you are ready to playback more events, press the Play Button again.

Rewind Button
Press this button when you want reset the next playback event to the beginning of the recorded event list.

Fast Forward Button
Press this button when you want reset the next playback event to the end of the recorded event list.

Stop Button
Press this button when you want stop record or playback of events. Has the same effect as the Pause Button. When you are ready to record more events, press the Record Button. When you are ready to playback more events, press the Play Button.

Timer Display
Displays the time the last event was played back relative to the first event in the event list. The display "00:00:000" shows minutes, seconds, and milliseconds.  For example, consider a recorded event list with three recorded events:
  • Event #1: Mouse Event, 10ms delay until next event
  • Event #2: Keyboard Event, 20ms delay until next event
  • Event #3: Mouse Event, 50ms delay until next event
If events 1 and 2 are played back and the Stop Button is pressed before event 3, then the Timer display will read "00:00:030".  Pressing the Rewind Button sets the display to "00:00:000".  Pressing the Fast Forward Button sets the display to cumulative time of all events in the event (e.g. "00:00:080" for the 3 event example).

Progress Bar
The Progress Bar shows the where the next event to playback is located relative to the beginning and end of the recorded event list.

Event List Display Window
The Event Display Window displays all events that have been recorded. The highlighted element is the last event that was played back. Each event element has the following format:
  • ms Delay
  • Component Event Occurred In
  • Event Type
  • (Event Specific Information)

For example, the highlighted event to the left has a 55ms delay before the MOUSE_MOVED (19,9) MouseEvent will be fired in the JTextField1 widget.

Options Panel
The Options Panel allows the user to: Save/Load/Erase recorded events, set single step playback, and control the playback delay. The panel is displayed by pressing the OPTIONS button on Rebecca's Main Panel.

 

Event List Data Options
The SAVE button will save the current recorded event list to a file. The LOAD button will load an event list file into Rebecca. The ERASE button will erase the current recorded event list.

 

Playback Single Step Options
Playback a single event for each press of the PLAY button. This option is turned OFF as a default.

 

Playback Delay Options
Controls playback delay between events. Selecting NONE will use no delay. Selecting RECORDED will use the delay when the events were recorded. Selecting FIXED will use the delay typed into the ms text field to the right of the radio button.

Sample Application

A sample program is included with Rebecca to ensure the installation went smoothly.  The program is a simple Java application that uses the JFrame, JButton, and JTextField components.  The user can type one line of text erase the text by pressing the button labeled "Clear".

Recording Session

To start the sample application type:

     java rebecca.bean.SampleApplication

You should see the sample application and Rebecca's main console appear on your display:

Notice that Rebecca's buttons are grayed and the event list window is empty.  No event data has been recorded yet. 

To begin recording events, press the RECORD button  on Rebecca's main console.  Again, notice that no event data is displayed in the event list window.  This is because the screen pointer is not yet in the sample application's window. 

Move the screen pointer to the application's window.  The event list window will immediately begin filling with event data from the mouse.  Click on the the JTextField to the right of the CLEAR JButton.  Type some text.  Notice that each key press results in several events being displayed in the event list window.

Move the screen pointer to back to Rebecca's main console.  Notice that as soon as the screen pointer leaves the sample application window, Rebecca stops recording events.

Press the STOP button.  Your recording session is complete.

Playback Session

Make sure that the STOP button has been pressed.  Move the screen pointer back to the sample application and press the CLEAR button.  This will erase the text typed in during the recording session. 

Move the screen pointer back to Rebecca's main console and press the PLAY button .  The PLAY button will turn gray immediately and STOP button will turn green.  Absolutely nothing else will happen!  Rebecca maintains a pointer to the current position in the event list (highlighted in the event list window).  The pointer indicates the last event that was playedback or recorded.  Rebecca will playback the next event after this pointer.  

Try to scroll down in the event list window to view events after the current position.  Observe that the current position is at the end of the event list.  This will always be true immediately after recording any events.  Rebecca has no events to playback because of the current position.

To get to the top of the event list, press the REWIND button .  Observe that the current position changes to the first event in the event list window.

Press the PLAY button.  The recorded session will playback and the text typed will appear in the sample application's text field.  When the playback is complete the PLAY button will TURN gray and the STOP button will turn green.

Save the Session

To save a recorded session, press the OPTIONS button on Rebecca's main console.  The options panel will be displayed.  Press the SAVE button on the options panel.  The dialog box will prompt you for a directory and filename to save the session under.

Connecting Rebecca to Java Program

In order to use Rebecca with your Java program, it must be connected programmatically.  Rebecca is a Java bean, so the connection can be made using a visual editor or in straight Java code.  The connection process is very simple.

Connecting Using a Visual Editor

 

The picture above shows Rebecca connected to the sample program from the previous section using the VisualAge visual editor.  The highest level component of the sample program is connected to the topComponent member of the Rebecca bean.  In the sample program, this is the top level JFrame.  Always connect your highest level GUI component to Rebecca's topComponent member.  The following table will help you determine which component to connect:

Application/Applet GUI Package Top Level Component
Application AWT Frame
Application JFC JFrame
Applet AWT Applet
Application JFC JApplet

Connecting Using a Java Code

Rebecca can be connected to your Java application using straight Java.  You will need to perform the following steps:

  1. Create an instance of the Rebecca bean, for example:

    ivjRebecca1 = new rebecca.bean.Rebecca();

  2. Set Rebecca's topComponent member to your highest level GUI component, for example:

    getRebecca1().setTopComponent(getJFrame1());

    and getJFrame1 () returns the highest level JFrame for the Java application

The table in Connecting Using a Visual Editor will help you determine which component to connect. 

Distribution

Rebbecca may be copied and distributed freely as long as credit is given to the author and no profit is made from the distribution.

Feedback

This software was funded in part by a grant National Science Foundation Grant #.  It is the basic framework on which I am building a multiuser record/playback architecure to help reduce the development time of multiuser synchronous software.  To read more about my research go here.

As long as it doesn't interfere with my thesis work too much, I'll try my best to fix serious bugs and incorporate suggestions into later releases of Rebecca.  I welcome your comments and suggestions.  Send email to: dugan@rpi.edu 

Known Problems

  • Only works for Static GUIs - If you application creates and destroys GUI components on the fly (e.g. create a dialog box, pop it up, hide it, remove references to it for garbage collection), then Rebecca won't work properly.  It traverses the GUI components ONCE when you Rebecca.setTopComponent() is called.
  • Doesn't work with Java2 - I do all my development using IBM's Visual Age for Java.  It's an incredible IDE, but right now it doesn't support Java2.  When Visual Age gets its act together, Rebecca will support Java2.
  • No way to recover Rebecca once it's been closed - Oops!  I'll get around to fixing this this soon.