at.wisch.joystick.event
Class ControllerBallEvent

java.lang.Object
  extended by org.lwjgl.input.ControllerEvent
      extended by at.wisch.joystick.event.AdvancedControllerEvent
          extended by at.wisch.joystick.event.ControllerBallEvent

public class ControllerBallEvent
extends AdvancedControllerEvent

The Class ControllerBallEvent. If this event occurs, it means that a trackball was moved.

Author:
Martin Wischenbart
See Also:
ControllerEventManager

Field Summary
 
Fields inherited from class at.wisch.joystick.event.AdvancedControllerEvent
BALL, POV
 
Fields inherited from class org.lwjgl.input.ControllerEvent
AXIS, BUTTON, POVX, POVY
 
Constructor Summary
ControllerBallEvent(Controller source, long timeStamp, int ballIndex, int[] deltas)
          Instantiates a new controller ball event.
 
Method Summary
 int[] getDeltas()
          Gets the deltas for X and Y axis.
 java.lang.String toString()
          Returns a String describing the ControllerBallEvent.
 
Methods inherited from class at.wisch.joystick.event.AdvancedControllerEvent
isBall, isPov, isPovX, isPovY, isXAxis, isYAxis
 
Methods inherited from class org.lwjgl.input.ControllerEvent
getControlIndex, getSource, getTimeStamp, isAxis, isButton
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControllerBallEvent

public ControllerBallEvent(Controller source,
                           long timeStamp,
                           int ballIndex,
                           int[] deltas)
Instantiates a new controller ball event.

Parameters:
source - the Controller that generated the event
timeStamp - the timestamp given for this event
ballIndex - the index of the trackball that has moved
deltas - the deltas describing the movement in X and Y direction (int array of size 2)
Method Detail

getDeltas

public int[] getDeltas()
Gets the deltas for X and Y axis. Use getControlIndex() to get the trackball index.

Returns:
the deltas (an int array of size 2, representing X and Y axis)
See Also:
ControllerEvent.getControlIndex()

toString

public java.lang.String toString()
Returns a String describing the ControllerBallEvent. This String contains the Joystick index, the trackball index and the trackball delta values.

Specified by:
toString in class AdvancedControllerEvent
Returns:
a String describing the ControllerBallEvent