Inheritance diagram for PenInput:
Public Member Functions | |
PenInput (String penName) | |
void | addLivePenListener (PenListener penListener) |
Adds a low-level pen data listener to the live pen. | |
String | getName () |
boolean | isLive () |
void | removeLivePenListener (PenListener penListener) |
Removes the pen listener from the live pen. | |
void | setName (String nomDePlume) |
abstract void | startLiveMode () |
abstract void | stopLiveMode () |
Protected Attributes | |
boolean | liveMode = false |
TRUE if the PenInput object is currently connected to the underlying (physical or simulated) pen in streaming mode. | |
List< PenListener > | penListenersToAdd = new ArrayList<PenListener>() |
Cached pen listeners, so we can add them when/if you go live. |
This software is distributed under the BSD License.
Definition at line 21 of file PenInput.java.
PenInput | ( | String | penName | ) |
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.
penListener |
Reimplemented in Pen, and PenSimulator.
Definition at line 58 of file PenInput.java.
References PenInput.isLive(), and PenInput.penListenersToAdd.
String getName | ( | ) |
Definition at line 70 of file PenInput.java.
Referenced by Pen.startLiveMode().
boolean isLive | ( | ) |
Definition at line 77 of file PenInput.java.
References PenInput.liveMode.
Referenced by PenInput.addLivePenListener(), Pen.addLivePenListener(), Pen.removeLivePenListener(), and Pen.startLiveMode().
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.
penListener |
Reimplemented in Pen, and PenSimulator.
Definition at line 87 of file PenInput.java.
References PenInput.penListenersToAdd.
void setName | ( | String | nomDePlume | ) |
nomDePlume | For differentiating pens during debugging. |
Definition at line 98 of file PenInput.java.
Referenced by PenInput.PenInput().
List<PenListener> penListenersToAdd = new ArrayList<PenListener>() [protected] |
Cached pen listeners, so we can add them when/if you go live.
TODO: How will we handle batched events later on?
Definition at line 39 of file PenInput.java.
Referenced by PenInput.addLivePenListener(), PenInput.removeLivePenListener(), and Pen.startLiveMode().