This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.sound.sampled
class BooleanControl

java.lang.Object extended by javax.sound.sampled.Control extended by javax.sound.sampled.BooleanControl

public abstract class BooleanControl
extends Control

A 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 {@link BooleanControl.Type#MUTE MUTE} control to silence the line's audio.

As with other {@link Control} subclasses, a method is provided that returns string labels for the values, suitable for display in the user interface.


Nested Class Summary
static class

           An instance of the BooleanControl.Type class identifies one kind of boolean control.
Nested classes/interfaces inherited from class javax.sound.sampled.Control
Control.Type
   
Constructor Summary
protected
BooleanControl(BooleanControl.Type type, boolean initialValue)

          Constructs a new boolean control object with the given parameters.
protected
BooleanControl(BooleanControl.Type type, boolean initialValue, String trueStateLabel, String falseStateLabel)

          Constructs a new boolean control object with the given parameters.
 
Method Summary
 String
getStateLabel(boolean state)

          Obtains the label for the specified state.
 boolean

          Obtains this control's current value.
 void
setValue(boolean value)

          Sets the current value for the control.
 String

          Provides a string representation of the control
 
Methods inherited from class javax.sound.sampled.Control
getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanControl

protected BooleanControl(BooleanControl.Type type,
                         boolean initialValue)
Constructs a new boolean control object with the given parameters. The labels for the true and false states default to "true" and "false."

Parameters:
type - the type of control represented by this float control object
initialValue - the initial control value

BooleanControl

protected BooleanControl(BooleanControl.Type type,
                         boolean initialValue,
                         String trueStateLabel,
                         String falseStateLabel)
Constructs a new boolean control object with the given parameters.

Parameters:
type - the type of control represented this float control object
initialValue - the initial control value
trueStateLabel - 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."
Method Detail

getStateLabel

public String getStateLabel(boolean state)
Obtains the label for the specified state.

Parameters:
state
Returns:
the label for the specified state, such as "true" or "on" for true, or "false" or "off" for false.

getValue

public boolean getValue()
Obtains this control's current value.

Returns:
current value.

setValue

public void setValue(boolean value)
Sets the current value for the control. The default implementation simply sets the value as indicated. Some controls require that their line be open before they can be affected by setting a value.

Parameters:
value - desired new value.

toString

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

Overrides:
toString in class Control
Returns:
a string description


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.