brf.j2me.dynaworks.ui
Class RadioGroup

java.lang.Object
  |
  +--brf.j2me.dynaworks.ui.RadioGroup

public class RadioGroup
extends java.lang.Object

RadioGroups contain two or more radio buttons. Only one RadioButton can be selected at any time.

Version:
1.0
Author:
Bernd R. Fix
See Also:
RadioButton

Field Summary
private  java.util.Vector buttonList
          list of associated RadioButtons.
private  RadioButton selected
          index of active radio button.
 
Constructor Summary
RadioGroup()
          constructor.
 
Method Summary
 boolean add(RadioButton button)
          add a radio button to the group.
 RadioButton buttonAt(int idx)
          get the radio button at a specific position in the list.
 void dispose()
          clean-up.
 RadioButton getSelected()
          get the currently active radio button.
 ActionEvent handleSelection(RadioButton button)
          handle the user-invoked selection of a radio button under control.
 void setSelected(RadioButton button)
          set the selected radio button.
 int size()
          get the number of radio buttons in this group.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

buttonList

private java.util.Vector buttonList
list of associated RadioButtons.


selected

private RadioButton selected
index of active radio button.

Constructor Detail

RadioGroup

public RadioGroup()
constructor.

Method Detail

add

public boolean add(RadioButton button)
add a radio button to the group.
Parameters:
button - RadioButton - control to be added.
Returns:
boolean - successful operation?
See Also:
RadioButton

size

public int size()
get the number of radio buttons in this group.

Returns:
int - number of radio buttons?.

getSelected

public RadioButton getSelected()
get the currently active radio button.

Returns:
RadioButton - active radio button.
See Also:
RadioButton

setSelected

public void setSelected(RadioButton button)
set the selected radio button.

Parameters:
button - RadioButton - radio button to be activated.
See Also:
RadioButton

buttonAt

public RadioButton buttonAt(int idx)
get the radio button at a specific position in the list.

Parameters:
idx - int - index of requested radio button.
Returns:
RadioButton - requested radio button.
See Also:
RadioButton

handleSelection

public ActionEvent handleSelection(RadioButton button)
handle the user-invoked selection of a radio button under control.

Parameters:
button - RadioButton - radio button that is invoked by the user.
Returns:
ActionEvent - generated event based on action.
See Also:
RadioButton, ActionEvent

dispose

public void dispose()
clean-up. free all references to radio buttons.