Package ejmf.toolkit.gui.controls

Examples of ejmf.toolkit.gui.controls.AbstractGainButtonPanel


        * @param bg The background color for control panel.
  */
    public void setBackground(Color bg) {
  super.setBackground(bg);
  if (getControls() != null) {
      AbstractGainButtonPanel gbp = getGainButtonPanel();
      gbp.setBackground(bg);
  }
    }
View Full Code Here


  * gain control.
      */
    protected void addControlListener(EventListener listener) {
  if (listener instanceof ActionListener) {
      AbstractButton ab;
      AbstractGainButtonPanel p =
    (AbstractGainButtonPanel) getControlComponent();

      ab = p.getGainIncreaseButton();
            ab.addActionListener((ActionListener) listener);
      ab = p.getGainDecreaseButton();
            ab.addActionListener((ActionListener) listener);
        } else {
      throw new IllegalArgumentException("ActionListener required");
  }
    }
View Full Code Here

      * @return Default listener for gain control.
      */
    protected EventListener createControlListener() {
  return new ActionListener() {
      public void actionPerformed(ActionEvent e) {
    AbstractGainButtonPanel  gbp =
      (AbstractGainButtonPanel) getControlComponent();
    GainControl gc = getGainControl();
     float level = gc.getLevel();

    if (e.getSource() == gbp.getGainIncreaseButton()) {
        level += 0.1f;
        gc.setLevel(level > 1.0f ? 1.0f : level);
    } else if (e.getSource() == gbp.getGainDecreaseButton()) {
        level -= 0.1f;
         gc.setLevel(level < 0.0f ? 0.0f : level);
    }
      }
  };
View Full Code Here

  * separate thread.
  * This method simply sets the current state of the   
  * gain control buttons.
  */
    private void setState(float level) {
      AbstractGainButtonPanel gbp =
    (AbstractGainButtonPanel) getControlComponent();
      gbp.getGainIncreaseButton().setEnabled(level < 1.0f);
      gbp.getGainDecreaseButton().setEnabled(level > 0.0f);
    }
View Full Code Here

TOP

Related Classes of ejmf.toolkit.gui.controls.AbstractGainButtonPanel

Copyright © 2018 www.massapicom. 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.