104 * @return current value
105 */
106 public boolean getValue() {
107 return value;
108 }
109
110 /**
111 * Obtains the label for the specified state.
112 *
113 * @param state the state whose label will be returned
114 * @return the label for the specified state, such as "true" or "on" for
115 * {@code true}, or "false" or "off" for {@code false}
116 */
117 public String getStateLabel(boolean state) {
118 return ((state == true) ? trueStateLabel : falseStateLabel);
119 }
120
121 /**
122 * Provides a string representation of the control.
123 *
124 * @return a string description
125 */
126 @Override
127 public String toString() {
128 return new String(super.toString() + " with current value: " + getStateLabel(getValue()));
129 }
130
131 /**
132 * An instance of the {@code BooleanControl.Type} class identifies one kind
133 * of boolean control. Static instances are provided for the common types.
134 *
135 * @author Kara Kytle
136 * @since 1.3
137 */
138 public static class Type extends Control.Type {
139
140 /**
141 * Represents a control for the mute status of a line. Note that mute
142 * status does not affect gain.
143 */
144 public static final Type MUTE = new Type("Mute");
|
104 * @return current value
105 */
106 public boolean getValue() {
107 return value;
108 }
109
110 /**
111 * Obtains the label for the specified state.
112 *
113 * @param state the state whose label will be returned
114 * @return the label for the specified state, such as "true" or "on" for
115 * {@code true}, or "false" or "off" for {@code false}
116 */
117 public String getStateLabel(boolean state) {
118 return ((state == true) ? trueStateLabel : falseStateLabel);
119 }
120
121 /**
122 * Provides a string representation of the control.
123 *
124 * @return a string representation of the control
125 */
126 @Override
127 public String toString() {
128 return new String(super.toString() + " with current value: " + getStateLabel(getValue()));
129 }
130
131 /**
132 * An instance of the {@code BooleanControl.Type} class identifies one kind
133 * of boolean control. Static instances are provided for the common types.
134 *
135 * @author Kara Kytle
136 * @since 1.3
137 */
138 public static class Type extends Control.Type {
139
140 /**
141 * Represents a control for the mute status of a line. Note that mute
142 * status does not affect gain.
143 */
144 public static final Type MUTE = new Type("Mute");
|