qflib 0.98.0

de.qfs.lib.option
Class RadioOptionGroup

java.lang.Object
  |
  +--de.qfs.lib.option.OptionGroup
        |
        +--de.qfs.lib.option.RadioOptionGroup

public class RadioOptionGroup
extends OptionGroup

A RadioOptionGroup consists of a group of mutually exclusive RadioButtons for one Option value. The option should be an IntegerOption, its value between 1 and the number of buttons.

The RadioOptionGroup uses the following resources:

Resource name Usage
option.group.groupname.type A RadioOptionGroup is designated by the type radio.
option.name.disabled If true, the group will be disabled and remain so even if setEnabled(true) is called (optional, default false).
option.group.groupname.option The name of the Option for the group.
option.group.groupname.numchoices The number of Buttons in the group.
option.group.groupname.choicen.label The label for the nth button of the group, where n is between 1 and numchoices.
option.group.groupname.choicen.mnemonic Keyboard accelerator for the nth button of the group (optional, default none).
option.group.groupname.columns The number of columns in which to place the buttons of the group (optional, default 1).
option.group.groupname.frame Whether the group should have a framed border (optional, default false).
option.group.groupname.title The title for a framed border of the group. Ignored if no frame is specified(optional, default empty).

Version:
$Revision: 1.16 $
Author:
Gregor Schmid

Field Summary
protected  javax.swing.ButtonGroup buttonGroup
          The ButtonGroup that manages the JButtons.
protected  java.util.List buttons
          The JButton members of the ButtonGroup.
protected  java.util.List choices
          The possible choices.
protected  Grid grid
          The Grid Component that holds the members of the RadioOptionGroup.
protected  Option option
          The Option that holds the value for the selected Button.
 
Fields inherited from class de.qfs.lib.option.OptionGroup
disabled, enabled, members, name, options, parent, title, titleBorder
 
Constructor Summary
protected RadioOptionGroup()
          No arg constructor for customized OptionGroups.
  RadioOptionGroup(java.lang.String name, OptionSet options)
          Create a new RadioOptionGroup.
 
Method Summary
 boolean checkValues()
          Check the values.
protected  void getChoices()
          Create the possible choices.
 java.awt.Component getComponent()
          Get the AWT Component for the OptionGroup.
 Option getOption()
          Get the option that holds the value for the RadioOptionGroup.
protected  void makeGrid()
          Create the Grid for the group members.
 void notifyOptionObservers()
          Notify the option's Observers.
 void readValues()
          Store the value for the selected Button in the Option.
 void setEnabled(boolean enabled)
          Set the enabled state for the buttons.
 void update(OptionSet options)
          Update display for possibly new Options.
 
Methods inherited from class de.qfs.lib.option.OptionGroup
createMembers, findEdit, findGroup, getGroup, getIndexOfMember, getMember, getMemberCount, getName, getParentGroup, isDisabled, makeBorder, makeGroup, setDisabled, setParentGroup, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

choices

protected java.util.List choices
The possible choices.

grid

protected Grid grid
The Grid Component that holds the members of the RadioOptionGroup.

option

protected Option option
The Option that holds the value for the selected Button.

buttonGroup

protected javax.swing.ButtonGroup buttonGroup
The ButtonGroup that manages the JButtons.

buttons

protected java.util.List buttons
The JButton members of the ButtonGroup.
Constructor Detail

RadioOptionGroup

protected RadioOptionGroup()
No arg constructor for customized OptionGroups.

RadioOptionGroup

public RadioOptionGroup(java.lang.String name,
                        OptionSet options)
Create a new RadioOptionGroup.
Parameters:
name - The name of the group.
options - The Options to edit.
Method Detail

getOption

public Option getOption()
Get the option that holds the value for the RadioOptionGroup.
Returns:
Get the RadioOptionGroup's option.
Since:
0.98.0

checkValues

public boolean checkValues()
Check the values.
Overrides:
checkValues in class OptionGroup
Returns:
True if the selected button is accepted by the Option.

readValues

public void readValues()
Store the value for the selected Button in the Option.
Overrides:
readValues in class OptionGroup

notifyOptionObservers

public void notifyOptionObservers()
Notify the option's Observers.
Overrides:
notifyOptionObservers in class OptionGroup

update

public void update(OptionSet options)
Update display for possibly new Options. The name and type of the Options in the OptionSet must be the same as before.
Overrides:
update in class OptionGroup
Parameters:
options - The new OptionSet.

setEnabled

public void setEnabled(boolean enabled)
Set the enabled state for the buttons.
Overrides:
setEnabled in class OptionGroup
Parameters:
enabled - The enabled state to set.

getComponent

public java.awt.Component getComponent()
Get the AWT Component for the OptionGroup.
Overrides:
getComponent in class OptionGroup
Returns:
The Component.

getChoices

protected void getChoices()
Create the possible choices.

makeGrid

protected void makeGrid()
Create the Grid for the group members.

qflib 0.98.0