|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
waba.lang.Object | +--waba.ui.Control
Control is the base class for user-interface objects.
Field Summary | |
protected int |
height
The control's height |
protected Control |
next
The control's next sibling. |
protected Container |
parent
The parent of the control. |
protected Control |
prev
The control's previous sibling. |
protected int |
width
The control's width |
protected int |
x
The control's x location |
protected int |
y
The control's y location |
Constructor Summary | |
Control()
|
Method Summary | |
Timer |
addTimer(int millis)
Adds a timer to a control. |
boolean |
contains(int x,
int y)
Returns true if the given x and y coordinate in the parent's coordinate system is contained within this control. |
Graphics |
createGraphics()
Creates a Graphics object which can be used to draw in the control. |
FontMetrics |
getFontMetrics(Font font)
Returns the font metrics for a given font. |
Control |
getNext()
Returns the next child in the parent's list of controls. |
Container |
getParent()
Returns the control's parent container. |
Rect |
getRect()
Returns a copy of the control's rectangle. |
void |
onEvent(Event event)
Called to process key, pen, control and other posted events. |
void |
onPaint(Graphics g)
Called to draw the control. |
void |
postEvent(Event event)
Posts an event. |
boolean |
removeTimer(Timer timer)
Removes a timer from a control. |
void |
repaint()
Redraws the control. |
void |
setRect(int x,
int y,
int width,
int height)
Sets or changes a control's position and size. |
Methods inherited from class waba.lang.Object |
toString |
Field Detail |
protected int x
protected int y
protected int width
protected int height
protected Container parent
protected Control next
protected Control prev
Constructor Detail |
public Control()
Method Detail |
public Timer addTimer(int millis)
millis
- the timer tick interval in millisecondsControlEvent
public boolean removeTimer(Timer timer)
public FontMetrics getFontMetrics(Font font)
public void setRect(int x, int y, int width, int height)
public Rect getRect()
public Container getParent()
public Control getNext()
public boolean contains(int x, int y)
public void repaint()
public Graphics createGraphics()
public void postEvent(Event event)
Event
public void onEvent(Event event)
event
- the event to processEvent
,
KeyEvent
,
PenEvent
public void onPaint(Graphics g)
g
- the graphics object for drawingGraphics
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |