Sharkysoft home

lava.gui
Class LButtonGroup

java.lang.Object
  |
  +--javax.swing.ButtonGroup
        |
        +--lava.gui.LButtonGroup
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.io.Serializable

public class LButtonGroup
extends javax.swing.ButtonGroup
implements java.awt.event.ActionListener

Extends ButtonGroup with miscellaneous features.

Details: LButtonGroup extends javax.swing.ButtonGroup to provide a few additional features.

Since:
1998.11.13
Version:
2000.02.22
See Also:
Serialized Form

Fields inherited from class javax.swing.ButtonGroup
buttons
 
Constructor Summary
LButtonGroup(boolean none_is_legal)
          Specifies whether select-none is allowed.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Broadcasts ActionEvents to ActionListeners.
 void add(javax.swing.AbstractButton b)
          Adds a button to this group.
 void addActionListener(java.awt.event.ActionListener listener)
          Registers an ActionListener with this LButtonGroup.
 java.util.Enumeration getElements()
          Returns the buttons in this group.
 javax.swing.AbstractButton getSelectedButton()
          Returns the currently selected button.
 javax.swing.ButtonModel getSelection()
          Returns the currently selected button.
 void remove(javax.swing.AbstractButton b)
          Removes a button from this group.
 void removeActionListener(java.awt.event.ActionListener listener)
          Unregisters an ActionListener with this LButtonGroup.
 void selectNone()
          Deselects all buttons.
 
Methods inherited from class javax.swing.ButtonGroup
getButtonCount, isSelected, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LButtonGroup

public LButtonGroup(boolean none_is_legal)
Specifies whether select-none is allowed.

Details: This constructor allows the caller to specify whether select-none is allowed.

Parameters:
none_is_legal - select-none is allowed
Since:
1998.11.18
Method Detail

add

public void add(javax.swing.AbstractButton b)
Adds a button to this group.
Overrides:
add in class javax.swing.ButtonGroup
Parameters:
b - the button
Since:
1988.11.13

remove

public void remove(javax.swing.AbstractButton b)
Removes a button from this group.
Overrides:
remove in class javax.swing.ButtonGroup
Parameters:
b - the button
Since:
1988.11.18

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Broadcasts ActionEvents to ActionListeners.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the ActionEvent to broadcast
Since:
1988.11.13

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Registers an ActionListener with this LButtonGroup.

Details: addActionListener registers the given ActionListener to receive ActionEvents from buttons in this LButtonGroup.

ActionListeners that register with this LButtonGroup should unregister themselves when the listeners are no longer used. See removeActionListener.

Parameters:
listener - the ActionListener to register
Since:
1988.11.13

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Unregisters an ActionListener with this LButtonGroup.

Details: removeActionListener removes the given ActionListener from the this LButtonGroup's list of registered listeners. The ActionListener will no longer receive ActionEvents through this LButtonGroup.

ActionListeners should unregister themselves when they are no longer in use.

Parameters:
listener - the ActionListener to unregister
Since:
1988.11.13

selectNone

public void selectNone()
Deselects all buttons.

Details: selectNone deselects the currently selected button so that none of the buttons in the group is selected. This method has no effect if select-none is not allowed. (This feature is specified in the contructor.)

Since:
1998.11.13

getElements

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

Details: getElements in this class does the same thing as getElements in the superclass: it returns an Enumeration of all the buttons in this group.

Overrides:
getElements in class javax.swing.ButtonGroup
Returns:
the buttons
Since:
1998.11.19

getSelection

public javax.swing.ButtonModel getSelection()
Returns the currently selected button.

Details: getSelection in this class does the same thing as getElements in the superclass: it returns the ButtonModel of the currently selected button. If no button is selected, null is returned.

Overrides:
getSelection in class javax.swing.ButtonGroup
Returns:
the currently selected button
Since:
1998.11.19

getSelectedButton

public javax.swing.AbstractButton getSelectedButton()
Returns the currently selected button.

Details: getSelectedButton returns the currently selected button. If no button is selected, null is returned.

Returns:
the currently selected button
Since:
1998.11.19

Sharkysoft home