edu.stanford.hci.r3.events.handlers
Class ClickHandler

java.lang.Object
  extended by edu.stanford.hci.r3.events.EventHandler
      extended by edu.stanford.hci.r3.events.handlers.ClickHandler
Direct Known Subclasses:
ClickAdapter

public abstract class ClickHandler
extends EventHandler

Unlike Java Swing's MouseListener, the Pen & Paper Click Handler cannot sense mouseover. Therefore, there is no analogue to mouseEntered, Exited.

This software is distributed under the BSD License.


Field Summary
protected  int clickCount
          Use this variable to see if there was a double click, while handing a clicked() event.
protected  int maxMillisBetweenMultipleClicks
           
 
Fields inherited from class edu.stanford.hci.r3.events.EventHandler
parentRegions
 
Constructor Summary
ClickHandler()
           
 
Method Summary
abstract  void clicked(PenEvent e)
           
 void handleEvent(PenEvent event)
          This method does the hard work of figuring out when a pen pressed, released, and clicked.
abstract  void pressed(PenEvent e)
           
abstract  void released(PenEvent e)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.stanford.hci.r3.events.EventHandler
addParentRegion, getParentRegions, showMe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clickCount

protected int clickCount
Use this variable to see if there was a double click, while handing a clicked() event.


maxMillisBetweenMultipleClicks

protected int maxMillisBetweenMultipleClicks
Constructor Detail

ClickHandler

public ClickHandler()
Method Detail

clicked

public abstract void clicked(PenEvent e)
Parameters:
e -

handleEvent

public void handleEvent(PenEvent event)
This method does the hard work of figuring out when a pen pressed, released, and clicked. It is up to the subclass to do something interesting with it once the events are triggered. We also use the 20 ms filter heuristic that the InkCollector uses. We assume people can't click faster than 20ms.

Specified by:
handleEvent in class EventHandler
See Also:
EventHandler.handleEvent(edu.stanford.hci.r3.events.PenEvent)

pressed

public abstract void pressed(PenEvent e)
Parameters:
e -

released

public abstract void released(PenEvent e)
Parameters:
e -

toString

public java.lang.String toString()
Specified by:
toString in class EventHandler
Returns:
the Event Handler's Name

Copyright 2006 Stanford University