javax.sound.sampled

Class FloatControl

public abstract class FloatControl extends Control

Since: 1.3

Nested Class Summary
static classFloatControl.Type
An instance of this class describes a particular floating point control.
Constructor Summary
protected FloatControl(FloatControl.Type type, float min, float max, float prec, int update, float init, String units)
Create a new FloatControl given its type and various parameters.
protected FloatControl(FloatControl.Type type, float min, float max, float prec, int update, float init, String units, String minLabel, String midLabel, String maxLabel)
Create a new FloatControl given its type and various parameters.
Method Summary
floatgetMaximum()
Return the maximum value of this control.
StringgetMaxLabel()
Return the label for the minimum value of this control.
StringgetMidLabel()
Return the label for the midpoint of this control.
floatgetMinimum()
Return the minimum value of this control.
StringgetMinLabel()
Return the label for the minimum value of this control.
floatgetPrecision()
Return the precision of this control.
StringgetUnits()
Return the name of the units for this control.
intgetUpdatePeriod()
Return the update period of this control.
floatgetValue()
Return the current value of this control.
voidsetValue(float value)
Set the new value of this control.
voidshift(float from, float to, int ms)
This tells the control to start at the starting value and to shift its value incrementally to the final value over the given time interval, specified in microseconds.
StringtoString()
Return a string describing this control.

Constructor Detail

FloatControl

protected FloatControl(FloatControl.Type type, float min, float max, float prec, int update, float init, String units)
Create a new FloatControl given its type and various parameters. The minimum, maximum, and midpoint labels will all be the empty string.

Parameters: type the type min the minimum valuee max the maximum value prec the precision update the update period init the initial value units the description of the units

FloatControl

protected FloatControl(FloatControl.Type type, float min, float max, float prec, int update, float init, String units, String minLabel, String midLabel, String maxLabel)
Create a new FloatControl given its type and various parameters.

Parameters: type the type min the minimum valuee max the maximum value prec the precision update the update period init the initial value units the description of the units minLabel the label for the minimum value midLabel the label for the midpoint maxLabel the label for the maximum value

Method Detail

getMaximum

public float getMaximum()
Return the maximum value of this control.

getMaxLabel

public String getMaxLabel()
Return the label for the minimum value of this control.

getMidLabel

public String getMidLabel()
Return the label for the midpoint of this control.

getMinimum

public float getMinimum()
Return the minimum value of this control.

getMinLabel

public String getMinLabel()
Return the label for the minimum value of this control.

getPrecision

public float getPrecision()
Return the precision of this control.

getUnits

public String getUnits()
Return the name of the units for this control.

getUpdatePeriod

public int getUpdatePeriod()
Return the update period of this control.

getValue

public float getValue()
Return the current value of this control.

setValue

public void setValue(float value)
Set the new value of this control.

Parameters: value the new value

Throws: IllegalArgumentException if the new value is greater than the maximum or less than the minimum.

shift

public void shift(float from, float to, int ms)
This tells the control to start at the starting value and to shift its value incrementally to the final value over the given time interval, specified in microseconds. The default implementation does not do this, but instead simply sets the value to the final value immediately.

Parameters: from the starting value to the final value ms the number of microseconds

toString

public String toString()
Return a string describing this control.