protected FloatControl(Type type,
float minimum,
float maximum,
float precision,
int updatePeriod,
float initialValue,
String units) {
this(type, minimum, maximum, precision, updatePeriod,
initialValue, units, "", "", "");
}
Constructs a new float control object with the given parameters.
The labels for the minimum, maximum, and mid-point values are set
to zero-length strings. Parameters:
type - the kind of control represented by this float control object
minimum - the smallest value permitted for the control
maximum - the largest value permitted for the control
precision - the resolution or granularity of the control.
This is the size of the increment between discrete valid values.
updatePeriod - the smallest time interval, in microseconds, over which the control
can change from one discrete value to the next during a shift
initialValue - the value that the control starts with when constructed
units - the label for the units in which the control's values are expressed,
such as "dB" or "frames per second"
Throws:
IllegalArgumentException - if {@code minimum} is greater
than {@code maximum} or {@code initialValue} does not fall
within the allowable range
|
protected FloatControl(Type type,
float minimum,
float maximum,
float precision,
int updatePeriod,
float initialValue,
String units,
String minLabel,
String midLabel,
String maxLabel) {
super(type);
if (minimum > maximum) {
throw new IllegalArgumentException("Minimum value " + minimum
+ " exceeds maximum value " + maximum + ".");
}
if (initialValue < minimum) {
throw new IllegalArgumentException("Initial value " + initialValue
+ " smaller than allowable minimum value " + minimum + ".");
}
if (initialValue > maximum) {
throw new IllegalArgumentException("Initial value " + initialValue
+ " exceeds allowable maximum value " + maximum + ".");
}
this.minimum = minimum;
this.maximum = maximum;
this.precision = precision;
this.updatePeriod = updatePeriod;
this.value = initialValue;
this.units = units;
this.minLabel = ( (minLabel == null) ? "" : minLabel);
this.midLabel = ( (midLabel == null) ? "" : midLabel);
this.maxLabel = ( (maxLabel == null) ? "" : maxLabel);
}
Constructs a new float control object with the given parameters Parameters:
type - the kind of control represented by this float control object
minimum - the smallest value permitted for the control
maximum - the largest value permitted for the control
precision - the resolution or granularity of the control.
This is the size of the increment between discrete valid values.
updatePeriod - the smallest time interval, in microseconds, over which the control
can change from one discrete value to the next during a shift
initialValue - the value that the control starts with when constructed
units - the label for the units in which the control's values are expressed,
such as "dB" or "frames per second"
minLabel - the label for the minimum value, such as "Left" or "Off"
midLabel - the label for the midpoint value, such as "Center" or "Default"
maxLabel - the label for the maximum value, such as "Right" or "Full"
Throws:
IllegalArgumentException - if {@code minimum} is greater
than {@code maximum} or {@code initialValue} does not fall
within the allowable range
|