NumericControlAdapterpublic class NumericControlAdapter extends AtomicControlAdapter implements NumericControlA control that represents the state by a numeric value. The value can be any
number represented as a float as long as it falls within the range and
has the specified granularity/accuracy. For example, if the lower limit is
0 and the upper limit is 255 and the granularity is 1, then it can be assigned
any integer value from 0 to 255. |
Fields Summary |
---|
protected float | lowerLimit | protected float | upperLimit | protected float | defaultValue | protected float | granularity | protected boolean | logarithmic |
Constructors Summary |
---|
public NumericControlAdapter()
super(null, true, null);
lowerLimit = 0f;
upperLimit = 1.0f;
defaultValue = 0.5f;
granularity = 0.001f;
logarithmic = false;
| public NumericControlAdapter(float ll, float ul, float dv, float gran, boolean log, Component comp, boolean def, Control parent)
super(comp, def, parent);
lowerLimit = ll;
upperLimit = ul;
defaultValue = dv;
granularity = gran;
logarithmic = log;
|
Methods Summary |
---|
public float | getDefaultValue()Returns the value that is the default for this control.
return defaultValue;
| public float | getGranularity()Returns the granularity of the numeric value.
return granularity;
| public float | getLogarithmicBase()???
return (float) 0;
| public float | getLowerLimit()The smallest value assignable to this control.
return lowerLimit;
| public float | getUpperLimit()The largest value assignable to this control.
return upperLimit;
| public float | getValue()Returns the value that the control currently represents.
return (float) 0.0;
| public boolean | isLogarithmic()???
return logarithmic;
| public float | setDefaultValue(float value)Sets the default value for the control.
return (defaultValue = value);
| public float | setValue(float value)Sets the value on the control and returns the value that was actually
set.
return value;
|
|