net.jinx.action.input.robot
Interface Control

All Known Implementing Classes:
AbstractControl, AxisControl, ButtonControl, SliderControl, ToggleButtonControl

public interface Control

Control represents an internal variable in a Robot. This can be attached to just about anything with nearly any purpose. Using the setValue(float) method will affect the Robot's state.

API Stability: Alpha.


Field Summary
static int TYPE_AXIS
          Type ID for an axis that varies in value from -1 to 1.
static int TYPE_BUTTON
          Type ID for a momentary push button that is on while pressed.
static int TYPE_SLIDER
          Type ID for an axis with a range of 0 to 1.
static int TYPE_TOGGLE
          Type ID for a toggle button that toggles when pressed.
 
Method Summary
 java.lang.String getName()
          Provides the human-readable name of this control.
 int getType()
          Provides a way to identify how this control should be treated and what range of input values it will expect.
 float getValue()
          Provides the current value of this control.
 void setValue(float val)
          Sets the value of this control.
 

Field Detail

TYPE_AXIS

static final int TYPE_AXIS
Type ID for an axis that varies in value from -1 to 1.

See Also:
Constant Field Values

TYPE_SLIDER

static final int TYPE_SLIDER
Type ID for an axis with a range of 0 to 1.

See Also:
Constant Field Values

TYPE_BUTTON

static final int TYPE_BUTTON
Type ID for a momentary push button that is on while pressed. Expects values that are either zero or one.

See Also:
Constant Field Values

TYPE_TOGGLE

static final int TYPE_TOGGLE
Type ID for a toggle button that toggles when pressed. Expects values that are either zero or one.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Provides the human-readable name of this control.

Returns:
the name.

setValue

void setValue(float val)
Sets the value of this control.

Parameters:
val - a float value from negetive one to one; zero indicates the control is completely off and one indicates it is completely on. The sign of this value indicates direction. Any value outside this range should be clamped (less than negetive one becomes negetive one; greater than one becomes one). For buttons, they should round all states to either zero or one.

getValue

float getValue()
Provides the current value of this control.

Returns:
a float from negetive one to one. Zero indicates the control is off. One indicates the control is on. Sign indicates direction. Values inbetween indicate a state somewhere inbetween.

getType

int getType()
Provides a way to identify how this control should be treated and what range of input values it will expect.

Returns:
the type ID for the control. This can be any of the TYPE_* values.