wiiusej
Class WiiMoteEvent

java.lang.Object
  extended by wiiusej.WiiMoteEvent

public class WiiMoteEvent
extends java.lang.Object

Class that is a bean to be filled by the wiiuse API.

Author:
gduche

Constructor Summary
WiiMoteEvent()
          Default constructor
WiiMoteEvent(int id)
          Construct the Wiimote setting up the id.
 
Method Summary
 void addIRpoint(int x, int y)
          Add IR Point in the list (Max 4 points)
 void EmptyIRPoints()
          Clear IR points.
 float getBatteryLevel()
          Get battery level.
 short getButtonsHeld()
          get the int storing the buttons held
 short getButtonsJustPressed()
          Get the int storing the buttons just pressed
 short getButtonsJustReleased()
          Get the int storing the buttons just released
 GForce getGforce()
          Get the gravity force.
 Point2DInteger[] getIRPoints()
          Get list of IR points.
 short getLeds()
          Get status of the leds .
 Orientation getOrientation()
           
 int getWiimoteId()
          Get Wiimote ID
 boolean isButtonAHeld()
           
 boolean isButtonAJustPressed()
           
 boolean isButtonAJustReleased()
           
 boolean isButtonBHeld()
           
 boolean isButtonBJustPressed()
           
 boolean isButtonBJustReleased()
           
 boolean isButtonDownHeld()
           
 boolean isButtonDownJustPressed()
           
 boolean isButtonDownJustReleased()
           
 boolean isButtonHomeHeld()
           
 boolean isButtonHomeJustPressed()
           
 boolean isButtonHomeJustReleased()
           
 boolean isButtonLeftHeld()
           
 boolean isButtonLeftJustPressed()
           
 boolean isButtonLeftJustReleased()
           
 boolean isButtonMinusHeld()
           
 boolean isButtonMinusJustPressed()
           
 boolean isButtonMinusJustReleased()
           
 boolean isButtonOneHeld()
           
 boolean isButtonOneJustPressed()
           
 boolean isButtonOneJustReleased()
           
 boolean isButtonPlusHeld()
           
 boolean isButtonPlusJustPressed()
           
 boolean isButtonPlusJustReleased()
           
 boolean isButtonRightHeld()
           
 boolean isButtonRightJustPressed()
           
 boolean isButtonRightJustReleased()
           
 boolean isButtonTwoHeld()
           
 boolean isButtonTwoJustPressed()
           
 boolean isButtonTwoJustReleased()
           
 boolean isButtonUpHeld()
           
 boolean isButtonUpJustPressed()
           
 boolean isButtonUpJustReleased()
           
 boolean isConnected()
          True if the wiimote is connected false otherwise.
 boolean isIrActive()
          Tell if the IR Tracking is active.
 boolean isMotionSensingActive()
          Get the flag indicating if the motion sensing is active.
 boolean isRumbleActive()
          Get the status of rumble.
 boolean isSpeakerEnabled()
          Tell if the speaker is enable for this wiimote
 boolean isThereAttachment()
          Tell if there is an attachment to the Wiimote
 void setBatteryLevel(float batteryLevel)
          Set level battery.
 void setButtonsHeld(short buttonsHeld)
          set the int storing the buttons held
 void setButtonsJustPressed(short buttonsJustPressed)
          set the int storing the buttons just pressed
 void setButtonsJustReleased(short buttonsJustReleased)
          set the int storing the buttons just released
 void setConnected()
          Set the connected value to true.
 void setDisconnected()
          Set the connected value to false.
 void setGforce(float x, float y, float z)
          Set the gravity force.
 void setIrActive()
          Set the value isIrActive to true
 void setIrInactive()
          Set the value isIrActive to true
 void setLeds(short leds)
          Set Status of the leds.
 void setMotionSensingActive()
          Set the motion sensing flag to active.
 void setMotionSensingInactive()
          Set the motion sensing flag to inactive.
 void setOrientation(float r, float p, float y)
          Set orientation of the wiimote.
 void setRumbleActive()
          Set Rumble flag to Active.
 void setRumbleInactive()
          Set Rumble flag to Inactive.
 void setSpeakerDisabled()
          Set the flag for the speaker to "disabled"
 void setSpeakerEnabled()
          Set the flag for the speaker to "enabled"
 void setThereIsAnAttachment()
          Set the flag for the attachment to true
 void setThereIsNoAttachment()
          Set the flag for the attachment to false
 void setWiimoteId(int wiimoteId)
          Set Wiimote ID
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WiiMoteEvent

public WiiMoteEvent()
Default constructor


WiiMoteEvent

public WiiMoteEvent(int id)
Construct the Wiimote setting up the id.

Parameters:
id - the Wiimote id
Method Detail

getWiimoteId

public int getWiimoteId()
Get Wiimote ID

Returns:
the wiimote id.

setWiimoteId

public void setWiimoteId(int wiimoteId)
Set Wiimote ID

Parameters:
wiimoteId - id of the wiimote

isConnected

public boolean isConnected()
True if the wiimote is connected false otherwise.

Returns:
return the connected status.

setConnected

public void setConnected()
Set the connected value to true.


setDisconnected

public void setDisconnected()
Set the connected value to false.


getBatteryLevel

public float getBatteryLevel()
Get battery level.

Returns:
battery level. 1 = 100%

setBatteryLevel

public void setBatteryLevel(float batteryLevel)
Set level battery.

Parameters:
batteryLevel - must be between 0 and 1

getLeds

public short getLeds()
Get status of the leds .

Returns:
an int representing LEDS turned on.

setLeds

public void setLeds(short leds)
Set Status of the leds.

Parameters:
leds -

isSpeakerEnabled

