|
||||||||||
| 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.Slider
Custom user control widget for a slider.
Implements a horizontally oriented slider control.
BasicWidget,
UserWidget| Field Summary | |
private int |
max
range values (maximum). |
private int |
min
range values (minimum). |
private int |
pos
position of the slider. |
private int |
r
current visible range. |
private int |
xr
x-coordinate of upper-right corner. |
private int |
yb
y-coordinate of lower-left corner. |
| Fields inherited from class brf.j2me.dynaworks.ui.BasicWidget |
g, h, w, x, y |
| Constructor Summary | |
Slider(int x,
int y,
int w,
int h)
constructor. |
|
| Method Summary | |
int |
getPosition()
get the current position. |
ActionEvent |
handlePenDown(int xc,
int yc)
Handle a "pen down" event. |
ActionEvent |
handlePenMove(int xc,
int yc)
Handle a "pen move" event. |
void |
paint()
Paint the user control. |
int |
setPosition(int pos)
set the position of the slider. |
void |
setRange(int min,
int max,
int pos)
set the range for the slider. |
void |
update(int lastPos)
update the slider representation. |
| 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 |
private int min
private int max
private int r
private int pos
private int xr
private int yb
| Constructor Detail |
public Slider(int x,
int y,
int w,
int h)
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.| Method Detail |
public void setRange(int min,
int max,
int pos)
min - int - minimum value for slider.max - int - maximum value for slider.pos - int - start position for marker.public int setPosition(int pos)
pos - int - new position of slider.public int getPosition()
public ActionEvent handlePenDown(int xc,
int yc)
handlePenDown in class BasicWidgetxc - int - x coordinate of hit point.yc - int - y coordinate of hit point.ActionEvent
public ActionEvent handlePenMove(int xc,
int yc)
handlePenMove in class BasicWidgetxc - int - x coordinate of pen point.yc - int - y coordinate of pen point.ActionEventpublic void paint()
paint in class BasicWidgetpublic void update(int lastPos)
Just repaint the changed parts of the control.
lastPos - int - fast repaint based on last position.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||