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.


Constructor Index

 o EjmfGainMeterButton()
Create a EjmfGainMeterButton for EJMF control panel.
 o EjmfGainMeterButton(float, boolean)
Create a gain meter with initial values.

Method Index

 o getPreferredSize()
Ensure the button will fit largest speaker icon.
 o mapToMeterLevel(float)
Convert gain level to some internally sensible value.
 o setLevel(float)
Set the display level.
 o setMute(boolean)
Set the muted state.
 o updateView()
Force a redraw of the gain meter button.

Constructors

 o EjmfGainMeterButton
 public EjmfGainMeterButton()
Create a EjmfGainMeterButton for EJMF control panel.

 o EjmfGainMeterButton
 public EjmfGainMeterButton(float level,
                            boolean muted)
Create a gain meter with initial values.

Parameters:
level - initial gain level
muted - initial muted state

Methods

 o 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.
 o 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.
 o 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.
 o updateView
 public void updateView()
Force a redraw of the gain meter button.

 o 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