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
-
intLevel
-
-
muted
-
-
GainMeterButton()
- Create a GainMeterButton
-
GainMeterButton(float, boolean)
- Create a GainMeterButton with initial values.
-
getResolution()
-
-
mapToMeterLevel(float)
-
-
paint(Graphics)
- Paint the background and border or button component.
-
paintIcon(Graphics, int, int, int, boolean)
- Paint icon into button Component
-
setLevel(float)
- Set gain level of gain meter.
-
setMute(boolean)
- Set mute state of button
-
updateView()
- Redraws GainMeter GUI component as necessary in
response to change in gain value.
intLevel
protected int intLevel
muted
protected boolean muted
GainMeterButton
public GainMeterButton()
- Create a GainMeterButton
GainMeterButton
public GainMeterButton(float level,
boolean muted)
- Create a GainMeterButton with initial values.
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
setMute
public void setMute(boolean muted)
- Set mute state of button
- Parameters:
- muted - true to draw button to reflect muted state,
false otherwise.
updateView
public void updateView()
- Redraws GainMeter GUI component as necessary in
response to change in gain value.
mapToMeterLevel
public int mapToMeterLevel(float gain)
paintIcon
protected void paintIcon(Graphics g,
int x,
int y,
int size,
boolean isEnabled)
- Paint icon into button Component
- Overrides:
- paintIcon in class BasicControlButton
paint
public void paint(Graphics g)
- Paint the background and border or button component.
- Overrides:
- paint in class BasicControlButton
getResolution
protected int getResolution()
All Packages Class Hierarchy This Package Previous Next Index