EventHandler Class Reference

Inheritance diagram for EventHandler:

ClickHandler CrossHandler DragHandler GestureHandler HandwritingRecognizer InkCollector LocationHandler StrokeHandler List of all members.

Public Member Functions

void addParentRegion (Region r)
List< RegiongetParentRegions ()
abstract void handleEvent (PenEvent event)
 if this event should be consumed (i.e., lower priority event handlers should not see this event), we should set the event.consumed property to true
void showMe (String message)
abstract String toString ()

Protected Attributes

List< RegionparentRegions = new ArrayList<Region>()
 This is used in debugging visualizations, for traversing up the list to figure out where the event handler should be positioned.

Detailed Description

This is the super interface of all the other event handlers. These are the pen & paper analogues to Java Swing's EventListener architecture. We changed it to an abstract class in ver. 0.5, as now handlers should have access to their parent regions.... Event Handlers can be added to multiple regions (is this unique?)

We have merged Filters into Event Handlers. Filters are both similar to and different from EventHandlers. They are similar in the sense that they can be added to regions. When ink is written on a region, the data will be sent to a filter that is attached to that region.

Filters are different that event handlers because they transform incoming pen data into something qualitatively different, instead of just telling a piece of code that an event has arrived. For example, one could implement a filter that inverts pen samples' y value on a page (dunno why, but it's a fun example). Then, you can add an event handler to this filter. The event handler would then get PenEvents with upside down pen samples.

A more intricate filter would be an ink container. It can collect all ink that passes through the filter, and tell a handler that new ink has arrived. Whenever the handler needs the ink, it can request it from the ink container. Because of the custom nature of filters, it might be that each filter has a custom event handler. For example, an InkContainer might have an InkContainer listener. We can implement these as inner classes.

Filters can change the incoming event stream. For example, it might only care about events that affect certain parts of the region. Events that are not close to these parts will be ignored.

This software is distributed under the BSD License.

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

Definition at line 53 of file EventHandler.java.


Member Function Documentation

abstract String toString (  )  [pure virtual]

Returns:
the Event Handler's Name

Implemented in ClickHandler, GestureHandler, HandwritingRecognizer, InkCollector, and StrokeHandler.


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