|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
de.enough.polish.ui.Screen
de.enough.polish.ui.TabbedList
public class TabbedList
Provides several lists in tabs.
Copyright Enough Software 2007 - 2008
history
Jun 27, 2007 - rob creation
| Field Summary | |
|---|---|
static javax.microedition.lcdui.Command |
SELECT_COMMAND
|
| Fields inherited from class javax.microedition.lcdui.Canvas |
|---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
| Constructor Summary | |
|---|---|
TabbedList(java.lang.String title,
int defaultListType)
|
|
TabbedList(java.lang.String title,
int defaultListType,
Style style)
|
|
| Method Summary | |
|---|---|
void |
animate(long currentTime,
ClippingRegion repaintRegion)
Animates this screen. |
int |
append(int tabIndex,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart)
Appends an element to the Choice. |
int |
append(int tabIndex,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style style)
Appends an element to the Choice. |
int |
appendTab(javax.microedition.lcdui.Item item)
|
int |
appendTab(Item item)
|
int |
appendTab(Item item,
int tabListType,
Style style)
|
int |
appendTab(Item item,
Style style)
|
int |
appendTab(java.lang.String text,
javax.microedition.lcdui.Image icon)
|
int |
appendTab(java.lang.String text,
javax.microedition.lcdui.Image icon,
Style style)
|
protected void |
calculateContentArea(int x,
int y,
int width,
int height)
Calculates and sets the content area for this screen. |
protected java.lang.String |
createCssSelector()
Retrieves the CSS selector for this screen. |
void |
delete(int tabIndex,
int elementNum)
Deletes the element referenced by elementNum. |
void |
deleteAll(int tabIndex)
Deletes all elements from this Choice, leaving it
with zero elements. |
void |
deleteTab(int tabIndex)
|
int |
getCurrentTabIndex()
Retrieves the index of the currently selected tab. |
javax.microedition.lcdui.Image |
getImage(int tabIndex,
int elementNum)
Gets the Image part of the element referenced by
elementNum. |
protected Item[] |
getRootItems()
Retrieves all root-items of this screen. |
int |
getSelectedFlags(int tabIndex,
boolean[] selectedArray_return)
Queries the state of a Choice and returns the state of all elements in the boolean array
selectedArray_return. |
int |
getSelectedIndex(int tabIndex)
Returns the index number of an element in the Choice that is
selected. |
java.lang.String |
getString(int tabIndex,
int elementNum)
Gets the String part of the element referenced by
elementNum. |
ChoiceGroup |
getTab(int tabIndex)
|
int |
getTabNumber()
|
protected boolean |
handleKeyPressed(int keyCode,
int gameAction)
Handles the key-pressed event. |
protected boolean |
handlePointerPressed(int x,
int y)
Handles the pressing of a pointer. |
protected boolean |
handlePointerReleased(int x,
int y)
Handles the release of a pointer. |
void |
hideNotify()
Unregisters this screen and notifies all items that they will not be shown anymore. |
void |
insert(int tabIndex,
int elementNum,
ChoiceItem item,
Style style)
Inserts an element into the Choice just prior to the element specified. |
void |
insert(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart)
Inserts an element into the Choice just prior to the element specified. |
void |
insert(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style style)
Inserts an element into the Choice just prior to the element specified. |
boolean |
isSelected(int tabIndex,
int elementNum)
Gets a boolean value indicating whether this element is selected. |
protected void |
paintScreen(javax.microedition.lcdui.Graphics g)
Paints the screen. |
void |
set(int tabIndex,
int elementNum,
ChoiceItem item)
Sets the String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element. |
void |
set(int tabIndex,
int elementNum,
ChoiceItem item,
Style elementStyle)
Sets the String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element. |
void |
set(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart)
Sets the String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element. |
void |
set(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style elementStyle)
Sets the String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element. |
void |
setCurrentTab(int tabIndex)
|
void |
setSelectCommand(javax.microedition.lcdui.Command selectCommand)
|
void |
setSelectedFlags(int tabIndex,
boolean[] selectedArray)
Attempts to set the selected state of every element in the Choice. |
void |
setSelectedIndex(int tabIndex,
int elementNum,
boolean selected)
For MULTIPLE, this simply sets an individual element's selected state. |
void |
setStyle(Style style)
Sets the style of this screen. |
void |
setTabStyle(int tabIndex)
|
void |
setTabStyle(int tabIndex,
Style style)
|
int |
size(int tabIndex)
Gets the number of elements present. |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
getHeight, getTicker, getWidth, setTicker |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static javax.microedition.lcdui.Command SELECT_COMMAND
| Constructor Detail |
|---|
public TabbedList(java.lang.String title,
int defaultListType)
title -
public TabbedList(java.lang.String title,
int defaultListType,
Style style)
title - | Method Detail |
|---|
public int appendTab(javax.microedition.lcdui.Item item)
public int appendTab(java.lang.String text,
javax.microedition.lcdui.Image icon)
public int appendTab(java.lang.String text,
javax.microedition.lcdui.Image icon,
Style style)
public int appendTab(Item item)
public int appendTab(Item item,
Style style)
public int appendTab(Item item,
int tabListType,
Style style)
public void deleteTab(int tabIndex)
public void setCurrentTab(int tabIndex)
public void setTabStyle(int tabIndex)
public void setTabStyle(int tabIndex,
Style style)
public ChoiceGroup getTab(int tabIndex)
public int getTabNumber()
public void setSelectCommand(javax.microedition.lcdui.Command selectCommand)
protected void calculateContentArea(int x,
int y,
int width,
int height)
Screen
calculateContentArea in class Screenx - left start of the content area, might later be adjusted by an external scrollindicatory - top start of the content area, is adjusted by the top margin, title height, subtitle height,
info height and maybe ticker height (when the ticker should be painted at the top).width - width of the content area, might later be adjusted by an external scrollindicatorheight - height of the content area, is adjusted by the title height, subtitle height,
info height and ticker height.
protected boolean handleKeyPressed(int keyCode,
int gameAction)
Screen
handleKeyPressed in class ScreenkeyCode - the code of the pressed key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
protected boolean handlePointerPressed(int x,
int y)
Screen
handlePointerPressed in class Screenx - the absolute x position of the pointer pressingy - the absolute y position of the pointer pressing
protected boolean handlePointerReleased(int x,
int y)
Screen
handlePointerReleased in class Screenx - the absolute x position of the pointer pressingy - the absolute y position of the pointer pressing
protected void paintScreen(javax.microedition.lcdui.Graphics g)
Screen
paintScreen in class Screeng - the graphics on which the screen should be paintedScreen.contentX,
Screen.contentY,
Screen.contentWidth,
Screen.contentHeight,
Screen.paintScrollIndicator,
Screen.paintScrollIndicatorUp,
Screen.paintScrollIndicatorDownpublic void setStyle(Style style)
Screen
setStyle in class Screenstyle - the style
public void animate(long currentTime,
ClippingRegion repaintRegion)
Screen
animate in class ScreencurrentTime - the current time in millisecondsrepaintRegion - the repaint area that needs to be updated when this item is animatedprotected Item[] getRootItems()
Screen
getRootItems in class Screenpublic void hideNotify()
Screen
hideNotify in interface AccessibleCanvashideNotify in class Screenprotected java.lang.String createCssSelector()
Screen
createCssSelector in class Screenpublic int size(int tabIndex)
public java.lang.String getString(int tabIndex,
int elementNum)
String part of the element referenced by
elementNum.
The elementNum parameter must be within the range
[0..size()-1], inclusive.
tabIndex - the index of the tabelementNum - the index of the element to be queried
java.lang.IndexOutOfBoundsException - - if elementNum is invalidgetImage(int, int)
public javax.microedition.lcdui.Image getImage(int tabIndex,
int elementNum)
Image part of the element referenced by
elementNum.
The elementNum parameter must be within the range
[0..size()-1], inclusive.
tabIndex - the index of the tabelementNum - the index of the element to be queried
java.lang.IndexOutOfBoundsException - - if elementNum is invalidgetString(int, int)
public int append(int tabIndex,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart)
Choice. The added
element will be the last
element of the Choice. The size of the
Choice grows by one.
tabIndex - the index of the tabstringPart - the string part of the element to be addedimagePart - the image part of the element to be added, or null if there is no image part
java.lang.NullPointerException - - if stringPart is null
public int append(int tabIndex,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style style)
Choice. The added
element will be the last
element of the Choice. The size of the
Choice grows by one.
tabIndex - the index of the tabstringPart - the string part of the element to be addedimagePart - the image part of the element to be added, or null if there is no image part
java.lang.NullPointerException - - if stringPart is null
public void insert(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart)
Choice just prior to the element specified.
The size of the Choice grows by one.
The elementNum parameter must be within the range
[0..size()], inclusive. The index of the last
element is size()-1, and
so there is actually no element whose index is
size(). If this value
is used for elementNum, the new element is
inserted immediately after
the last element. In this case, the effect is identical to
append().
tabIndex - the index of the tabelementNum - the index of the element where insertion is to occurstringPart - the string part of the element to be insertedimagePart - the image part of the element to be inserted, or null if there is no image part
java.lang.IndexOutOfBoundsException - - if elementNum is invalid
java.lang.NullPointerException - - if stringPart is null
public void insert(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style style)
Choice just prior to the element specified.
The size of the Choice grows by one.
The elementNum parameter must be within the range
[0..size()], inclusive. The index of the last
element is size()-1, and
so there is actually no element whose index is
size(). If this value
is used for elementNum, the new element is
inserted immediately after
the last element. In this case, the effect is identical to
append().
tabIndex - the index of the tabelementNum - the index of the element where insertion is to occurstringPart - the string part of the element to be insertedimagePart - the image part of the element to be inserted, or null if there is no image part
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is null
public void insert(int tabIndex,
int elementNum,
ChoiceItem item,
Style style)
Choice just prior to the element specified.
The size of the Choice grows by one.
The elementNum parameter must be within the range
[0..size()], inclusive. The index of the last
element is size()-1, and
so there is actually no element whose index is
size(). If this value
is used for elementNum, the new element is
inserted immediately after
the last element. In this case, the effect is identical to
append().
tabIndex - the index of the tabelementNum - the index of the element where insertion is to occuritem - the itemstyle - the style oft the item
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is null
public void delete(int tabIndex,
int elementNum)
elementNum.
The size of the Choice shrinks by
one. It is legal to delete all elements from a Choice.
The elementNum parameter must be within the range
[0..size()-1], inclusive.
tabIndex - the index of the tabelementNum - the index of the element to be deleted
java.lang.IndexOutOfBoundsException - if elementNum is invalidpublic void deleteAll(int tabIndex)
Choice, leaving it
with zero elements.
This method does nothing if the Choice is already empty.
tabIndex - the index of the tab
public void set(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart)
String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element.
The elementNum parameter must be within the range
[0..size()-1], inclusive. The font attribute of
the element is left unchanged.
tabIndex - the index of the tabelementNum - the index of the element to be setstringPart - the string part of the new elementimagePart - the image part of the element, or null if there is no image part
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is null
public void set(int tabIndex,
int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style elementStyle)
String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element.
The elementNum parameter must be within the range
[0..size()-1], inclusive. The font attribute of
the element is left unchanged.
tabIndex - the index of the tabelementNum - the index of the element to be setstringPart - the string part of the new elementimagePart - the image part of the element, or null if there is no image partelementStyle - the style of the new element
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is null
public void set(int tabIndex,
int elementNum,
ChoiceItem item)
String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element.
The elementNum parameter must be within the range
[0..size()-1], inclusive. The font attribute of
the element is left unchanged.
tabIndex - the index of the tabelementNum - the index of the element to be setitem - the element
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is null
public void set(int tabIndex,
int elementNum,
ChoiceItem item,
Style elementStyle)
String and Image parts of the element referenced by elementNum,
replacing the previous contents of the element.
The elementNum parameter must be within the range
[0..size()-1], inclusive. The font attribute of
the element is left unchanged.
tabIndex - the index of the tabelementNum - the index of the element to be setitem - the elementelementStyle - the style of the item
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is null
public boolean isSelected(int tabIndex,
int elementNum)
elementNum parameter must be within the range
[0..size()-1], inclusive.
tabIndex - the index of the tabelementNum - the index of the element to be queried
java.lang.IndexOutOfBoundsException - if elementNum is invalidpublic int getSelectedIndex(int tabIndex)
Choice that is
selected. For
Choice types EXCLUSIVE,
POPUP, and IMPLICIT
there is at most one element selected, so
this method is useful for determining the user's
choice. Returns -1 if
the Choice has no elements (and therefore has no
selected elements).
For MULTIPLE, this always returns
-1 because no single
value can in general represent the state of such a Choice.
To get the complete state of a MULTIPLE Choice,
see getSelectedFlags.
tabIndex - the index of the tab
setSelectedIndex(int, int, boolean)
public int getSelectedFlags(int tabIndex,
boolean[] selectedArray_return)
Choice 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 Choice as returned by size().
If the array is longer, the extra
elements are set to false.
This call is valid for all types of
Choices. For MULTIPLE, any
number of elements may be selected and set to true
in the result
array. For EXCLUSIVE, POPUP, and
IMPLICIT
exactly one element will be selected (unless there are
zero elements in the Choice).
tabIndex - the index of the tabselectedArray_return - - array to contain the results
java.lang.IllegalArgumentException - - if selectedArray_return is shorter than the size of the Choice.
java.lang.NullPointerException - - if selectedArray_return is nullsetSelectedFlags(int, boolean[])
public void setSelectedIndex(int tabIndex,
int elementNum,
boolean selected)
MULTIPLE, this simply sets an individual element's selected state.
For EXCLUSIVE and POPUP,
this can be used only to select any
element, that is, the selected parameter must be
true . When an element is selected, the previously
selected element
is deselected. If selected is false , this
call is ignored. If element was already selected, the call has
no effect.
For IMPLICIT,
this can be used only to select any
element, that is, the selected parameter must be
true . When an element is selected, the previously
selected element
is deselected. If selected is false , this
call is ignored. If element was already selected, the call has
no effect.
The call to setSelectedIndex does not cause
implicit activation of
any Command.
For all list types, the elementNum parameter
must be within the range
[0..size()-1], inclusive.
tabIndex - the index of the tabelementNum - the index of the element, starting from zeroselected - the state of the element, where true means selected and false means not selected
java.lang.IndexOutOfBoundsException - if elementNum is invalidgetSelectedIndex(int)
public void setSelectedFlags(int tabIndex,
boolean[] selectedArray)
Choice.
The array
must be at least as long as the size of the
Choice. If the array is
longer, the additional values are ignored.
For Choice objects of type
MULTIPLE, this sets the selected
state of every
element in the Choice. An arbitrary number of
elements may be selected.
For Choice objects of type
EXCLUSIVE, POPUP,
and IMPLICIT, exactly one array
element must have the value true. If no element is
true, the
first element
in the Choice will be selected. If two or more
elements are true, the
implementation will choose the first true element
and select it.
tabIndex - the index of the tabselectedArray - an array in which the method collect the selection status
java.lang.IllegalArgumentException - if selectedArray is shorter than the size of the Choice
java.lang.NullPointerException - if selectedArray is nullgetSelectedFlags(int, boolean[])public int getCurrentTabIndex()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||