uk.org.toot.control
Class FloatControl

java.lang.Object
  extended by java.util.Observable
      extended by uk.org.toot.control.Control
          extended by uk.org.toot.control.LawControl
              extended by uk.org.toot.control.FloatControl
Direct Known Subclasses:
AbstractDelayControls.MixControl, CrossoverControl, DynamicsControls.GainReductionIndicator, IntegerControl, MeterControls.MeterIndicator, MixControls.FrontRearControl, MixControls.LCRControl

public class FloatControl
extends LawControl

A FloatControl object provides control over a range of floating-point values. Float controls are often represented in graphical user interfaces by continuously adjustable objects such as sliders or rotary knobs. Concrete subclasses of FloatControl implement controls, such as gain and pan, that affect a line's audio signal in some way that an application can manipulate.


Constructor Summary
FloatControl(int id, java.lang.String name, ControlLaw law, float precision, float initialValue)
          Constructs a new float control object with the given parameters.
FloatControl(int id, java.lang.String name, ControlLaw law, float precision, float initialValue, java.lang.String minLabel, java.lang.String midLabel, java.lang.String maxLabel)
          Constructs a new float control object with the given parameters
 
Method Summary
 float getMaximum()
          Obtains the maximum value permitted.
 java.lang.String getMaxLabel()
          Obtains the label for the maximum value, such as "Right" or "Full."
 java.lang.String getMidLabel()
          Obtains the label for the mid-point value, such as "Center" or "Default."
 float getMinimum()
          Obtains the minimum value permitted.
 java.lang.String getMinLabel()
          Obtains the label for the minimum value, such as "Left" or "Off."
 boolean isRotary()
           
 java.lang.String toString()
          Provides a string representation of the control
 
Methods inherited from class uk.org.toot.control.LawControl
applyPreset, getInsertColor, getIntValue, getLaw, getPrecision, getPresetNames, getValue, getValueString, setInsertColor, setIntValue, setValue
 
Methods inherited from class uk.org.toot.control.Control
getAnnotation, getControlPath, getControlPath, getId, getName, getParent, isAdjusting, isEnabled, isHidden, isIndicator, setAdjusting, setAnnotation, setEnabled, setHidden, setName
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FloatControl

public FloatControl(int id,
                    java.lang.String name,
                    ControlLaw law,
                    float precision,
                    float initialValue)
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:
precision - the resolution or granularity of the control. This is the size of the increment between discrete valid values.
initialValue - the value that the control starts with when constructed

FloatControl

public FloatControl(int id,
                    java.lang.String name,
                    ControlLaw law,
                    float precision,
                    float initialValue,
                    java.lang.String minLabel,
                    java.lang.String midLabel,
                    java.lang.String maxLabel)
Constructs a new float control object with the given parameters

Parameters:
precision - the resolution or granularity of the control. This is the size of the increment between discrete valid values.
initialValue - the value that the control starts with when constructed
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"
Method Detail

isRotary

public boolean isRotary()

getMaximum

public float getMaximum()
Obtains the maximum value permitted.

Returns:
the maximum allowable value

getMinimum

public float getMinimum()
Obtains the minimum value permitted.

Returns:
the minimum allowable value

getMinLabel

public java.lang.String getMinLabel()
Obtains the label for the minimum value, such as "Left" or "Off."

Returns:
the minimum value label, or a zero-length string if no label * has been set

getMidLabel

public java.lang.String getMidLabel()
Obtains the label for the mid-point value, such as "Center" or "Default."

Returns:
the mid-point value label, or a zero-length string if no label * has been set

getMaxLabel

public java.lang.String getMaxLabel()
Obtains the label for the maximum value, such as "Right" or "Full."

Returns:
the maximum value label, or a zero-length string if no label * has been set

toString

public java.lang.String toString()
Provides a string representation of the control

Overrides:
toString in class Control
Returns:
a string description


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.