All Packages Class Hierarchy This Package Previous Next Index
Class ejmf.toolkit.gui.controls.EjmfGainMeterButton
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.AbstractButton
|
+----com.sun.java.swing.JButton
|
+----ejmf.toolkit.gui.controls.EjmfControlButton
|
+----ejmf.toolkit.gui.controls.EjmfGainMeterButton
- public class EjmfGainMeterButton
- extends EjmfControlButton
- implements GainMeter
An EjmfGainMeterButton conveys two pieces of information.
First, it can on or off to reflect the mute state of its
Control. This is supported with setMute method.
Second, it can support multiple level displays with the setLevel method.
The level is float value that the EjmfGainMeterButton maps into
display state. Specifically, it displays some number of "waves"
emanating from a speaker. The number of waves indicates the gain level.
EjmfGainMeterButton relies of $EJMF_HOME/classes/lib/ejmf.properties
for its icon images.
-
EjmfGainMeterButton()
-
Create a EjmfGainMeterButton for EJMF control panel.
-
EjmfGainMeterButton(float, boolean)
- Create a gain meter with initial values.
-
getPreferredSize()
- Ensure the button will fit largest speaker icon.
-
mapToMeterLevel(float)
- Convert gain level to some internally
sensible value.
-
setLevel(float)
- Set the display level.
-
setMute(boolean)
- Set the muted state.
-
updateView()
- Force a redraw of the gain meter button.
EjmfGainMeterButton
public EjmfGainMeterButton()
- Create a EjmfGainMeterButton for EJMF control panel.
EjmfGainMeterButton
public EjmfGainMeterButton(float level,
boolean muted)
- Create a gain meter with initial values.
- Parameters:
- level - initial gain level
- muted - initial muted state
setLevel
public void setLevel(float level)
- Set the display level. The input argument is a gain level
value. It is mapped to a supported integer value using
mapToMeterLevel
.
- Parameters:
- level - A gain level value that is mapped to a
corresponding integer value supported by the gain meter.
setMute
public void setMute(boolean muted)
- Set the muted state.
- Parameters:
- if -
muted
is true, button is displayed
in muted state. Otherwise, button is displayed in normal
state.
mapToMeterLevel
public int mapToMeterLevel(float level)
- Convert gain level to some internally
sensible value.
- Parameters:
- level - a gain level return by, e.g. GainControl.getLevel.
- Returns:
- An integer value that corresponds to a displayable
state of the gain meter.
updateView
public void updateView()
- Force a redraw of the gain meter button.
getPreferredSize
public Dimension getPreferredSize()
- Ensure the button will fit largest speaker icon.
- Returns:
- The size of gain component.
- Overrides:
- getPreferredSize in class EjmfControlButton
All Packages Class Hierarchy This Package Previous Next Index