Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.microedition.lcdui
Class ChoiceGroup  view ChoiceGroup download ChoiceGroup.java

java.lang.Object
  extended byjavax.microedition.lcdui.Item
      extended byjavax.microedition.lcdui.ChoiceGroup
All Implemented Interfaces:
Choice

public class ChoiceGroup
extends Item
implements Choice


Nested Class Summary
(package private)  class ChoiceGroup.ChoiceItem
           
 
Field Summary
(package private)  int choiceType
           
(package private)  int highlightedItemIndex
           
private static Image imgMultiOff
           
private static Image imgMultiOn
           
private static Image imgRadioOff
           
private static Image imgRadioOn
           
(package private)  ChoiceGroup.ChoiceItem[] items
           
(package private) static byte[] multiOff
           
(package private) static byte[] multiOn
           
(package private)  int numOfItems
           
(package private) static byte[] radioOff
           
(package private) static byte[] radioOn
           
 
Fields inherited from class javax.microedition.lcdui.Item
labelComponent, OUTOFITEM, owner
 
Fields inherited from interface javax.microedition.lcdui.Choice
EXCLUSIVE, IMPLICIT, MULTIPLE
 
Constructor Summary
ChoiceGroup(java.lang.String label, int choiceType)
           
ChoiceGroup(java.lang.String label, int choiceType, java.lang.String[] stringElements, Image[] imageElements)
           
 
Method Summary
 int append(java.lang.String stringPart, Image imagePart)
           
 void delete(int itemNum)
           
(package private)  int getHeight()
           
 Image getImage(int elementNum)
           
 int getSelectedFlags(boolean[] selectedArray_return)
          Queries the state of a ChoiceGroup and returns the state of all elements in the boolean array selectedArray_return.
 int getSelectedIndex()
          Returns the index number of an element in the ChoiceGroup that is selected.
 java.lang.String getString(int elementNum)
           
 void insert(int elementNum, java.lang.String stringPart, Image imagePart)
           
(package private)  boolean isFocusable()
           
 boolean isSelected(int elementNum)
           
(package private)  int paint(Graphics g)
           
(package private)  boolean select()
           
 void set(int elementNum, java.lang.String stringPart, Image imagePart)
           
 void setLabel(java.lang.String label)
           
 void setSelectedFlags(boolean[] selectedArray)
           
 void setSelectedIndex(int elementNum, boolean selected)
           
 int size()
           
(package private)  int traverse(int gameKeyCode, int top, int bottom, boolean action)
           
 
Methods inherited from class javax.microedition.lcdui.Item
getLabel, getOwner, hasFocus, keyPressed, paintContent, repaint, setFocus, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ChoiceGroup

public ChoiceGroup(java.lang.String label,
                   int choiceType)

ChoiceGroup

public ChoiceGroup(java.lang.String label,
                   int choiceType,
                   java.lang.String[] stringElements,
                   Image[] imageElements)
Method Detail

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