uk.org.toot.control
Class EnumControl

java.lang.Object
  extended by java.util.Observable
      extended by uk.org.toot.control.Control
          extended by uk.org.toot.control.EnumControl
Direct Known Subclasses:
ClassicFilterControls.TypeControl, MeterControls.MindBControl, MeterControls.TypeControl, ModulatedDelayControls.ShapeControl

public abstract class EnumControl
extends Control

A EnumControl provides control over a set of discrete possible values, each represented by an object. In a graphical user interface, such a control might be represented by a set of buttons, each of which chooses one value or setting.


Constructor Summary
EnumControl(int id, java.lang.String name, java.lang.Object value)
          Constructs a new enumerated control object with the given parameters.
 
Method Summary
 int getIntValue()
           
 java.lang.Object getValue()
          Obtains this control's current value.
abstract  java.util.List getValues()
           
 java.lang.String getValueString()
          override for real value strings where possible
 boolean hasLabel()
           
 boolean isWidthLimited()
           
 void setIntValue(int value)
           
 void setValue(java.lang.Object value)
          Sets the current value for the control.
 java.lang.String toString()
          Provides a string representation of the control.
 
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

EnumControl

public EnumControl(int id,
                   java.lang.String name,
                   java.lang.Object value)
Constructs a new enumerated control object with the given parameters.

Parameters:
value - the initial control value
Method Detail

setValue

public void setValue(java.lang.Object value)
Sets the current value for the control. The default implementation simply sets the value as indicated. If the value indicated is not supported, an IllegalArgumentException is thrown. Some controls require that their line be open before they can be affected by setting a value.

Parameters:
value - the desired new value
Throws:
java.lang.IllegalArgumentException - if the value indicated does not fall within the allowable range

getValue

public java.lang.Object getValue()
Obtains this control's current value.

Returns:
the current value

getValues

public abstract java.util.List getValues()

toString

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

Overrides:
toString in class Control
Returns:
a string description

getValueString

public java.lang.String getValueString()
Description copied from class: Control
override for real value strings where possible

Overrides:
getValueString in class Control

setIntValue

public void setIntValue(int value)
Overrides:
setIntValue in class Control

getIntValue

public int getIntValue()
Overrides:
getIntValue in class Control

isWidthLimited

public boolean isWidthLimited()

hasLabel

public boolean hasLabel()


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