All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.gui.controls.GainMeterButton

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.BasicControlButton
                                                   |
                                                   +----ejmf.toolkit.gui.controls.GainMeterButton

public class GainMeterButton
extends BasicControlButton
implements GainMeter
The gain meter button for StandardControlPanel. This class draws the default gain meter button for StandardControls: A small speaker-shaped icon with "waves" emanating from the front.

A read X is drawn atop the speaker when the gain control is muted. As the gain increase, more "waves" are drawn. As the gain decreases, fewer "waves" are drawn.

GainMeterButton implements GainMeter in order to support these operations.

See Also:
GainMeter

Variable Index

 o intLevel
 o muted

Constructor Index

 o GainMeterButton()
Create a GainMeterButton
 o GainMeterButton(float, boolean)
Create a GainMeterButton with initial values.

Method Index

 o getResolution()
 o mapToMeterLevel(float)
 o paint(Graphics)
Paint the background and border or button component.
 o paintIcon(Graphics, int, int, int, boolean)
Paint icon into button Component
 o setLevel(float)
Set gain level of gain meter.
 o setMute(boolean)
Set mute state of button
 o updateView()
Redraws GainMeter GUI component as necessary in response to change in gain value.

Variables

 o intLevel
 protected int intLevel
 o muted
 protected boolean muted

Constructors

 o GainMeterButton
 public GainMeterButton()
Create a GainMeterButton

 o GainMeterButton
 public GainMeterButton(float level,
                        boolean muted)
Create a GainMeterButton with initial values.

Methods

 o setLevel
 public void setLevel(float level)
Set gain level of gain meter. The input argument is a gain level that gets mapped to a number of "waves" emanating from front of speaker.

Parameters:
level - is a gain level value that gets mapped to a display value
 o setMute
 public void setMute(boolean muted)
Set mute state of button

Parameters:
muted - true to draw button to reflect muted state, false otherwise.
 o updateView
 public void updateView()
Redraws GainMeter GUI component as necessary in response to change in gain value.

 o mapToMeterLevel
 public int mapToMeterLevel(float gain)
 o paintIcon
 protected void paintIcon(Graphics g,
                          int x,
                          int y,
                          int size,
                          boolean isEnabled)
Paint icon into button Component

Overrides:
paintIcon in class BasicControlButton
 o paint
 public void paint(Graphics g)
Paint the background and border or button component.

Overrides:
paint in class BasicControlButton
 o getResolution
 protected int getResolution()

All Packages  Class Hierarchy  This Package  Previous  Next  Index