PenSimulator Class Reference

Inheritance diagram for PenSimulator:

PenInput List of all members.

Public Member Functions

 PenSimulator ()
void addLivePenListener (PenListener penListener)
 Adds a low-level pen data listener to the live pen.
Override void mouseClicked (MouseEvent e)
Override void mouseDragged (MouseEvent e)
Override void mouseEntered (MouseEvent arg0)
Override void mouseExited (MouseEvent arg0)
Override void mouseMoved (MouseEvent arg0)
Override void mousePressed (MouseEvent e)
Override void mouseReleased (MouseEvent e)
void removeLivePenListener (PenListener penListener)
 Removes the pen listener from the live pen.
Override void startLiveMode ()
Override void stopLiveMode ()

Detailed Description

Opens a JFrame/JPanel that the user can draw on with his mouse or Tablet stylus. This will simulate a digital pen. We can make the pen activate by holding the left mouse button down.

This also contains a simple r-theta based ink simplification algorithm. Basically, if the distance of the current point is sufficiently far from the last two points, in terms of distance (r) or direction (theta), then we trigger a new pen sample. This algorithm might be applied to actual pen input in the future, to achieve ink simplification/beautification, etc.

This software is distributed under the BSD License.

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

Definition at line 38 of file PenSimulator.java.


Member Function Documentation

void addLivePenListener ( PenListener  penListener  ) 

Adds a low-level pen data listener to the live pen.

You SHOULD call this after starting live mode.... However, we can cache the listener for you, if you really want. This is to eliminate annoying ordering constraints.

Subclasses *should* override this, and call the super, to actually make use of PenListeners.

Parameters:
penListener 
Returns:
true if we cached the pen listener on the penListenersToAdd list

Reimplemented from PenInput.

Definition at line 53 of file PenSimulator.java.

void removeLivePenListener ( PenListener  penListener  ) 

Removes the pen listener from the live pen.

Subclasses *should* override this, and call the super's implementation if necessary, to actually make use of PenListeners.

Parameters:
penListener 

Reimplemented from PenInput.

Definition at line 150 of file PenSimulator.java.


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