/* ==============================================
* 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: ActionCheckBox.java,v 1.2 2003/10/22 14:53:27 brodu Exp $
*
* Changes
* -------
* 25-Sep-2003 : Initial public release (NB);
*
*/
package simtools.ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBox;
/**
* Action Check box. Useful to define anonymous class doing something when the button
* is (de)selected.
* Use apply() to avoid duplicate code
*/
public abstract class ActionCheckBox extends JCheckBox implements ActionListener {
public ActionCheckBox() {
this("",false);
}
public ActionCheckBox(String text) {
this(text,false);
}
public ActionCheckBox(String text, boolean state) {
super(text,state);
addActionListener(this);
}
/** apply its state to enable/disable other components */
public void apply() {
actionPerformed(new ActionEvent(this,0,"apply"));
}
}