|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--brf.j2me.dynaworks.ui.BasicWidget
Basic implementation of a UserWidget.
This class can be used (extended) for many custom controls.
UserWidget| Field Summary | |
protected static Graphics |
g
static reference to the graphics canvas. |
protected int |
h
height (in pixel) of the control. |
protected int |
w
width (in pixel) of the control. |
protected int |
x
x-coordinate of the upper-left corner. |
protected int |
y
y-coordinate of the upper-left corner. |
| Constructor Summary | |
BasicWidget()
|
|
| Method Summary | |
(package private) static void |
|
boolean |
contains(int xc,
int yc)
check if point is inside the widget |
ActionEvent |
handleKeyDown(int keyCode)
Handle a "keyDown" event. |
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. |
ActionEvent |
handleSysKeyDown(int keyCode)
Handle a "sysKeyDown" event. |
boolean |
hasFocus()
Does the control have the focus? |
void |
loseFocus()
control is losing the focus. |
abstract void |
paint()
Paint the user control. |
void |
setFocus()
set the focus on this control |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
| Field Detail |
protected int x
protected int y
protected int w
protected int h
protected static Graphics g
| Constructor Detail |
public BasicWidget()
| Method Detail |
static void()
public boolean contains(int xc,
int yc)
contains in interface UserWidgetxc - int - x coordinate of check point.yc - int - y coordinate of check point.public void setFocus()
setFocus in interface UserWidgetpublic boolean hasFocus()
hasFocus in interface UserWidgetpublic void loseFocus()
loseFocus in interface UserWidget
public ActionEvent handlePenDown(int xc,
int yc)
handlePenDown in interface UserWidgetxc - int - x coordinate of hit point.yc - int - y coordinate of hit point.ActionEvent
public ActionEvent handlePenMove(int xc,
int yc)
handlePenMove in interface UserWidgetxc - int - x coordinate of pen point.yc - int - y coordinate of pen point.ActionEvent
public ActionEvent handlePenUp(int xc,
int yc)
handlePenUp in interface UserWidgetxc - int - x coordinate of pen point.yc - int - y coordinate of pen point.ActionEventpublic ActionEvent handleKeyDown(int keyCode)
handleKeyDown in interface UserWidgetkey - int - key send to the control.ActionEventpublic ActionEvent handleSysKeyDown(int keyCode)
handleSysKeyDown in interface UserWidgetkey - int - key send to the control.ActionEventpublic abstract void paint()
paint in interface UserWidget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||