|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwiiremotej.WiiRemoteMouse
public abstract class WiiRemoteMouse
An class for implementing mouse functionality using the Wii Remote. Note that the sensitivity value for the mouse is not related to the sensitivity for the devices it uses for input, i.e. increasing sensitivity on a IRMouse will not increase the sensitivity of the IR sensor in general. To invert the axes on any WiiRemoteMouse, simply supply negative values for sensitivity.
Field Summary | |
---|---|
protected double |
xSensitivity
The sensitivity of the X-axis. |
protected double |
ySensitivity
The sensitivity of the Y-axis. |
Constructor Summary | |
---|---|
protected |
WiiRemoteMouse(double xSensitivity,
double ySensitivity)
Constructs a new WiiRemoteMouse with the given sensitivity settings. |
Method Summary | |
---|---|
static WiiRemoteMouse |
getDefault()
Returns a mouse with default settings. |
double |
getXSensitivity()
Returns the X sensitivity of this "mouse." |
double |
getYSensitivity()
Returns the Y sensitivity of this "mouse." |
protected void |
moveMouse(double x,
double y,
boolean needsConversion)
Moves the mouse to the given coordinates. |
void |
setXSensitivity(double xSensitivity)
Sets the X sensitivity of this "mouse" to the given value. |
void |
setYSensitivity(double ySensitivity)
Sets the Y sensitivity of this "mouse" to the given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double xSensitivity
protected double ySensitivity
Constructor Detail |
---|
protected WiiRemoteMouse(double xSensitivity, double ySensitivity) throws java.awt.AWTException, java.lang.SecurityException
xSensitivity
- the sensitivity of the mouse on the X axis.ySensitivity
- the sensitivity of the mouse on the Y axis.
java.awt.AWTException
- if the platform configuration does not allow low-level input control. This exception is always
thrown when GraphicsEnvironment.isHeadless() returns true.
java.lang.SecurityException
- if createRobot permission is not granted.Method Detail |
---|
public double getXSensitivity()
xSensitivity
public double getYSensitivity()
ySensitivity
public void setXSensitivity(double xSensitivity)
xSensitivity
- the new X sensitivity value.xSensitivity
public void setYSensitivity(double ySensitivity)
ySensitivity
- the new Y sensitivity value.xSensitivity
protected void moveMouse(double x, double y, boolean needsConversion)
x
- the X coordinate.y
- the Y coordinate.needsConversion
- if true
, then the given coordinates are in percent-of-screen (0 to 1) and need to be converted to actual coordinates.
Percent-of-screen coordinates may be less than 0 or greater than 1 (they will be reduced by this method), as long as they are meant to be interpreted on a
0 to 1 scale.public static WiiRemoteMouse getDefault() throws java.awt.AWTException, java.lang.SecurityException
null
.
java.awt.AWTException
- if the platform configuration does not allow low-level input control. This exception is always
thrown when GraphicsEnvironment.isHeadless() returns true.
java.lang.SecurityException
- if createRobot permission is not granted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |