public abstract class EnumControl extends Control
EnumControlprovides 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
Controls that provide a choice between only two settings can often be implemented
instead as a
, 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
control are instances of
that can be queried for the parameter values
used for each setting.
|Modifier and Type||Class and Description|
An instance of the
|Modifier||Constructor and Description|
Constructs a new enumerated control object with the given parameters.
|Modifier and Type||Method and Description|
Obtains this control's current value.
Returns the set of possible values for this control.
Sets the current value for the control.
Provides a string representation of the control.
protected EnumControl(EnumControl.Type type, Object values, Object value)
type- the type of control represented this enumerated control object
values- the set of possible values for the control
value- the initial control value
public void setValue(Object value)
value- the desired new value
IllegalArgumentException- if the value indicated does not fall within the allowable range
public Object getValue()
public Object getValues()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.