buoy.widget
Class BRadioButton

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.Widget
          extended by buoy.widget.BRadioButton

public class BRadioButton
extends Widget

A BRadioButton is a Widget for selecting between several options. It is normally used as part of a RadioButtonGroup. Each BRadioButton represents a single option. Clicking on it selects it, and deselects all other members of its RadioButtonGroup.

In addition to the event types generated by all Widgets, BRadioButtons generate the following event types:

Author:
Peter Eastman

Constructor Summary
BRadioButton(RadioButtonGroup group)
          Create a new BRadioButton with no label, which is initially deselected.
BRadioButton(java.lang.String text, boolean state, RadioButtonGroup group)
          Create a new BRadioButton.
 
Method Summary
 javax.swing.JRadioButton getComponent()
          Get the java.awt.Component corresponding to this Widget.
 RadioButtonGroup getGroup()
          Get the RadioButtonGroup this button is part of.
 java.awt.Dimension getMaximumSize()
          Get the largest size at which this Widget can reasonably be drawn.
 boolean getState()
          Get the selection state of this radio button.
 java.lang.String getText()
          Get the text which appears on this radio button.
 void setGroup(RadioButtonGroup newGroup)
          Set the RadioButtonGroup this button is part of.
 void setState(boolean selected)
          Set the selection state of this radio button.
 void setText(java.lang.String text)
          Set the text which appears on this radio button.
 
Methods inherited from class buoy.widget.Widget
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
 
Methods inherited from class buoy.event.EventSource
addEventLink, addEventLink, removeEventLink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BRadioButton

public BRadioButton(RadioButtonGroup group)
Create a new BRadioButton with no label, which is initially deselected.

Parameters:
group - the RadioButtonGroup this radio button is part of

BRadioButton

public BRadioButton(java.lang.String text,
                    boolean state,
                    RadioButtonGroup group)
Create a new BRadioButton.

Parameters:
text - the text to display on the BRadioButton
state - the initial selection state of the BRadioButton
group - the RadioButtonGroup this radio button is part of
Method Detail

getComponent

public javax.swing.JRadioButton getComponent()
Description copied from class: Widget
Get the java.awt.Component corresponding to this Widget.

Overrides:
getComponent in class Widget

getState

public boolean getState()
Get the selection state of this radio button.


setState

public void setState(boolean selected)
Set the selection state of this radio button. If you set the selection state to true, the state of every other member of its RadioButtonGroup will be set to false.


getText

public java.lang.String getText()
Get the text which appears on this radio button.


setText

public void setText(java.lang.String text)
Set the text which appears on this radio button.


getGroup

public RadioButtonGroup getGroup()
Get the RadioButtonGroup this button is part of.


setGroup

public void setGroup(RadioButtonGroup newGroup)
Set the RadioButtonGroup this button is part of.


getMaximumSize

public java.awt.Dimension getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn. When a WidgetContainer lays out its contents, it will attempt never to make this Widget larger than its maximum size.

Overrides:
getMaximumSize in class Widget


Written by Peter Eastman.