Package simtools.ui

Source Code of simtools.ui.ActionRadioButton

/* ==============================================
* Simtools : The tools library used in JSynoptic
* ==============================================
*
* Project Info:  http://jsynoptic.sourceforge.net/index.html
*
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2003, by :
*     Corporate:
*         Astrium SAS
*         EADS CRC
*     Individual:
*     Nicolas Brodu
*
*
* $Id: ActionRadioButton.java,v 1.1 2003/10/22 14:54:53 brodu Exp $
*
* Changes
* -------
* 22-Oct-2003 : Initial version copied from ActionCheckBox (NB);
*
*/

package simtools.ui;

import javax.swing.JRadioButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
* Action radio button. Useful to define anonymous class doing something when the button
* is (de)selected.
* Use apply() to avoid duplicate code
*/
public abstract class ActionRadioButton extends JRadioButton implements ChangeListener {

  public ActionRadioButton() {
    this("",false);
  }

  public ActionRadioButton(String text) {
    this(text,false);
  }

  public ActionRadioButton(String text, boolean state) {
    super(text,state);
    addChangeListener(this);
  }

  /** apply its state to enable/disable other components */
  public void apply() {
    stateChanged(new ChangeEvent(this));
  }

}
TOP

Related Classes of simtools.ui.ActionRadioButton

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.