at.wisch.joystick.event
Class FeatureNotSupportedEvent

java.lang.Object
  extended by at.wisch.joystick.event.FeatureNotSupportedEvent

public class FeatureNotSupportedEvent
extends java.lang.Object

The Class FeatureNotSupportedEvent. A FeatureNotSupportedEvent occurs when a method is called with an illegal parameter, like requesting a joystick that does not exist, asking for a button's state which does not even exist, setting gain on a device that does not support it, trying to set a parameter for an FF effect that is not allowed, etc.

It is strongly recommended to listen to FeatureNotSupportedEvents, at least during development.

Author:
Martin Wischenbart
See Also:
FeatureNotSupportedEventManager, FeatureNotSupportedEventListener

Field Summary
static int AUTOCENTER
          The constant AUTOCENTER: device does not support setting autocenter.
static int AUTOCENTERVALUE
          The constant AUTOCENTERVALUE: illegal value for setting autocenter was submitted.
static int DIRECTION_IS_NULL
          The constant DIRECTION_IS_NULL: null was submitted, while it should have been an instance of Direction.
static int DIRECTIONVALUE
          The constant DIRECTIONVALUE: illegal value or array size for direction property was submitted.
static int EFFECT
          The constant EFFECT: device does not support the submitted type of effect.
static int EFFECTVALUE
          The constant EFFECTVALUE: illegal value or array size for effect property was submitted.
static int GAIN
          The constant GAIN: device does not support setting gain.
static int GAINVALUE
          The constant GAINVALUE: illegal value for setting gain was submitted.
static int PAUSE
          The constant PAUSE: device does not support pause/unpause.
 
Constructor Summary
FeatureNotSupportedEvent(int deviceIndex, int feature, int value)
          Instantiates a new FeatureNotSupportedEvent.
 
Method Summary
 int getDeviceIndex()
          Gets the the index of the Joystick where the event occured.
 int getFeature()
          Gets the feature that is not supported.
 int getValue()
          Gets the value for the feature that is not supported (not always used).
 java.lang.String toString()
          Returns a String describing the FeatureNotSupportedEvent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GAIN

public static final int GAIN
The constant GAIN: device does not support setting gain.

See Also:
Constant Field Values

GAINVALUE

public static final int GAINVALUE
The constant GAINVALUE: illegal value for setting gain was submitted.

See Also:
Constant Field Values

AUTOCENTER

public static final int AUTOCENTER
The constant AUTOCENTER: device does not support setting autocenter.

See Also:
Constant Field Values

AUTOCENTERVALUE

public static final int AUTOCENTERVALUE
The constant AUTOCENTERVALUE: illegal value for setting autocenter was submitted.

See Also:
Constant Field Values

PAUSE

public static final int PAUSE
The constant PAUSE: device does not support pause/unpause.

See Also:
Constant Field Values

EFFECT

public static final int EFFECT
The constant EFFECT: device does not support the submitted type of effect.

See Also:
Constant Field Values

EFFECTVALUE

public static final int EFFECTVALUE
The constant EFFECTVALUE: illegal value or array size for effect property was submitted.

See Also:
Constant Field Values

DIRECTION_IS_NULL

public static final int DIRECTION_IS_NULL
The constant DIRECTION_IS_NULL: null was submitted, while it should have been an instance of Direction.

See Also:
Constant Field Values

DIRECTIONVALUE

public static final int DIRECTIONVALUE
The constant DIRECTIONVALUE: illegal value or array size for direction property was submitted.

See Also:
Constant Field Values
Constructor Detail

FeatureNotSupportedEvent

public FeatureNotSupportedEvent(int deviceIndex,
                                int feature,
                                int value)
Instantiates a new FeatureNotSupportedEvent.

Parameters:
deviceIndex - the index of the Joystick where the event occured
feature - the feature that is not supported (one of the constants defined in this class)
value - the value for the feature that is not supported (not always used)
Method Detail

getDeviceIndex

public int getDeviceIndex()
Gets the the index of the Joystick where the event occured.

Returns:
the device index where the event occured

getFeature

public int getFeature()
Gets the feature that is not supported. That is one of the constants that are defined in this class.

Returns:
the feature constant (one of the constants defined in this class)

getValue

public int getValue()
Gets the value for the feature that is not supported (not always used).

Returns:
the value for the feature that is not supported (usually 0 if not used)

toString

public java.lang.String toString()
Returns a String describing the FeatureNotSupportedEvent. Examples: "Feature not supported: Joystick 0 Button -5 does not exist.", "Feature not supported: Joystick 1 does not support setting autocenter."

Overrides:
toString in class java.lang.Object
Returns:
a String describing the FeatureNotSupportedEvent