- java.lang.Object
-
- javax.sound.sampled.Control
-
- javax.sound.sampled.EnumControl
-
public abstract class EnumControl extends Control
AEnumControl
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
objects.FloatControl
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 aBooleanControl
FloatControl
with a coarse resolution. However, a key feature ofEnumControl
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
control are instances ofREVERB
that can be queried for the parameter values used for each setting.ReverbType
- Since:
- 1.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
EnumControl.Type
An instance of theEnumControl.Type
inner class identifies one kind of enumerated control.
-
Constructor Summary
Constructors Modifier Constructor and Description protected
EnumControl(EnumControl.Type type, Object[] values, Object value)
Constructs a new enumerated control object with the given parameters.
-
Method Summary
Methods Modifier and Type Method and Description Object
getValue()
Obtains this control's current value.Object[]
getValues()
Returns the set of possible values for this control.void
setValue(Object value)
Sets the current value for the control.String
toString()
Provides a string representation of the control.-
Methods inherited from class javax.sound.sampled.Control
getType
-
-
-
-
Constructor Detail
-
EnumControl
protected EnumControl(EnumControl.Type type, Object[] values, Object value)
Constructs a new enumerated control object with the given parameters.- Parameters:
type
- the type of control represented this enumerated control objectvalues
- the set of possible values for the controlvalue
- the initial control value
-
-
Method Detail
-
setValue
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 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:
IllegalArgumentException
- if the value indicated does not fall within the allowable range
-
getValue
public Object getValue()
Obtains this control's current value.- Returns:
- the current value
-
getValues
public Object[] getValues()
Returns the set of possible values for this control.- Returns:
- the set of possible values
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
17/11/2024 17:24:45 Cette version de la page est en cache (à la date du 17/11/2024 17:24:45) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/sound/sampled/enumcontrol.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.