java.lang.Object
javax.microedition.lcdui.Item
javax.microedition.lcdui.ChoiceGroup
- All Implemented Interfaces:
- Choice
- public class ChoiceGroup
- extends Item
- implements Choice
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
items
ChoiceGroup.ChoiceItem[] items
numOfItems
int numOfItems
choiceType
int choiceType
highlightedItemIndex
int highlightedItemIndex
multiOff
static byte[] multiOff
multiOn
static byte[] multiOn
radioOff
static byte[] radioOff
radioOn
static byte[] radioOn
imgMultiOff
private static final Image imgMultiOff
imgMultiOn
private static final Image imgMultiOn
imgRadioOff
private static final Image imgRadioOff
imgRadioOn
private static final Image imgRadioOn
ChoiceGroup
public ChoiceGroup(java.lang.String label,
int choiceType)
ChoiceGroup
public ChoiceGroup(java.lang.String label,
int choiceType,
java.lang.String[] stringElements,
Image[] imageElements)
append
public int append(java.lang.String stringPart,
Image imagePart)
- Specified by:
append
in interface Choice
delete
public void delete(int itemNum)
- Specified by:
delete
in interface Choice
getImage
public Image getImage(int elementNum)
- Specified by:
getImage
in interface Choice
getSelectedFlags
public int getSelectedFlags(boolean[] selectedArray_return)
- Queries the state of a ChoiceGroup and returns the state of all elements in
the boolean array selectedArray_return. NOTE: this is a result parameter.
It must be at least as long as the size of the ChoiceGroup as returned by
size(). If the array is longer, the extra elements are set to false.
For ChoiceGroup objects of type MULTIPLE, any number of elements may be
selected and set to true in the result array. For ChoiceGroup objects of
type EXCLUSIVE, exactly one element will be selected, unless there are zero
elements in the ChoiceGroup.
- Specified by:
getSelectedFlags
in interface Choice
getSelectedIndex
public int getSelectedIndex()
- Returns the index number of an element in the ChoiceGroup that is
selected. For ChoiceGroup objects of type EXCLUSIVE there is at most one
element selected, so this method is useful for determining the user's
choice. Returns -1 if there are no elements in the ChoiceGroup.
For ChoiceGroup objects of type MULTIPLE, this always returns -1 because
no single value can in general represent the state of such a ChoiceGroup.
To get the complete state of a MULTIPLE Choice, see getSelectedFlags.
- Specified by:
getSelectedIndex
in interface Choice
getString
public java.lang.String getString(int elementNum)
- Specified by:
getString
in interface Choice
insert
public void insert(int elementNum,
java.lang.String stringPart,
Image imagePart)
- Specified by:
insert
in interface Choice
isSelected
public boolean isSelected(int elementNum)
- Specified by:
isSelected
in interface Choice
set
public void set(int elementNum,
java.lang.String stringPart,
Image imagePart)
- Specified by:
set
in interface Choice
setLabel
public void setLabel(java.lang.String label)
- Overrides:
setLabel
in class Item
setSelectedFlags
public void setSelectedFlags(boolean[] selectedArray)
- Specified by:
setSelectedFlags
in interface Choice
setSelectedIndex
public void setSelectedIndex(int elementNum,
boolean selected)
- Specified by:
setSelectedIndex
in interface Choice
size
public int size()
- Specified by:
size
in interface Choice
isFocusable
boolean isFocusable()
- Overrides:
isFocusable
in class Item
getHeight
int getHeight()
- Overrides:
getHeight
in class Item
paint
int paint(Graphics g)
- Specified by:
paint
in class Item
select
boolean select()
- Overrides:
select
in class Item
traverse
int traverse(int gameKeyCode,
int top,
int bottom,
boolean action)
- Overrides:
traverse
in class Item