|
Ascent Phase Corp. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.ascentphase.suit.Widget
|
+--org.ascentphase.suit.ScrollList
A selection list that allows a user to select one choice amongst many that are available. Currently, the component supports only one selection. When the user selects a different item from the currently active item, the component will generate a Command event. When a Command event is received, the developer should call the ScrollList's getSelectedItem() method to determine which item is the currently selected item.
| Field Summary | |
protected int |
height
|
protected org.ascentphase.suit.ItemList |
itemList
|
protected int |
rows
|
protected int |
width
|
| Fields inherited from class org.ascentphase.suit.Widget |
cmdToThrow |
| Constructor Summary | |
ScrollList(org.ascentphase.suit.ItemList items,
int visibleRows,
int width)
Creates a list with the given ItemList. |
|
ScrollList(java.lang.String[] items,
int visibleRow,
int width)
Creates a list with the given array of Strings. |
|
ScrollList(java.util.Vector items,
int visibleRow,
int width)
Creates a list with the given Strings in the Vector. |
|
| Method Summary | |
boolean |
contains(int x,
int y)
Returns whether the given coordinate lies within this widget's area of interest. |
int |
getIndexOf(java.lang.String text)
Returns the index of the option with the given text. |
int |
getSelectedIndex()
Return the selected row. |
boolean |
isItemSelected(int idx)
Returns whether the given item index is selected. |
void |
paint(Graphics g)
Draws the widget. |
Command |
pointerReleased(int x,
int y)
Method called by the widget's containing Panel when a pointer is released over the widget area. |
void |
setFirstVisibleIndex(int idx)
Sets the first option that is visible on the scroll list. |
void |
setSelectedIndex(int row)
Sets the option at the given index as the active option. |
| Methods inherited from class org.ascentphase.suit.Widget |
getCommand, keyPressed, keyReleased, pointerDragged, pointerPressed, setCommand |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.ascentphase.suit.ItemList itemList
protected int rows
protected int width
protected int height
| Constructor Detail |
public ScrollList(org.ascentphase.suit.ItemList items,
int visibleRows,
int width)
items - Vector of Strings.visibleRows - number of rows to display in the list.width - the width in pixel of the list box.
public ScrollList(java.util.Vector items,
int visibleRow,
int width)
items - Vector of Strings.width - the width in pixel of the list box.
public ScrollList(java.lang.String[] items,
int visibleRow,
int width)
items - Vector of Strings.width - the width in pixel of the list box.| Method Detail |
public void paint(Graphics g)
paint in class Widgetg - the Graphics object to draw with.public int getSelectedIndex()
public void setSelectedIndex(int row)
row - the zero-based index of the option.public int getIndexOf(java.lang.String text)
text - the String value of the option.
public boolean contains(int x,
int y)
Widget
contains in class Widgetx - the x coordinate.y - the y coordinate.
public Command pointerReleased(int x,
int y)
Widget
pointerReleased in class Widgetx - the x-coordinate relative to the widget's origin.y - the y-coordinate relative to the widget's origin.
public boolean isItemSelected(int idx)
public void setFirstVisibleIndex(int idx)
|
Ascent Phase Corp. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||