com.mtp.pounder
Class VerbatimRecording

java.lang.Object
  |
  +--com.mtp.pounder.VerbatimRecording
All Implemented Interfaces:
AWTEventListener, EventListener, KeyEventDispatcher, Recording

public class VerbatimRecording
extends Object
implements AWTEventListener, Recording, KeyEventDispatcher

Records all AWT events sent.

Author:
Matthew Pekar

Field Summary
protected  ComponentIdentifierFactory componentIdentifierFactory
           
static long DEFAULT_MAX_IDLE_TIME
          After idle for this long we terminate.
protected  boolean dragging
          Whether or not a drag is currently occuring.
protected  int dragStartButtons
          Mask of buttons that were pressed when the drag started.
protected  Filter filter
           
protected  boolean finished
           
protected  long lastTimeItemRecorded
           
protected  long mask
           
protected  long maxIdleTime
           
protected  boolean paused
           
protected  PounderPrefs prefs
           
protected  RecordingRecord record
           
protected  WindowWatcher windowWatcher
           
 
Constructor Summary
VerbatimRecording(PounderPrefs prefs)
           
VerbatimRecording(PounderPrefs prefs, long maxIdleTime)
           
 
Method Summary
protected  void addListeners()
           
protected  int addMouseReleaseEvent(int button, Component c, int windowID, int startModifiers, int x, int y, long delay)
           
 void begin(RecordingRecord record, WindowWatcher ww)
          Begin recording on given Frame and add to the given RecordingRecord.
protected  void checkIsDragEnd(MouseEvent me, long delay)
          Check whether the given MouseEvent is the end of a drag.
protected  void checkMouseReleaseEndsDrag(MouseEvent me)
          Check whether the mouse release event should end the drag.
 boolean dispatchKeyEvent(KeyEvent e)
           
protected  void endDrag(MouseEvent me, long delay)
          Release any mouse buttons that were not pressed at the start.
 void eventDispatched(AWTEvent e)
           
protected  boolean eventShouldBeIgnored(AWTEvent e)
           
protected  int getWindowID(Component c)
           
 boolean isFinished()
           
 boolean isPaused()
           
protected  void matchEvent(AWTEvent e)
          See if this event is one we'd like to record, and do so if it is.
protected  RecordingItem matchMouseEvent(MouseEvent me, long delay, VerbatimRecordingOptions options)
          Return a RecordingItem to represent the given MouseEvent if possible.
protected  void removeListeners()
           
 void setPaused(boolean b)
           
protected  void startDrag(MouseEvent me)
          Store data necessary to recover from a drag.
 void terminate()
          Terminate recording.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_IDLE_TIME

public static final long DEFAULT_MAX_IDLE_TIME
After idle for this long we terminate.

See Also:
Constant Field Values

windowWatcher

protected WindowWatcher windowWatcher

mask

protected long mask

finished

protected boolean finished

paused

protected boolean paused

record

protected RecordingRecord record

lastTimeItemRecorded

protected long lastTimeItemRecorded

filter

protected Filter filter

maxIdleTime

protected long maxIdleTime

prefs

protected PounderPrefs prefs

componentIdentifierFactory

protected ComponentIdentifierFactory componentIdentifierFactory

dragging

protected boolean dragging
Whether or not a drag is currently occuring.


dragStartButtons

protected int dragStartButtons
Mask of buttons that were pressed when the drag started.

Constructor Detail

VerbatimRecording

public VerbatimRecording(PounderPrefs prefs)

VerbatimRecording

public VerbatimRecording(PounderPrefs prefs,
                         long maxIdleTime)
Method Detail

begin

public void begin(RecordingRecord record,
                  WindowWatcher ww)
Description copied from interface: Recording
Begin recording on given Frame and add to the given RecordingRecord.

Specified by:
begin in interface Recording
Parameters:
ww - The WindowWatcher used to track Window's in the recording.

addListeners

protected void addListeners()

isFinished

public boolean isFinished()
Specified by:
isFinished in interface Recording

terminate

public void terminate()
Terminate recording.

Specified by:
terminate in interface Recording

removeListeners

protected void removeListeners()

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent e)
Specified by:
dispatchKeyEvent in interface KeyEventDispatcher

getWindowID

protected int getWindowID(Component c)

eventShouldBeIgnored

protected boolean eventShouldBeIgnored(AWTEvent e)

setPaused

public void setPaused(boolean b)
Specified by:
setPaused in interface Recording

isPaused

public boolean isPaused()
Specified by:
isPaused in interface Recording

eventDispatched

public void eventDispatched(AWTEvent e)
Specified by:
eventDispatched in interface AWTEventListener

matchEvent

protected void matchEvent(AWTEvent e)
See if this event is one we'd like to record, and do so if it is.


startDrag

protected void startDrag(MouseEvent me)
Store data necessary to recover from a drag. Swing ignores a very important mouse release.


endDrag

protected void endDrag(MouseEvent me,
                       long delay)
Release any mouse buttons that were not pressed at the start.


addMouseReleaseEvent

protected int addMouseReleaseEvent(int button,
                                   Component c,
                                   int windowID,
                                   int startModifiers,
                                   int x,
                                   int y,
                                   long delay)

checkIsDragEnd

protected void checkIsDragEnd(MouseEvent me,
                              long delay)
Check whether the given MouseEvent is the end of a drag. If so call endDrag().


checkMouseReleaseEndsDrag

protected void checkMouseReleaseEndsDrag(MouseEvent me)
Check whether the mouse release event should end the drag. Set 'dragging' to false if it does.


matchMouseEvent

protected RecordingItem matchMouseEvent(MouseEvent me,
                                        long delay,
                                        VerbatimRecordingOptions options)
Return a RecordingItem to represent the given MouseEvent if possible.



Copyright © 2002 Matthew Pekar. All Rights Reserved.