Inheritance diagram for Pen:
Public Member Functions | |
Pen () | |
Can't use this constructor more than once, because you can only have ONE physical pen connected to the localhost's pen server. | |
Pen (String name) | |
Pen (String name, String penServerHostName) | |
void | addLivePenListener (PenListener penListener) |
Adds a low-level pen data listener to the live pen. | |
void | removeLivePenListener (PenListener penListener) |
Removes the pen listener from the live pen. | |
void | setLocalComPort (COMPort port) |
Customize the COM port, before going live. | |
void | setPenServerPort (int tcpipPort) |
Customize the port with which you will connect to the PenServer. | |
void | startLiveMode () |
Connects to the pen connection on the local machine, with the default com port. | |
void | startLiveMode (String hostDomainNameOrIPAddr) |
Set up connection to the pen server. | |
void | stopLiveMode () |
Exit live mode. | |
Static Public Attributes | |
static final COMPort | DEFAULT_COM_PORT = COMPort.COM5 |
PenStreamingConnection uses this to determine which COM port to connect to when looking for pen data. |
The Pen object abstracts the lower level connections with the streaming server/client, and dealing with batched ink input. It also interfaces with event handling in the system.
This software is distributed under the BSD License.
Definition at line 27 of file Pen.java.
Pen | ( | ) |
Pen | ( | String | name | ) |
Pen | ( | String | name, | |
String | penServerHostName | |||
) |
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 from PenInput.
Definition at line 92 of file Pen.java.
References PenClient.addPenListener(), and PenInput.isLive().
Referenced by CaptureApplication.addCalibrationHandler(), FlashWhiteboard.addPen(), SketchToPaperUI.addPenListener(), PenCoordinateDebugger.main(), and SketchToPaperUI.SketchToPaperUI().
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 from PenInput.
Definition at line 106 of file Pen.java.
References PenInput.isLive(), and PenClient.removePenListener().
Referenced by CaptureApplication.addCalibrationHandler().
void setLocalComPort | ( | COMPort | port | ) |
void setPenServerPort | ( | int | tcpipPort | ) |
void startLiveMode | ( | String | hostDomainNameOrIPAddr | ) |
Set up connection to the pen server.
The pen server is mapped to a physical pen attached to a some computer somewhere in the world. Starting livemode on a pen object just "attaches" it to an external server.
hostDomainNameOrIPAddr |
Definition at line 149 of file Pen.java.
References PenClient.addPenListener(), PenClient.connect(), PenInput.getName(), PenInput.isLive(), PenInput.liveMode, and PenInput.penListenersToAdd.
void startLiveMode | ( | ) | [virtual] |
Connects to the pen connection on the local machine, with the default com port.
This will ensure the PenServer on the local machine is running. This will be called by the PaperToolkit when you start an application.
Implements PenInput.
Definition at line 138 of file Pen.java.
Referenced by FlashWhiteboard.addPen(), PenCoordinateDebugger.main(), and SketchToPaperUI.SketchToPaperUI().