org.jagatoo.input.devices.components
Class AnalogDeviceComponent
java.lang.Object
org.jagatoo.input.devices.components.DeviceComponent
org.jagatoo.input.devices.components.AnalogDeviceComponent
- Direct Known Subclasses:
- ControllerAxis, MouseAxis, MouseWheel
public class AnalogDeviceComponent
- extends DeviceComponent
Abstraction of all DeviceComponents, that can have values in a range.
| Methods inherited from class org.jagatoo.input.devices.components.DeviceComponent |
bindAction, bindAction, getDeviceComponentID, getLocalizedName, getName, getType, isAnalog, isDigital, notifyBoundActions, unbindAction, unbindAction |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnalogDeviceComponent
protected AnalogDeviceComponent(DeviceComponent.Type type,
java.lang.String name)
- Creates a new
AnalogDeviceComponent.
- Parameters:
type - the typename - the component's name
setValue
protected void setValue(int intValue,
float floatValue)
setValue
public final void setValue(int value)
setValue
public final void setValue(float value)
addValue
public final void addValue(int deltaValue)
addValue
public final void addValue(float deltaValue)
getIntValue
public final int getIntValue()
- Returns:
- the current value as an int.
This is always scale * floatValue.
getFloatValue
public final float getFloatValue()
- Returns:
- the current value as a float.
This is always intValue / scale.
setScale
public void setScale(float scale)
- Sets the scale factor to convert the int- and float-values.
- Parameters:
scale -
getScale
public final float getScale()
- Returns:
- the scale factor to convert the int- and float-values.