Package net.sf.fmj.ejmf.toolkit.gui.controls

Source Code of net.sf.fmj.ejmf.toolkit.gui.controls.StandardStopControl

package net.sf.fmj.ejmf.toolkit.gui.controls;

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

import javax.media.Controller;
import javax.media.Time;


/*
* Stop Control for StandardControlPanel.
*/
public class StandardStopControl extends ActionListenerControl {

  public StandardStopControl(Skin skin) {
    super(skin);
  getControlComponent().setEnabled(false);
   }

    public StandardStopControl(Skin skin, Controller controller) {
  super(skin, controller);
  getControlComponent().setEnabled(false);
  }

  /**
  * Create StopButton 
  * @see net.sf.fmj.ejmf.toolkit.gui.controls.skins.ejmf.StopButton
  */
    @Override
    protected Component createControlComponent(Skin skin) {
  return skin.createStopButton();
    }

  /**
  * Create ActionListener to respond to StopButton
  * clicks.
  */
    @Override
  protected EventListener createControlListener() {
  return new ActionListener() {
            public void actionPerformed(ActionEvent e) {
    Controller controller = getController();
                controller.stop();
          controller.setMediaTime(new Time(0.0));
            }
        };
    }
}
 
TOP

Related Classes of net.sf.fmj.ejmf.toolkit.gui.controls.StandardStopControl

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.