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. For example, a reverb control might provide several preset
reverberation settings, instead of providing continuously adjustable
parameters of the sort that would be represented by FloatControl
objects.
Controls that provide a choice between only two settings can often be
implemented instead as a BooleanControl, and controls that provide a
set of values along some quantifiable dimension might be implemented instead
as a FloatControl with a coarse resolution. However, a key feature of
EnumControl is that the returned values are arbitrary objects, rather
than numerical or boolean values. This means that each returned object can
provide further information. As an example, the settings of a
REVERB control are instances of
ReverbType that can be queried for the parameter values used for each
setting.
| Modifier and Type | Class and Description |
|---|---|
| public static class | EnumControl.
An instance of the |
| Modifier and Type | Field and Description |
|---|---|
| private Object | value
The current value. |
| private final Object[] | values
The set of possible values. |
| Access | Constructor and Description |
|---|---|
| protected | EnumControl(EnumControl.
the type of control represented this enumerated control
object type,the set of possible values for the control values, Object the initial control value value)Constructs a new enumerated control object with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public Object[] | |
| private boolean | Returns: true if the value is supported, otherwise falsethe value for which support is queried value)Indicates whether the value specified is supported. |
| public void | |
| public String | Returns: a string representation of the enumerated controlOverrides javax. Returns a string representation of the enumerated control. |
| value | back to summary |
|---|---|
| private Object value The current value. | |
| values | back to summary |
|---|---|
| private final Object[] values The set of possible values. | |
| EnumControl | back to summary |
|---|---|
| protected EnumControl(EnumControl. Constructs a new enumerated control object with the given parameters.
| |
| getValue | back to summary |
|---|---|
| public Object getValue() Obtains this control's current value.
| |
| getValues | back to summary |
|---|---|
| public Object[] getValues() Returns the set of possible values for this control.
| |
| isValueSupported | back to summary |
|---|---|
| private boolean isValueSupported(Object value) Indicates whether the value specified is supported.
| |
| setValue | back to summary |
|---|---|
| public void setValue(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
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides javax. Returns a string representation of the enumerated control. | |
EnumControl.Type inner class identifies one
kind of enumerated control. Static instances are provided for the common
types.
EnumControl
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumControl. | REVERB
Represents a control over a set of possible reverberation settings. |
| Access | Constructor and Description |
|---|---|
| protected |
| REVERB | back to summary |
|---|---|
| public static final EnumControl. Represents a control over a set of possible reverberation settings.
Each reverberation setting is described by an instance of the
| |
| Type | back to summary |
|---|---|
| protected Type(final String name) Constructs a new enumerated control type.
| |