buoy.widget
Class RadioButtonGroup

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.RadioButtonGroup

public class RadioButtonGroup
extends EventSource

A RadioButtonGroup manages a set of BRadioButtons and BRadioButtonMenuItems. It ensures that only one member of the group is selected at any time. It provides methods for determining which member is currently selected, and for changing the selection.

RadioButtonGroup extends EventSource. It generates a SelectionChangedEvent whenever the user changes the selected radio button. Therefore, you can simply add an event link to a RadioButtonGroup, rather than adding one to each radio button independently.

Author:
Peter Eastman

Constructor Summary
RadioButtonGroup()
          Create a new RadioButtonGroup.
 
Method Summary
 java.lang.Object getRadioButton(int i)
          Get the i'th radio button in this group.
 int getRadioButtonCount()
          Get the number of members in this group.
 java.util.Iterator getRadioButtons()
          Get an Iterator listing all members of the group.
 java.lang.Object getSelection()
          Get the currently selected radio button, or null if none is selected.
 void setSelection(java.lang.Object sel)
          Select a particular radio button, and deselect all others in the group.
 
Methods inherited from class buoy.event.EventSource
addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadioButtonGroup

public RadioButtonGroup()
Create a new RadioButtonGroup.

Method Detail

getSelection

public java.lang.Object getSelection()
Get the currently selected radio button, or null if none is selected.


setSelection

public void setSelection(java.lang.Object sel)
Select a particular radio button, and deselect all others in the group.


getRadioButtons

public java.util.Iterator getRadioButtons()
Get an Iterator listing all members of the group.


getRadioButtonCount

public int getRadioButtonCount()
Get the number of members in this group.


getRadioButton

public java.lang.Object getRadioButton(int i)
Get the i'th radio button in this group.



Written by Peter Eastman.