|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwiiusej.Wiimote
public class Wiimote
Class that represents a wiimote. You can register as an observer of this wiimote to listen events from it. You manage it.
Field Summary | |
---|---|
private int |
id
|
private javax.swing.event.EventListenerList |
listeners
|
private WiiUseApiManager |
manager
|
Constructor Summary | |
---|---|
Wiimote(int idd,
WiiUseApiManager manager)
Constructor. |
Method Summary | |
---|---|
void |
activateContinuous()
Activate continuous. |
void |
activateIRTRacking()
Activate IR Tracking. |
void |
activateMotionSensing()
Activate motion sensing. |
void |
activateRumble()
Activate the rumble. |
void |
activateSmoothing()
Activate smoothing. |
void |
addWiiMoteEventListeners(WiimoteListener listener)
Add a WiimoteListener to the listeners list. |
void |
deactivateContinuous()
Deactivate continuous. |
void |
deactivateIRTRacking()
Deactivate IR Tracking. |
void |
deactivateMotionSensing()
Deactivate motion sensing. |
void |
deactivateRumble()
Deactivate the rumble. |
void |
deactivateSmoothing()
Deactivate smoothing. |
void |
disconnect()
Disconnect this wiimote. |
int |
getId()
Get the unique id of the wiimote. |
void |
getStatus()
Ask for the status of the wiimote. |
WiimoteListener[] |
getWiiMoteEventListeners()
Get the list of WiimoteListener. |
private void |
notifyDisconnectionEventListeners(DisconnectionEvent evt)
Notify WiimoteListener that a disconnection event occured. |
private void |
notifyNunchukInsertedEventListeners(NunchukInsertedEvent evt)
Notify WiimoteListener that a NunchukInserted Event occured. |
private void |
notifyNunchukRemovedEventListeners(NunchukRemovedEvent evt)
Notify WiimoteListener that a NunchukRemoved Event occured. |
private void |
notifyStatusEventListeners(StatusEvent evt)
Notify WiimoteListener that a status event occured. |
private void |
notifyWiiMoteEventListeners(WiimoteEvent evt)
Notify WiimoteListeners that an event occured. |
void |
onWiiUseApiEvent(WiiUseApiEvent e)
Method called when a WiiUseApiEvent occurs. |
void |
removeWiiMoteEventListeners(WiimoteListener listener)
Remove a WiimoteListener from the listeners list. |
void |
reSync()
Try to resync the wiimote by starting a new handshake. |
void |
setAccelerationThreshold(int th)
Set the acceleration threshold(minimum angle between two degrees with accelerometer). |
void |
setAlphaSmoothingValue(float th)
Set the alpha smoothing value. |
void |
setIrSensitivity(int level)
Set the IR sensitivity. |
void |
setLeds(boolean l1,
boolean l2,
boolean l3,
boolean l4)
Set leds status. |
void |
setNunchukAccelerationThreshold(int th)
Set the nunchuk acceleration threshold for the given id. |
void |
setNunchukOrientationThreshold(float th)
Set the nunchuk orientation threshold for the given id. |
void |
setOrientationThreshold(float th)
Set the orientation threshold (minimum angle between two degrees with accelerometer). |
void |
setScreenAspectRatio169()
Set the screen aspect ratio to be considered as 16/9. |
void |
setScreenAspectRatio43()
Set the screen aspect ratio to be considered as 4/3. |
void |
setSensorBarAboveScreen()
Set the sensor bar to be considered above the screen. |
void |
setSensorBarBelowScreen()
Set the sensor bar to be considered below the screen. |
void |
setTimeout(short normalTimeout,
short expansionTimeout)
Set the normal and expansion handshake timeouts for this wiimote. |
void |
setVirtualResolution(int x,
int y)
Set the screen resolution of the you are pointing at with your wiimote. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int id
private javax.swing.event.EventListenerList listeners
private WiiUseApiManager manager
Constructor Detail |
---|
public Wiimote(int idd, WiiUseApiManager manager)
idd
- id of the wiimotemanager
- manager wo built it.Method Detail |
---|
public int getId()
public void disconnect()
public void activateRumble()
public void deactivateRumble()
public void activateIRTRacking()
public void deactivateIRTRacking()
public void activateMotionSensing()
public void deactivateMotionSensing()
public void activateSmoothing()
public void deactivateSmoothing()
public void activateContinuous()
public void deactivateContinuous()
public void setLeds(boolean l1, boolean l2, boolean l3, boolean l4)
l1
- status of led1. True : ON, False : OFFl2
- status of led2. True : ON, False : OFFl3
- status of led3. True : ON, False : OFFl4
- status of led4. True : ON, False : OFFpublic void setOrientationThreshold(float th)
th
- threshold in degreespublic void setAccelerationThreshold(int th)
th
- thresholdpublic void setAlphaSmoothingValue(float th)
th
- thresholdpublic void setScreenAspectRatio43()
public void setScreenAspectRatio169()
public void setSensorBarAboveScreen()
public void setSensorBarBelowScreen()
public void setVirtualResolution(int x, int y)
x
- x resolution.y
- y resolution.public void setNunchukOrientationThreshold(float th)
th
- threshold in degrees.public void setNunchukAccelerationThreshold(int th)
th
- threshold.public void reSync()
public void getStatus()
public void setTimeout(short normalTimeout, short expansionTimeout)
normalTimeout
- The timeout in milliseconds for a normal read.expansionTimeout
- The timeout in millisecondsd to wait for an expansion
handshake.public void setIrSensitivity(int level)
level
- 1-5, same as Wii system sensitivity setting. If the level is <
1, then level will be set to 1. If the level is > 5, then
level will be set to 5.public void onWiiUseApiEvent(WiiUseApiEvent e)
onWiiUseApiEvent
in interface WiiUseApiListener
e
- the WiiUseApiEvent.public void addWiiMoteEventListeners(WiimoteListener listener)
listener
- a WiimoteListenerpublic void removeWiiMoteEventListeners(WiimoteListener listener)
listener
- a WiimoteListenerpublic WiimoteListener[] getWiiMoteEventListeners()
private void notifyWiiMoteEventListeners(WiimoteEvent evt)
evt
- GenericEvent occuredprivate void notifyStatusEventListeners(StatusEvent evt)
evt
- status event occuredprivate void notifyDisconnectionEventListeners(DisconnectionEvent evt)
evt
- disconnection event occuredprivate void notifyNunchukInsertedEventListeners(NunchukInsertedEvent evt)
evt
- NunchukInserted Event occuredprivate void notifyNunchukRemovedEventListeners(NunchukRemovedEvent evt)
evt
- NunchukRemoved Event occuredpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |