ewe.ui
Class CheckBoxGroup

java.lang.Object
  extended byewe.data.DataObject
      extended byewe.util.Vector
          extended byewe.ui.CheckBoxGroup
All Implemented Interfaces:
Comparable, Copyable, DataUnit, EventListener, Intable, Textable

public class CheckBoxGroup
extends Vector
implements EventListener, Textable, Intable

A CheckBoxGroup object is used to group together a set of mutually exclusive mCheckBox objects. In other words, it will turn a set of mCheckBoxes into radio buttons. Furthermore, any ControlEvent.PRESSED events which are generated by the checkboxes in the group will have its target changed so that it appears as if these events are originating from the CheckBoxGroup object (if takeTarget is true).


Field Summary
 boolean exclusive
           
 boolean takeTarget
          If takeTarget is true then ControlEvent.PRESSED events generated by the individual boxes will have its target changed so that it appears to be coming from this group.
 
Constructor Summary
CheckBoxGroup()
           
 
Method Summary
 CheckBoxGroup addCheck(mCheckBox what)
          Deprecated. - do not use this, use mCheckBox.setGroup() to add an mCheckBox.
 int getInt()
          This returns the same value as getSelectedIndex().
 mCheckBox getSelected()
          Returns the mCheckBox currently selected.
 int getSelectedIndex()
          Returns the index of the mCheckBox currently selected.
 String getText()
          Return the label of the selected checkbox, or an empty String if none is selected.
 void makePanel(String[] choices, CellPanel destination, int columns)
          This creates a set of new mCheckBox controls, each one of which is assigned a label as specified in the choices parameter.
 void onEvent(Event ev)
           
 void selectIndex(int index)
          Select the mCheckBox at the given index.
 void setInt(int value)
          This calls selectIndex() with the provided value.
 void setText(String value)
          This will turn on the checkbox in this group with a label the same as the provided String value.
 
Methods inherited from class ewe.util.Vector
add, add, add, addAll, addAll, addAll, addCopiesFrom, addElement, clear, compare, contains, copyCopiesFrom, copyFrom, copyInto, copyInto, del, elementAt, elements, find, find, get, getCount, getFullCopy, insert, insertElementAt, isEmpty, iterator, iterator, pop, push, remove, removeAllElements, removeElementAt, set, setElementAt, setSize, size, sort, sort, toArray, toArray, toObjectArray, toString, zero
 
Methods inherited from class ewe.data.DataObject
_getSetField, appendAllFields, compareTo, copied, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode
 

Field Detail

exclusive

public boolean exclusive

takeTarget

public boolean takeTarget
If takeTarget is true then ControlEvent.PRESSED events generated by the individual boxes will have its target changed so that it appears to be coming from this group.

Constructor Detail

CheckBoxGroup

public CheckBoxGroup()
Method Detail

getSelectedIndex

public int getSelectedIndex()
Returns the index of the mCheckBox currently selected.


getSelected

public mCheckBox getSelected()
Returns the mCheckBox currently selected.


selectIndex

public void selectIndex(int index)
Select the mCheckBox at the given index.


onEvent

public void onEvent(Event ev)
Specified by:
onEvent in interface EventListener

setInt

public void setInt(int value)
This calls selectIndex() with the provided value.

Specified by:
setInt in interface Intable

getInt

public int getInt()
This returns the same value as getSelectedIndex().

Specified by:
getInt in interface Intable

setText

public void setText(String value)
This will turn on the checkbox in this group with a label the same as the provided String value.

Specified by:
setText in interface Textable

getText

public String getText()
Return the label of the selected checkbox, or an empty String if none is selected.

Specified by:
getText in interface Textable

makePanel

public void makePanel(String[] choices,
                      CellPanel destination,
                      int columns)
This creates a set of new mCheckBox controls, each one of which is assigned a label as specified in the choices parameter. The mCheckBox controls are then added to the destination panel in the specified number of columns.

Parameters:
choices - a list of lables for each checkbox.
destination - a destination panel to add to.
columns - the number of columns to add.

addCheck

public CheckBoxGroup addCheck(mCheckBox what)
Deprecated. - do not use this, use mCheckBox.setGroup() to add an mCheckBox.