Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.maloi.evolvo.gui
Class CustomButtonGroup  view CustomButtonGroup download CustomButtonGroup.java

java.lang.Object
  extended byjavax.swing.ButtonGroup
      extended byorg.maloi.evolvo.gui.CustomButtonGroup
All Implemented Interfaces:
java.io.Serializable

public class CustomButtonGroup
extends javax.swing.ButtonGroup
implements java.io.Serializable

Drop in replacement for ButtonGroup, which allows the user to de-select a button by clicking it a second time. If no buttons are selected, the button group returns null when asked what button is selected.


Field Summary
protected  java.util.Vector buttons
           
(package private)  javax.swing.ButtonModel selection
          The current choice.
 
Fields inherited from class javax.swing.ButtonGroup
 
Constructor Summary
CustomButtonGroup()
          Creates a new ButtonGroup.
 
Method Summary
 void add(javax.swing.AbstractButton b)
          Adds the button to the group.
 int getButtonCount()
          Returns the number of buttons in the group.
 java.util.Enumeration getElements()
          Return all the buttons that are participating in this group.
 javax.swing.ButtonModel getSelection()
          Return the selected button model.
 boolean isSelected(javax.swing.ButtonModel m)
          Returns the selected value for the button.
 void remove(javax.swing.AbstractButton b)
          Removes the button from the group.
 void setSelected(javax.swing.ButtonModel m, boolean b)
          Sets the selected value for the button.
 
Methods inherited from class javax.swing.ButtonGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buttons

protected java.util.Vector buttons

selection

javax.swing.ButtonModel selection
The current choice.

Constructor Detail

CustomButtonGroup

public CustomButtonGroup()
Creates a new ButtonGroup.

Method Detail

add

public void add(javax.swing.AbstractButton b)
Adds the button to the group.


remove

public void remove(javax.swing.AbstractButton b)
Removes the button from the group.


getElements

public java.util.Enumeration getElements()
Return all the buttons that are participating in this group.


getSelection

public javax.swing.ButtonModel getSelection()
Return the selected button model.


setSelected

public void setSelected(javax.swing.ButtonModel m,
                        boolean b)
Sets the selected value for the button.


isSelected

public boolean isSelected(javax.swing.ButtonModel m)
Returns the selected value for the button.


getButtonCount

public int getButtonCount()
Returns the number of buttons in the group.