edu.stanford.hci.r3.events.replay
Class EventReplayManager

java.lang.Object
  extended by edu.stanford.hci.r3.events.replay.EventReplayManager

public class EventReplayManager
extends java.lang.Object

This class interacts with the EventEngine to simulate real-time input events. The events can be loaded from disk (XML files), and can be either batched or realtime events. Alternatively, events generated by an actual pen can be saved out to a file, for future replay.

This software is distributed under the BSD License.


Field Summary
static java.lang.String[] FILE_EXTENSION
           
 
Constructor Summary
EventReplayManager(EventEngine engine)
           
 
Method Summary
 void clearLoadedEvents()
           
 PenEvent createEventFromString(java.lang.String eventString)
          The inverse of createStringFromEvent(...).
 void loadEventDataFrom(java.io.File eventDataFile)
           
 void loadMostRecentEventData()
          Load the most recent event data file...
 void replay(java.util.List<PenEvent> events)
          Replays the list of events...
 void replayLoadedEvents()
          Replay the events that have been loaded, in the order that they appear in the list...
 void saveEvent(PenEvent event)
          Save this pen event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_EXTENSION

public static final java.lang.String[] FILE_EXTENSION
Constructor Detail

EventReplayManager

public EventReplayManager(EventEngine engine)
Parameters:
engine -
Method Detail

clearLoadedEvents

public void clearLoadedEvents()

createEventFromString

public PenEvent createEventFromString(java.lang.String eventString)
The inverse of createStringFromEvent(...). This creates a PenEvent object from one line of the eventData file.

Parameters:
eventString -
Returns:

loadEventDataFrom

public void loadEventDataFrom(java.io.File eventDataFile)
Parameters:
eventDataFile -

loadMostRecentEventData

public void loadMostRecentEventData()
Load the most recent event data file...


replay

public void replay(java.util.List<PenEvent> events)
Replays the list of events... Ideally, this should play it back at real time or some multiple of realtime... Threaded, because we do not want any GUI to block when calling this. Alternatively, refactor this into blocking & nonblocking versions.

Parameters:
events -

replayLoadedEvents

public void replayLoadedEvents()
Replay the events that have been loaded, in the order that they appear in the list...


saveEvent

public void saveEvent(PenEvent event)
Save this pen event. This is done automatically for events streamed through the Event Engine. In the future, we should probably log at the PenListener level too! This allows arbitrary event data save and replay.

Parameters:
event -

Copyright 2006 Stanford University