All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.controls.StandardGainControl

java.lang.Object
   |
   +----ejmf.toolkit.controls.AbstractListenerControl
           |
           +----ejmf.toolkit.controls.ActionListenerControl
                   |
                   +----ejmf.toolkit.controls.AbstractGainControl
                           |
                           +----ejmf.toolkit.controls.StandardGainControl

public class StandardGainControl
extends AbstractGainControl
implements GainChangeListener
Gain Control for Standard Control Panel. Provides two Components, one each for increasing and decreasing gain.

See Also:
AbstractGainControl

Constructor Index

 o StandardGainControl()
Create a StandardGainControl
 o StandardGainControl(Controller)
Create a StandardGainControl and associate it with a Controller.

Method Index

 o addControlListener(EventListener)
Over-rides addControlListener from AbstractActionListener because this Component is a JPanel and buttons need to be extracted from it.
 o createControlComponent()
Create Control Component for Gain Control.
 o createControlListener()
Create and return the default listener for gain control.
 o gainChange(GainChangeEvent)
Set enable state of gain buttons based on gain level.
 o removeControlListener(EventListener)
Remove listener from both gain increase button and gain decrease button.
 o setComponent(AbstractGainButtonPanel)
Type-safe way to set Control listener.
 o setComponentAndListener(AbstractGainButtonPanel, ActionListener)
Type-safe way to set Control Component and control listener.
 o setControllerHook(Controller)
This method is called when setController is called on an AbstractListenerControl.
 o setControlListener(ActionListener)
Type-safe way to set Control Component.

Constructors

 o StandardGainControl
 public StandardGainControl(Controller controller)
Create a StandardGainControl and associate it with a Controller.

Parameters:
controller - A Controller with which control is associated.
 o StandardGainControl
 public StandardGainControl()
Create a StandardGainControl

Methods

 o setControllerHook
 protected void setControllerHook(Controller newController)
This method is called when setController is called on an AbstractListenerControl.

Parameters:
newController - A Controller with which this control is associated.
Overrides:
setControllerHook in class AbstractGainControl
 o createControlComponent
 protected Component createControlComponent()
Create Control Component for Gain Control.

Returns:
component which acts as gain control.
Overrides:
createControlComponent in class AbstractListenerControl
 o addControlListener
 protected void addControlListener(EventListener listener)
Over-rides addControlListener from AbstractActionListener because this Component is a JPanel and buttons need to be extracted from it. Same listener is posted to both buttons.

Parameters:
listener - Listener that implements semantics for gain control.
Overrides:
addControlListener in class ActionListenerControl
 o removeControlListener
 protected void removeControlListener(EventListener listener)
Remove listener from both gain increase button and gain decrease button.

Parameters:
listener - Listener is removed from listener list associated with this control.
Overrides:
removeControlListener in class ActionListenerControl
 o createControlListener
 protected EventListener createControlListener()
Create and return the default listener for gain control. Default listener increases gain level by 0.1 for each click of up button and decreases gain level by 0.1 for each click of down button.

Returns:
Default listener for gain control.
Overrides:
createControlListener in class AbstractListenerControl
 o gainChange
 public void gainChange(GainChangeEvent e)
Set enable state of gain buttons based on gain level. If level has reached maximum, disable increase button. If level has reached minimum, enable descrease button.

Parameters:
e - An GainChangeEvent triggerd by a GainControl
See Also:
GainControl, GainChangeEvent
 o setComponentAndListener
 public void setComponentAndListener(AbstractGainButtonPanel bp,
                                     ActionListener listener)
Type-safe way to set Control Component and control listener.

Parameters:
bp - An AbstractGainButtonPanel that serves as Control component.
listener - An ActionListener that implements Control semantics.
 o setComponent
 public void setComponent(AbstractGainButtonPanel bp)
Type-safe way to set Control listener.

Parameters:
listener - An ActionListener that implements Control semantics.
 o setControlListener
 public void setControlListener(ActionListener listener)
Type-safe way to set Control Component.

Parameters:
listener - An ActionListener that implements gain control button semantics.
Overrides:
setControlListener in class ActionListenerControl

All Packages  Class Hierarchy  This Package  Previous  Next  Index