wiiusej.wiiusejevents.physicalevents
Class JoystickEvent

java.lang.Object
  extended by wiiusej.wiiusejevents.GenericEvent
      extended by wiiusej.wiiusejevents.physicalevents.JoystickEvent

public class JoystickEvent
extends GenericEvent

Class that stores values on a joystick Event.

Author:
guiguito

Field Summary
private  float angle
           
private  short[] center
           
private  float magnitude
           
private  short[] max
           
private  short[] min
           
 
Constructor Summary
JoystickEvent(int id, float angle, float magnitude, short max1, short max2, short min1, short min2, short center1, short center2)
          Constructor of a JoystickEvent.
 
Method Summary
 float getAngle()
          Get angle the joystick is being held.
 short[] getCenter()
          Center joystick values.
 float getMagnitude()
          Get magnitude of the joystick (range 0-1).
 short[] getMax()
          Maximum joystick values.
 short[] getMin()
          Minimum joystick values.
 java.lang.String toString()
           
 
Methods inherited from class wiiusej.wiiusejevents.GenericEvent
getWiimoteId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

angle

private float angle

magnitude

private float magnitude

max

private short[] max

min

private short[] min

center

private short[] center
Constructor Detail

JoystickEvent

public JoystickEvent(int id,
                     float angle,
                     float magnitude,
                     short max1,
                     short max2,
                     short min1,
                     short min2,
                     short center1,
                     short center2)
Constructor of a JoystickEvent.

Parameters:
id - id of the wiimote connected.
angle - angle the joystick is being held.
magnitude - magnitude of the joystick (range 0-1).
max1 - maximum joystick value 1.
max2 - maximum joystick value 2.
min1 - minimum joystick value 1.
min2 - minimum joystick value 2.
center1 - center joystick value 1.
center2 - center joystick value 2.
Method Detail

getAngle

public float getAngle()
Get angle the joystick is being held.

Returns:
the angle angle the joystick.

getMagnitude

public float getMagnitude()
Get magnitude of the joystick (range 0-1).

Returns:
the magnitude magnitude of the joystick.

getMax

public short[] getMax()
Maximum joystick values.

Returns:
the max

getMin

public short[] getMin()
Minimum joystick values.

Returns:
the min

getCenter

public short[] getCenter()
Center joystick values.

Returns:
the center

toString

public java.lang.String toString()
Specified by:
toString in class GenericEvent