cage.utility
Class AbstractButtonGroup

java.lang.Object
  extended by cage.utility.AbstractButtonGroup
All Implemented Interfaces:
GenericButtonGroup, java.awt.event.ItemListener, java.util.EventListener
Direct Known Subclasses:
Min1ButtonGroup, SyncButtonGroup

public abstract class AbstractButtonGroup
extends java.lang.Object
implements GenericButtonGroup, java.awt.event.ItemListener

An implementation of GenericButtonGroup that uses a Vector. This class implements ItemListener and registers itself with any button that is added to the group and removes itself from any button that is removed from the group.


Field Summary
protected  java.util.Vector buttons
          The Vector that contains the elements of this group.
 
Constructor Summary
AbstractButtonGroup()
           
 
Method Summary
 void add(javax.swing.AbstractButton button)
          Add button to this group and this as listener to that button.
 java.util.Enumeration getElements()
          Returns an enumeration of the buttons in this group.
 javax.swing.AbstractButton getSelection()
          Always returns null.
 void remove(javax.swing.AbstractButton button)
          Remove button from this group and do nothing if it wasn't in this group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ItemListener
itemStateChanged
 

Field Detail

buttons

protected java.util.Vector buttons
The Vector that contains the elements of this group.

Constructor Detail

AbstractButtonGroup

public AbstractButtonGroup()
Method Detail

add

public void add(javax.swing.AbstractButton button)
Add button to this group and this as listener to that button.

Specified by:
add in interface GenericButtonGroup
Parameters:
button - The AbstractButton to add to this group.

remove

public void remove(javax.swing.AbstractButton button)
Remove button from this group and do nothing if it wasn't in this group. Also removes this as listener from the button.

Specified by:
remove in interface GenericButtonGroup
Parameters:
button - The AbstractButton to remove to this group.

getElements

public java.util.Enumeration getElements()
Returns an enumeration of the buttons in this group.

Specified by:
getElements in interface GenericButtonGroup
Returns:
An enumeration of the buttons in this group.

getSelection

public javax.swing.AbstractButton getSelection()
Always returns null.

Returns:
null