PenEvent Class Reference

List of all members.

Public Types

 DOWN
enum  PenEventModifier { DOWN, SAMPLE, UP }

Public Member Functions

 PenEvent (int thePenID, String thePenName, long time, PenSample sample)
void consume ()
 Consume this event.
PenSample getOriginalSample ()
 WARNING: This is a dangerous method to use, if you do not know what you are doing.
int getPenID ()
String getPenName ()
PercentageCoordinates getPercentageLocation ()
 It will give you a percentage location, from which you can derive actual coordinates (by converting to inches, etc).
StreamedPatternCoordinates getStreamedPatternCoordinate ()
 WARNING: See getOriginalSample().
long getTimestamp ()
PenEventModifier getType ()
boolean isConsumed ()
boolean isTypePenDown ()
boolean isTypePenUp ()
void setModifier (PenEventModifier modifier)
 TODO: Change this to an enum?
void setOriginalSample (PenSample sample)
 Very low level data in case you want to process it.
void setPenName (String name)
 The event engine will assign the pen name, which is the source of this event.
void setPercentageLocation (PercentageCoordinates location)
String toString ()

Detailed Description

Contains all the information we need to handle pen events. We can serialize

This software is distributed under the BSD License.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 18 of file PenEvent.java.


Constructor & Destructor Documentation

PenEvent ( int  thePenID,
String  thePenName,
long  time,
PenSample  sample 
)

Parameters:
thePenID 
thePenName 
time 
sample 

Definition at line 76 of file PenEvent.java.


Member Function Documentation

PenSample getOriginalSample (  ) 

WARNING: This is a dangerous method to use, if you do not know what you are doing.

The original pen samples have not been converted into the region's local coordinate system, so if the region happens to have tiled pattern, you may get unexpected results!

Use getPercentageLocation(...) instead!

Returns:
the raw pen sample

Definition at line 99 of file PenEvent.java.

Referenced by StrokeHandler.handleEvent(), EventEngine.handlePenEvent(), and RegionComponent.RegionComponent().

int getPenID (  ) 

Returns:
Which pen generated this event?

Definition at line 106 of file PenEvent.java.

String getPenName (  ) 

Returns:

Definition at line 113 of file PenEvent.java.

PercentageCoordinates getPercentageLocation (  ) 

It will give you a percentage location, from which you can derive actual coordinates (by converting to inches, etc).

This coordinate will be duplicated when a PEN_UP happens, because the coordinate will be set to the last known good coordinate (captured during a regular, non PEN_UP sample).

Returns:
the location of the event on the parent region.

Definition at line 124 of file PenEvent.java.

Referenced by LocationHandler.handleEvent(), InkCollector.handleEvent(), HandwritingRecognizer.handleEvent(), GestureHandler.handleEvent(), and RegionComponent.RegionComponent().

StreamedPatternCoordinates getStreamedPatternCoordinate (  ) 

WARNING: See getOriginalSample().

Do not use this value unless you _know_ what you are doing. It is OK to use this value if you are doing simple calculations and you are SURE that the samples all come from thes same pattern tile.

Returns:

Definition at line 135 of file PenEvent.java.

Referenced by EventEngine.handlePenEvent().

long getTimestamp (  ) 

Returns:
the timestamp of this event...

Definition at line 142 of file PenEvent.java.

Referenced by InkCollector.handleEvent(), HandwritingRecognizer.handleEvent(), ClickHandler.handleEvent(), and EventReplayManager.replay().

PenEventModifier getType (  ) 

Returns:
a flag to let us know what type of event this is... DOWN, SAMPLE, or UP

Definition at line 149 of file PenEvent.java.

boolean isConsumed (  ) 

Returns:
if this event should not be processed anymore

Definition at line 156 of file PenEvent.java.

boolean isTypePenDown (  ) 

Returns:
if this event object represents the pen touching down on the page

Definition at line 163 of file PenEvent.java.

Referenced by StrokeHandler.handleEvent(), InkCollector.handleEvent(), HandwritingRecognizer.handleEvent(), GestureHandler.handleEvent(), and ClickHandler.handleEvent().

boolean isTypePenUp (  ) 

Returns:
if this event object represents the pen lifting up from the page

Definition at line 170 of file PenEvent.java.

Referenced by StrokeHandler.handleEvent(), InkCollector.handleEvent(), HandwritingRecognizer.handleEvent(), GestureHandler.handleEvent(), ClickHandler.handleEvent(), and EventReplayManager.replay().

void setModifier ( PenEventModifier  modifier  ) 

TODO: Change this to an enum?

Parameters:
modifier 

Definition at line 179 of file PenEvent.java.

Referenced by EventReplayManager.createEventFromString().

void setOriginalSample ( PenSample  sample  ) 

Very low level data in case you want to process it.

Parameters:
sample 

Definition at line 188 of file PenEvent.java.

void setPenName ( String  name  ) 

The event engine will assign the pen name, which is the source of this event.

Parameters:
name 

Definition at line 197 of file PenEvent.java.

void setPercentageLocation ( PercentageCoordinates  location  ) 

Parameters:
location 

Definition at line 204 of file PenEvent.java.

Referenced by EventEngine.handlePenEvent(), and EventEngine.handlePenUpEvent().


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:41 2007 for R3 Paper Toolkit by  doxygen 1.4.7