public boolean isSpeakerEnabled()
Tell if the speaker is enable for this wiimote

Returns:
TRUE if it enabled false otherwise

setSpeakerEnabled

public void setSpeakerEnabled()
Set the flag for the speaker to "enabled"


setSpeakerDisabled

public void setSpeakerDisabled()
Set the flag for the speaker to "disabled"


isThereAttachment

public boolean isThereAttachment()
Tell if there is an attachment to the Wiimote

Returns:
TRUE if it there is one false otherwise

setThereIsAnAttachment

public void setThereIsAnAttachment()
Set the flag for the attachment to true


setThereIsNoAttachment

public void setThereIsNoAttachment()
Set the flag for the attachment to false


isRumbleActive

public boolean isRumbleActive()
Get the status of rumble.

Returns:
true if the rumble is active false otherwise

setRumbleActive

public void setRumbleActive()
Set Rumble flag to Active.


setRumbleInactive

public void setRumbleInactive()
Set Rumble flag to Inactive.


getButtonsJustPressed

public short getButtonsJustPressed()
Get the int storing the buttons just pressed

Returns:
the int storing the buttons just pressed

setButtonsJustPressed

public void setButtonsJustPressed(short buttonsJustPressed)
set the int storing the buttons just pressed

Parameters:
buttonsJustPressed -

getButtonsJustReleased

public short getButtonsJustReleased()
Get the int storing the buttons just released

Returns:
the int storing the buttons just released

setButtonsJustReleased

public void setButtonsJustReleased(short buttonsJustReleased)
set the int storing the buttons just released

Parameters:
buttonsJustReleased -

getButtonsHeld

public short getButtonsHeld()
get the int storing the buttons held

Returns:
the int storing the buttons held

setButtonsHeld

public void setButtonsHeld(short buttonsHeld)
set the int storing the buttons held

Parameters:
buttonsHeld -

isIrActive

public boolean isIrActive()
Tell if the IR Tracking is active.

Returns:
TRUE if it is active or false otherwise.

setIrActive

public void setIrActive()
Set the value isIrActive to true


setIrInactive

public void setIrInactive()
Set the value isIrActive to true


getIRPoints

public Point2DInteger[] getIRPoints()
Get list of IR points.

Returns:
the list of 2D points

addIRpoint

public void addIRpoint(int x,
                       int y)
Add IR Point in the list (Max 4 points)

Parameters:
x - x value
y - y value

EmptyIRPoints

public void EmptyIRPoints()
Clear IR points.


isMotionSensingActive

public boolean isMotionSensingActive()
Get the flag indicating if the motion sensing is active.

Returns:
true if the motion sensing is active false otherwise

setMotionSensingActive

public void setMotionSensingActive()
Set the motion sensing flag to active.


setMotionSensingInactive

public void setMotionSensingInactive()
Set the motion sensing flag to inactive.


getOrientation

public Orientation getOrientation()
Returns:
the orientation

setOrientation

public void setOrientation(float r,
                           float p,
                           float y)
Set orientation of the wiimote.

Parameters:
r - roll
p - pitch
y - yaw

getGforce

public GForce getGforce()
Get the gravity force.

Returns:
the gforce

setGforce

public void setGforce(float x,
                      float y,
                      float z)
Set the gravity force.

Parameters:
x - gravity force on x axis
y - gravity force on y axis
z - gravity force on z axis

isButtonOneJustPressed

public boolean isButtonOneJustPressed()

isButtonOneJustReleased

public boolean isButtonOneJustReleased()

isButtonOneHeld

public boolean isButtonOneHeld()

isButtonTwoJustPressed

public boolean isButtonTwoJustPressed()

isButtonTwoJustReleased

public boolean isButtonTwoJustReleased()

isButtonTwoHeld

public boolean isButtonTwoHeld()

isButtonAJustPressed

public boolean isButtonAJustPressed()

isButtonAJustReleased

public boolean isButtonAJustReleased()

isButtonAHeld

public boolean isButtonAHeld()

isButtonBJustPressed

public boolean isButtonBJustPressed()

isButtonBJustReleased

public boolean isButtonBJustReleased()

isButtonBHeld

public boolean isButtonBHeld()

isButtonLeftJustPressed

public boolean isButtonLeftJustPressed()

isButtonLeftJustReleased

public boolean isButtonLeftJustReleased()

isButtonLeftHeld

public boolean isButtonLeftHeld()

isButtonRightJustPressed

public boolean isButtonRightJustPressed()

isButtonRightJustReleased

public boolean isButtonRightJustReleased()

isButtonRightHeld

public boolean isButtonRightHeld()

isButtonUpJustPressed

public boolean isButtonUpJustPressed()

isButtonUpJustReleased

public boolean isButtonUpJustReleased()

isButtonUpHeld

public boolean isButtonUpHeld()

isButtonDownJustPressed

public boolean isButtonDownJustPressed()

isButtonDownJustReleased

public boolean isButtonDownJustReleased()

isButtonDownHeld

public boolean isButtonDownHeld()

isButtonMinusJustPressed

public boolean isButtonMinusJustPressed()

isButtonMinusJustReleased

public boolean isButtonMinusJustReleased()

isButtonMinusHeld

public boolean isButtonMinusHeld()

isButtonPlusJustPressed

public boolean isButtonPlusJustPressed()

isButtonPlusJustReleased

public boolean isButtonPlusJustReleased()

isButtonPlusHeld

public boolean isButtonPlusHeld()

isButtonHomeJustPressed

public boolean isButtonHomeJustPressed()

isButtonHomeJustReleased

public boolean isButtonHomeJustReleased()

isButtonHomeHeld

public boolean isButtonHomeHeld()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object