public abstract class BooleanControl extends Control
BooleanControl
provides the ability to switch between two possible settings that affect a line's audio. The settings are boolean values (true
and false
). A graphical user interface might represent the control by a two-state button, an on/off switch, two mutually exclusive buttons, or a checkbox (among other possibilities). For example, depressing a button might activate a MUTE
control to silence the line's audio. As with other Control
subclasses, a method is provided that returns string labels for the values, suitable for display in the user interface.
Modifier and Type | Class | Description |
---|---|---|
static class |
BooleanControl.Type |
An instance of the BooleanControl.Type class identifies one kind of boolean control. |
Modifier | Constructor | Description |
---|---|---|
protected |
Constructs a new boolean control object with the given parameters. |
|
protected |
Constructs a new boolean control object with the given parameters. |
Modifier and Type | Method | Description |
---|---|---|
String |
getStateLabel |
Obtains the label for the specified state. |
boolean |
getValue() |
Obtains this control's current value. |
void |
setValue |
Sets the current value for the control. |
String |
toString() |
Returns a string representation of the boolean control. |
protected BooleanControl(BooleanControl.Type type, boolean initialValue, String trueStateLabel, String falseStateLabel)
type
- the type of control represented this float control objectinitialValue
- the initial control valuetrueStateLabel
- the label for the state represented by true
, such as "true" or "on"falseStateLabel
- the label for the state represented by false
, such as "false" or "off"protected BooleanControl(BooleanControl.Type type, boolean initialValue)
true
and false
states default to "true" and "false".type
- the type of control represented by this float control objectinitialValue
- the initial control valuepublic void setValue(boolean value)
value
- desired new valuepublic boolean getValue()
public String getStateLabel(boolean state)
state
- the state whose label will be returnedtrue
, or "false" or "off" for false
public String toString()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/sound/sampled/BooleanControl.html