buoy.widget
Class BCheckBox

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

public class BCheckBox
extends Widget

A BCheckBox is a Widget for making simple boolean selections. Clicking it with the mouse toggles it on and off.

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

Author:
Peter Eastman

Constructor Summary
BCheckBox()
          Create a new BCheckBox with no label, which is initially deselected.
BCheckBox(java.lang.String text, boolean state)
          Create a new BCheckBox.
 
Method Summary
 javax.swing.JCheckBox getComponent()
          Get the java.awt.Component corresponding to this Widget.
 java.awt.Dimension getMaximumSize()
          Get the largest size at which this Widget can reasonably be drawn.
 boolean getState()
          Get the selection state of this check box.
 java.lang.String getText()
          Get the text which appears on this check box.
 void setState(boolean selected)
          Set the selection state of this check box.
 void setText(java.lang.String text)
          Set the text which appears on this check box.
 
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

BCheckBox

public BCheckBox()
Create a new BCheckBox with no label, which is initially deselected.


BCheckBox

public BCheckBox(java.lang.String text,
                 boolean state)
Create a new BCheckBox.

Parameters:
text - the text to display on the BCheckBox
state - the initial selection state of the BCheckBox
Method Detail

getComponent

public javax.swing.JCheckBox 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 check box.


setState

public void setState(boolean selected)
Set the selection state of this check box.


getText

public java.lang.String getText()
Get the text which appears on this check box.


setText

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


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.