|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.j3d.device.input.spaceball.SpaceballDriver
org.j3d.device.input.spaceball.Spaceball4000Driver
Driver for Labtec's Spaceball 4000 device.
Spaceball and Spaceball 4000 are Trademarks of Labtec Inc.
| Field Summary |
| Fields inherited from class org.j3d.device.input.spaceball.SpaceballDriver |
itsButtonData, itsPositionData, itsWriteBuffer |
| Constructor Summary | |
Spaceball4000Driver(SerialPort serialPort,
java.io.InputStream inputStream,
java.io.OutputStream outputStream)
|
|
| Method Summary | |
void |
disableDevice(int timeout)
Ceases postion data transfer from the Spaceball device. |
protected void |
dispatch(byte[] readBuffer,
int dataStart,
int dataLength,
int header)
|
void |
emitSingleBeep()
Emits a single beep. |
void |
emitSingleBeep(int timeout)
Emits a single beep. |
void |
enableAutoRezero(int timeout,
boolean enable)
|
void |
enableCubicSensitivity(int timeout,
boolean enable)
|
void |
enableDevice(int timeout)
Requests data from the Spaceball 4000 device. |
void |
getDeviceDescriptor(int timeout)
|
void |
getDeviceInfo(int timeout)
|
void |
processAutoRezeroResponse(int autoZeroPeriod,
int autoZeroWindow,
boolean enabled)
Overriding methods shall call this method. |
void |
processDeviceInfoResponse(int type,
int lineNumber,
java.lang.String content)
Method for processing device info events. |
void |
processSensitivityResponse(byte value)
Overriding methods shall call this method. |
void |
rezeroDevice(int timeout)
|
void |
setHandedness(int handedness)
Method to process the handedness response. |
void |
setNumOfButtons(int numOfButtons)
Method to process the number of buttons of the device. |
| Methods inherited from class org.j3d.device.input.spaceball.SpaceballDriver |
close, emitPatternedBeep, getLastButtonValues, getLastPositionValues, getNumOfButtons, getSerialPort, openPort, pause, printBuffer, processEchoResponse, processError, processRequestResponse, read, resetDevice, waitForResponse, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.j3d.device.input.spaceball.Spaceball4000CallbackInterface |
processEchoResponse, processError, processRequestResponse |
| Constructor Detail |
public Spaceball4000Driver(SerialPort serialPort,
java.io.InputStream inputStream,
java.io.OutputStream outputStream)
throws java.io.IOException
| Method Detail |
protected void dispatch(byte[] readBuffer,
int dataStart,
int dataLength,
int header)
dispatch in class SpaceballDriver
public void enableDevice(int timeout)
throws java.io.IOException
SpaceballDriver#open in order to receive position data. The
first data packet will be "null-data" packet (all position data is set
to zero).Blocking until response from device received or timeout is over.
enableDevice in class SpaceballDrivertimeout - [ms] timeout for response from the Spaceball device
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
port
public void disableDevice(int timeout)
throws java.io.IOException
disableDevice in class SpaceballDrivertimeout - [ms] timeout for response from the Spaceball device
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
port
public void emitSingleBeep(int timeout)
throws java.io.IOException
timeout - for response from the Spaceball device.
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
portSpaceballPacket.createSimpleRequestPacket(byte[], int, byte)
public void emitSingleBeep()
throws java.io.IOException
java.io.IOException - if an error occurs during reading the serial portSpaceballPacket.createSimpleRequestPacket(byte[], int, byte)
public void rezeroDevice(int timeout)
throws java.io.IOException
java.io.IOException
public void enableAutoRezero(int timeout,
boolean enable)
throws java.io.IOException
timeout - for response from the Spaceball device.enable - true = auto rezero enabled, false = auto rezero disabled
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
portSpaceball4000Packet.createEnableDisableAutoRezeroPacket(byte[], int, boolean)
public void enableCubicSensitivity(int timeout,
boolean enable)
throws java.io.IOException
timeout - for response from the Spaceball device.enable - true = cubic sensitivity, false = standard sensitivity
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
portSpaceball4000Packet.createCubicSensitivityEnableDisablePacket(byte[], int, boolean)
public void getDeviceDescriptor(int timeout)
throws java.io.IOException
timeout - for response from the Spaceball device.
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
portSpaceballPacket.createSimpleRequestPacket(byte[], int, byte)
public void getDeviceInfo(int timeout)
throws java.io.IOException
timeout - for response from the Spaceball device.
java.io.IOException - if timeout is reached without a response from the
Spaceball device or if an error occurs during reading the serial
portSpaceballPacket.createSimpleRequestPacket(byte[], int, byte)
public void processDeviceInfoResponse(int type,
int lineNumber,
java.lang.String content)
Spaceball4000CallbackInterface
processDeviceInfoResponse in interface Spaceball4000CallbackInterfaceprocessDeviceInfoResponse in class SpaceballDriverpublic void processSensitivityResponse(byte value)
processSensitivityResponse in interface Spaceball4000CallbackInterfacevalue - use constants
Spaceball4000Packet.CUBIC_SENSITIVITY_ENABLED
Spaceball4000Packet.STANDARD_SENSITIVITY_ENABLED
public void processAutoRezeroResponse(int autoZeroPeriod,
int autoZeroWindow,
boolean enabled)
processAutoRezeroResponse in interface Spaceball4000CallbackInterfaceautoZeroPeriod - [ms] 0 <= autoZeroPeriod <= 0xFFFFautoZeroWindow - [raw reading units] 0 <=
autoZeroWindow < 0xFFenabled - true if auto-rezero is enabledpublic void setHandedness(int handedness)
Spaceball4000CallbackInterface
setHandedness in interface Spaceball4000CallbackInterfacehandedness - use constants
Spaceball4000DeviceDescriptor#LEFT,
Spaceball4000DeviceDescriptor#RIGHTpublic void setNumOfButtons(int numOfButtons)
Spaceball4000CallbackInterface
setNumOfButtons in interface Spaceball4000CallbackInterfacesetNumOfButtons in class SpaceballDriver
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||