|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.TextMenu
public class TextMenu
Displays a list of items. The select() method allows the user to scroll the list using the right and left keys to scroll forward and backward through the list. The location of the list , and an optional title can be specified.
Field Summary | |
---|---|
static String |
blank
a blank line |
Constructor Summary | |
---|---|
TextMenu(String[] items)
This constructor sets location of the top row of the item list to row 0 of the display. |
|
TextMenu(String[] items,
int topRow)
This constructor allows specification location of the item list . |
|
TextMenu(String[] items,
int topRow,
String title)
This constuctor allows the specfication of a title (of up to 16 characters) and the location of the item list The title is displayed in the row above the item list. |
Method Summary | |
---|---|
String[] |
getItems()
returns list of items in this menu; |
void |
quit()
method to call from another thread to quit the menu |
void |
resetTimeout()
Reset the timeout period. |
int |
select()
Allows the user to scroll through the items, using the right and left buttons (forward and back) The Enter key closes the menu and returns the index of the selected item. |
int |
select(int selectedIndex)
Version of select without timeout |
int |
select(int selectedIndex,
int timeout)
Allows the user to scroll through the items, using the right and left buttons (forward and back) The Enter key closes the menu and returns the index of the selected item. |
void |
setItems(String[] items)
set the array of items to be displayed |
void |
setTitle(String title)
set menu title. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String blank
Constructor Detail |
---|
public TextMenu(String[] items)
public TextMenu(String[] items, int topRow)
public TextMenu(String[] items, int topRow, String title)
items
- - string array containing the menu items. No items beyond the first null will be displayed.Method Detail |
---|
public void setTitle(String title)
title
- the new titlepublic void setItems(String[] items)
items
- public int select()
public int select(int selectedIndex)
public int select(int selectedIndex, int timeout)
selectedIndex
- the index to start the menu on
public void quit()
public String[] getItems()
public void resetTimeout()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |