abbot.editor.recorder
Class Recorder

java.lang.Object
  extended by abbot.editor.recorder.Recorder
Direct Known Subclasses:
EventRecorder

public abstract class Recorder
extends Object

The Recorder provides a mechanism for recording an event stream and generating a sequence of script steps from that stream.

NOTE: when writing a recorder, be very careful not to test for platform-specific behavior, and avoid being susceptible to platform-specific bugs. Please make sure the recorder works on both pointer-focus and click-to-focus window managers, as well as on at least two platforms.


Constructor Summary
Recorder(Resolver resolver)
          Create a Recorder for use in converting events into script steps.
 
Method Summary
 void addActionListener(ActionListener al)
          The recorder supports zero or one listeners.
protected abstract  Step createStep()
          Create a step or sequence of steps based on the event stream so far.
 long getEventMask()
          Return the events of interest to this Recorder.
 long getLastEventTime()
           
protected  ActionListener getListener()
           
protected  Resolver getResolver()
           
 Step getStep()
          Return a step or sequence of steps representing the steps created thus far, or null if none.
 void insertStep(Step step)
          Insert an arbitrary step into the recording stream.
 void record(AWTEvent event)
          Process the given event.
protected abstract  void recordEvent(AWTEvent event)
          Implement this to actually handle the event.
protected  void setStatus(String msg)
          Indicate the current recording state, so that the status may be displayed elsewhere.
 void start()
          Start recording a new event stream.
abstract  void terminate()
          Indicate the end of the current event input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recorder

public Recorder(Resolver resolver)
Create a Recorder for use in converting events into script steps.

Method Detail

addActionListener

public void addActionListener(ActionListener al)
The recorder supports zero or one listeners.


getListener

protected ActionListener getListener()

start

public void start()
Start recording a new event stream.


terminate

public abstract void terminate()
                        throws RecordingFailedException
Indicate the end of the current event input stream.

Throws:
RecordingFailedException

getLastEventTime

public long getLastEventTime()

createStep

protected abstract Step createStep()
Create a step or sequence of steps based on the event stream so far.


getStep

public Step getStep()
Return a step or sequence of steps representing the steps created thus far, or null if none.


insertStep

public void insertStep(Step step)
Insert an arbitrary step into the recording stream.


record

public void record(AWTEvent event)
            throws RecordingFailedException
Process the given event.

Throws:
RecordingFailedException - if an error was encountered and recording should discontinue.

recordEvent

protected abstract void recordEvent(AWTEvent event)
                             throws RecordingFailedException
Implement this to actually handle the event.

Throws:
RecordingFailedException - if an error was encountered and recording should be discontinued.

getEventMask

public long getEventMask()
Return the events of interest to this Recorder.


getResolver

protected Resolver getResolver()
Returns:
the Resolver to be used by this Recorder.

setStatus

protected void setStatus(String msg)
Indicate the current recording state, so that the status may be displayed elsewhere.



Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge