Package ejmf.toolkit.controls

Source Code of ejmf.toolkit.controls.StandardPauseControl

package ejmf.toolkit.controls;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.EventListener;

import javax.media.Controller;

import ejmf.toolkit.gui.controls.PauseButton;
/**
* Pause Control for StandardControlPanel.
*/

public class StandardPauseControl extends ActionListenerControl {

  /** Create a StandardPauseControl and associate it
  * with a Controller.
  * @param controller A Controller with which control is associated.
  */
    public StandardPauseControl(Controller controller) {
  super();
  getControlComponent().setEnabled(false);
    }

  /** Create a StandardPauseControl */
    public StandardPauseControl() {
  getControlComponent().setEnabled(false);
    }

  /**
  * Create PauseButton.
  * @return The component that acts as pause button.
  * @see ejmf.toolkit.gui.controls.PauseButton
  */
    protected Component createControlComponent() {
  return new PauseButton();
    }

  /** Create and return an ActionListener that
  * implements pause semantics.
  * @return An ActionListener for pausing controller.
  */
    protected EventListener createControlListener() {
  return new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            getController().stop();
    }
            };
    }
}
 
TOP

Related Classes of ejmf.toolkit.controls.StandardPauseControl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.