|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfi.hut.tml.xsmiles.mlfc.io.directdevice.DirectDevice
| Field Summary | |
protected boolean[] |
button
|
protected boolean[] |
key
|
protected boolean[] |
oldbutton
|
protected boolean[] |
oldkey
|
protected int |
oldrx
|
protected int |
oldry
|
protected int |
oldrz
|
protected int |
oldx
|
protected int |
oldy
|
protected int |
oldz
|
protected int |
rx
|
protected int |
ry
|
protected int |
rz
|
protected int |
x
|
protected int |
y
|
protected int |
z
|
| Constructor Summary | |
protected |
DirectDevice()
Private constructor - this class should be instantiated with a call to createInstance(). |
| Method Summary | |
void |
addJoystickListener(JoystickListener listener)
Add a joystick listener to receive joystick chages, This will also start the sampling thread, if not running. |
void |
addKeyboardListener(KeyboardListener listener)
Add a keyboard listener to receive key chages, This will also start the sampling thread, if not running. |
static DirectDevice |
createInstance()
Create a instance of the DirectDevice class - platform dependent class is returned. |
boolean |
getButton(int num)
Get joystick button state. |
boolean |
getKeyboard(int num)
Get keyboard key state. |
int |
getRX()
Get joystick x-axis rotation value. |
int |
getRY()
Get joystick y-axis rotation value. |
int |
getRZ()
Get joystick z-axis rotation value. |
int |
getSamplingRate()
Get joystick state sampling rate. |
int |
getX()
Get joystick x-axis value. |
int |
getY()
Get joystick y-axis value. |
int |
getZ()
Get joystick z-axis value. |
void |
notifyJoystickListeners()
Remove a joystick listener, |
void |
notifyKeyboardListeners()
Remove a keyboard listener, |
void |
removeJoystickListener(JoystickListener listener)
Remove a joystick listener. |
void |
removeKeyboardListener(KeyboardListener listener)
Remove a keyboard listener. |
void |
run()
This is a thread sampling joystick every interval ms. |
protected void |
sample()
Sampling method - this class has a dummy implementation, but platform dependent subclasses are expected to override this and implement their own joystick sampling routine. |
void |
setSamplingRate(int rate)
Set joystick state sampling rate. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int x
protected int y
protected int z
protected int rx
protected int ry
protected int rz
protected boolean[] button
protected int oldx
protected int oldy
protected int oldz
protected int oldrx
protected int oldry
protected int oldrz
protected boolean[] oldbutton
protected boolean[] key
protected boolean[] oldkey
| Constructor Detail |
protected DirectDevice()
| Method Detail |
public static DirectDevice createInstance()
public int getSamplingRate()
public void setSamplingRate(int rate)
rate - Sampling rate, in millisecs.protected void sample()
public void run()
run in interface java.lang.Runnablepublic void addJoystickListener(JoystickListener listener)
listener - Joystick Listenerpublic void removeJoystickListener(JoystickListener listener)
listener - Joystick Listenerpublic void notifyJoystickListeners()
public void addKeyboardListener(KeyboardListener listener)
listener - Keyboard Listenerpublic void removeKeyboardListener(KeyboardListener listener)
listener - Keyboard Listenerpublic void notifyKeyboardListeners()
public int getX()
public int getY()
public int getZ()
public int getRX()
public int getRY()
public int getRZ()
public boolean getButton(int num)
num - Button number, 0-31
public boolean getKeyboard(int num)
num - Key number (pplatform dependent!)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||