|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbluegammon.gui.menu.MenuPage
A MenuPage
class represents a title and a number of choices in a Menu
.
The MenuPage
's choices are added as PageItem
s via the
addItem
method.
Menu
,
PageItem
Field Summary | |
static int |
LAYOUT_LEFT
Left aligned image, right aligned text |
static int |
LAYOUT_RIGHT
Right aligned image, left aligned text |
Constructor Summary | |
MenuPage(char[] title,
javax.microedition.lcdui.Image titleImage)
Creates a new page for a menu. |
Method Summary | |
void |
addItem(PageItem item)
Adds an item to this page. |
int |
getIndex(PageItem item)
Returns the index of specified item. |
int |
getLayout()
Returns the layout of the image, any of LAYOUT_LEFT, LAYOUT_RIGHT. |
int |
getSelectedIndex()
Returns the currently selected index in this page. |
char[] |
getTitle()
Returns the title of this page. |
javax.microedition.lcdui.Image |
getTitleImage()
Returns the title of this page. |
PageItem |
itemAt(int index)
Returns item at specified index. |
void |
removeAllItems()
Removes all items on this page |
void |
removeItem(int index)
Removes the item at specified index from this page. |
void |
removeItem(PageItem item)
Removes an item from this page. |
void |
setLayout(int layout)
Sets the layout of the image, any of LAYOUT_LEFT, LAYOUT_RIGHT. |
void |
setSelectedIndex(int index)
Sets the currently selected index in this page. |
void |
setTitle(char[] title)
Sets the title of this page. |
void |
setTitleImage(javax.microedition.lcdui.Image titleImage)
Sets the title image of this page. |
int |
size()
Returns number of items in this page. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LAYOUT_LEFT
public static final int LAYOUT_RIGHT
Constructor Detail |
public MenuPage(char[] title, javax.microedition.lcdui.Image titleImage)
title
- The title of the page or null.titleImage
- The image of the page or null.Method Detail |
public void setLayout(int layout)
layout
- Image layout.public int getLayout()
public char[] getTitle()
public void setTitle(char[] title)
title
- The page title.public javax.microedition.lcdui.Image getTitleImage()
public void setTitleImage(javax.microedition.lcdui.Image titleImage)
titleImage
- The page title iamge.public void addItem(PageItem item)
item
- The item to add.public void removeItem(PageItem item)
item
- The item to remove.public void removeItem(int index)
index
- The index of the item to remove.public int size()
public int getSelectedIndex()
public void setSelectedIndex(int index)
index
- Index of selected item.public PageItem itemAt(int index)
index
- The index of the idem
public int getIndex(PageItem item)
item
- The item whose index to find.
public void removeAllItems()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |