j3d.org Code

org.j3d.device.input.spaceball
Class SpaceballTypeDetector

java.lang.Object
  extended byorg.j3d.device.input.spaceball.SpaceballTypeDetector

public class SpaceballTypeDetector
extends java.lang.Object

Class to automatically detect the type of the connected Spaceball device and instantiate the appropriate driver.

Currently Spaceball 2003, Spaceball 3003 and Spaceball 4000 are detected.

Spaceball, Spaceball 2003, Spaceball 3003 and Spaceball 4000 are Trademarks of Labtec Inc.

Version:
5. May 2001 Copyright (c) Dipl. Ing. Paul Szawlowski

Author:
Dipl. Ing. Paul Szawlowski - University of Vienna, Dept. of Medical Computer Sciences

Constructor Summary
SpaceballTypeDetector()
           
 
Method Summary
static SpaceballDriver createSpaceballDriver(java.lang.String portDescriptor, int timeout)
          Creates the appropriate driver object, claims ownership over the port and opens it for reading and writing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceballTypeDetector

public SpaceballTypeDetector()
Method Detail

createSpaceballDriver

public static SpaceballDriver createSpaceballDriver(java.lang.String portDescriptor,
                                                    int timeout)
                                             throws NoSuchPortException,
                                                    PortInUseException,
                                                    java.io.IOException,
                                                    UnsupportedCommOperationException
Creates the appropriate driver object, claims ownership over the port and opens it for reading and writing. The following settings will be done: Baudrate = 9600, 8 Databits, 1 Stopbit, no parity.

Blocking until response from the Spaceball device received or timeout period is over.

In order to receive data SpaceballDriver.enableDevice(int) must be called.

Parameters:
portDescriptor - Must be a descriptor of a serial port. For Windows 95 and Windows 98 the Java communications API will always enumerate the serial ports COMM 1 through COMM 4 and the parallel ports LPT1 and LPT2. For Windows NT the Java communications API will enumerate the serial ports entered in the Registry and the parallel port LPT1 and LPT2. For Solaris the Java communications API enumerates both the actual port names and the aliases to the ports.
timeout - for the Spaceball device response
Returns:
appropriate driver for the connected Spaceball device (cast to specific type if special functions are needed)
Throws:
java.io.IOException - If the device could not be detected.
NoSuchPortException
PortInUseException
UnsupportedCommOperationException

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org