net.sf.fmj.ejmf.toolkit.controls
Class RateControl

java.lang.Object
  extended by net.sf.fmj.ejmf.toolkit.controls.RateControl
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, Control, ControllerListener

public class RateControl
extends java.lang.Object
implements java.awt.event.ActionListener, ControllerListener, Control

Provides a generic Control over a Controller's rate. The graphical interface is a simple rate TextField. When the user hits enter, the rate in the TextField will be set in the Player. From the book: Essential JMF, Gordon, Talley (ISBN 0130801046). Used with permission.

Author:
Steve Talley & Rob Gordon

Constructor Summary
RateControl(Controller controller)
          Construct a RateControl object for the given Controller.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Listens for changes in the Rate TextField.
 void controllerUpdate(ControllerEvent e)
          Listens for changes in the Controller's rate, so that it can be reflected in the Rate TextField.
 java.awt.Component getControlComponent()
          For implementation of the Control interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RateControl

public RateControl(Controller controller)
Construct a RateControl object for the given Controller.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Listens for changes in the Rate TextField.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - An ActionEvent fired by activity in text field.

controllerUpdate

public void controllerUpdate(ControllerEvent e)
Listens for changes in the Controller's rate, so that it can be reflected in the Rate TextField.

Specified by:
controllerUpdate in interface ControllerListener
Parameters:
e - The generated ControllerEvent. This event is ignored if it is not a RateChangeEvent.

getControlComponent

public java.awt.Component getControlComponent()
For implementation of the Control interface.

Specified by:
getControlComponent in interface Control
Returns:
the Control Component for this object.