|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--brf.j2me.dynaworks.ui.BasicWidget
|
+--brf.j2me.dynaworks.ui.ListBox
Control to list an array of strings and to provide selection of entries.
BasicWidget,
UserWidget| Field Summary | |
protected java.util.Vector |
allItems
Items able to be displayed |
private ListItem |
currItem
reference to currently active item. |
private int |
currItemIndex
|
protected java.util.Vector |
displayedList
The items in this List that are displayed. |
protected int |
displayNum
Default value for how many items we can display. |
private int |
dragState
current dragging mode |
private int |
dragX
we are dragging from here |
private int |
dragY
|
private int |
firstVisible
index of first visible item |
static int |
GROUP
|
private int |
height
height of a tree control. |
private ScrollBar |
hs
reference to horizontal scrollbar. |
static int |
MULTIPLE
|
static int |
SCR_HORZ
|
static int |
SCR_VERT
|
private int |
scrollX
horizontal scroll position. |
private int |
scrollXmax
maximum x-scroll value for current layout |
private int |
scrollY
vertical scroll position. |
private int |
scrollYmax
maximum y-scroll value for current layout |
private int |
selMode
selection mode for listbox. |
static int |
SIMPLE
Selection mode flags |
static int |
SINGLE
|
private int |
syncState
status of synchronization: 0 = up-to-date |
private ScrollBar |
vs
reference to vertical scrollbar. |
private int |
width
width of the tree control. |
| Fields inherited from class brf.j2me.dynaworks.ui.BasicWidget |
g, h, w, x, y |
| Constructor Summary | |
ListBox(int x,
int y,
int w,
int h,
int style)
Creates an empty ListBox. |
|
| Method Summary | |
void |
addItem(ListItem item)
Inserts the item as an item in the list. |
private boolean |
addToDisplayedList(ListItem item)
add an item to the list of displayed items. |
int |
getSelectedIndex()
Return the index of the selected item. |
ListItem |
getSelectedItem()
Return the selected item in the list, null if the list is empty. |
ActionEvent |
handlePenDown(int xc,
int yc)
Handle a "pen down" event. |
ActionEvent |
handlePenMove(int xc,
int yc)
Handle a "pen move" event. |
ActionEvent |
handlePenUp(int xc,
int yc)
Handle a "pen up" event. |
private void |
initStyle(int style)
setup the style. |
void |
paint()
paint the graphics area. |
void |
removeAll()
deletes all items in the list. |
boolean |
removeItem(ListItem item)
Deletes the item from the list of items. |
void |
selectItem(ListItem item,
boolean redraw)
selects the item |
protected void |
setHorizontalOffset(int offset)
Sets the horizontal offset for painting the listbox and can be used e.g. |
protected void |
setVerticalOffset(int offset)
Sets the vertical offset for painting the ListBox and can be used e.g. |
private void |
sync()
synchronize inner state (list of displayed items.) |
| Methods inherited from class brf.j2me.dynaworks.ui.BasicWidget |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
| Field Detail |
public static final int SIMPLE
public static final int SINGLE
public static final int GROUP
public static final int MULTIPLE
public static final int SCR_VERT
public static final int SCR_HORZ
private int selMode
private int width
private int height
private ScrollBar hs
private int scrollX
private int scrollXmax
private ScrollBar vs
private int scrollY
private int scrollYmax
private int dragState
private int dragX
private int dragY
private ListItem currItem
private int currItemIndex
private int firstVisible
protected java.util.Vector displayedList
protected java.util.Vector allItems
private int syncState
protected int displayNum
| Constructor Detail |
public ListBox(int x,
int y,
int w,
int h,
int style)
x - int - x-coordinate of upper-left corner.y - int - y-coordinate of upper-left corner.w - int - width of the control.h - int - height of the control.style - int - style mode.| Method Detail |
public void paint()
paint in class BasicWidgetprivate void initStyle(int style)
style - int - tree style to be used.public ListItem getSelectedItem()
public int getSelectedIndex()
protected void setHorizontalOffset(int offset)
offset - int - use value as new horizontal offset.protected void setVerticalOffset(int offset)
offset - int - use value as new vertical offset.public void addItem(ListItem item)
item - ListItem - item to be inserted.public boolean removeItem(ListItem item)
item - ListItem - item to be removedpublic void removeAll()
public void selectItem(ListItem item,
boolean redraw)
item - ListItem - item to be selectedredraw - boolean - redraw control?private boolean addToDisplayedList(ListItem item)
item - ListItem - item to be addedprivate void sync()
public ActionEvent handlePenDown(int xc,
int yc)
handlePenDown in class BasicWidgetxc - int - x coordinate of pointyc - int - y coordinate of point
public ActionEvent handlePenMove(int xc,
int yc)
handlePenMove in class BasicWidgetxc - int - x coordinate of current pointyc - int - y coordinate of current point
public ActionEvent handlePenUp(int xc,
int yc)
handlePenUp in class BasicWidgetxc - int - x coordinate of current pointyc - int - y coordinate of current point
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||