javax.sound.sampled

Class 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 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.

    Since:
    1.3
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  BooleanControl.Type
      An instance of the BooleanControl.Type class identifies one kind of boolean control.

        

    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      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.

        

    • Constructor Detail

      • 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."
      • 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
    • Method Detail

      • 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.
      • getValue

        public boolean getValue()
        Obtains this control's current value.
        Returns:
        current value.
      • getStateLabel

        public String getStateLabel(boolean state)
        Obtains the label for the specified state.
        Returns:
        the label for the specified state, such as "true" or "on" for true, or "false" or "off" for false.
      • toString

        public String toString()
        Provides a string representation of the control
        Overrides:
        toString in class Control
        Returns:
        a string description

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.

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/BooleanControl.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

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, BooleanControl

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.

Table des matières Haut