|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.ui.Control
Control is the base class for user-interface objects.
Field Summary | |
static int |
BOTTOM
constant used in param y in setRect. added by guich |
static int |
CENTER
constant used in params x and y in setRect. added by guich |
protected static int |
controlCount
used in the toString method. guich@102 |
protected boolean |
enabled
True if the control is enabled (accepts events) or false if not |
static int |
FILL
constant used in params width and height in setRect. added by guich |
FontMetrics |
fm
the fontMetrics corresponding to the controls font. added by guich |
protected Font |
font
the font used by the control. added by guich |
protected int |
height
The control's height |
static int |
LEFT
constant used in param x in setRect. added by guich |
protected java.lang.String |
name
used in the toString method. guich@102 |
protected Control |
next
The control's next sibling. |
protected Container |
parent
The parent of the control. |
static int |
PREFERRED
constant used in params width and height in setRect. added by guich |
protected Control |
prev
The control's previous sibling. |
static int |
RIGHT
constant used in param x in setRect. added by guich |
static int |
TOP
constant used in param y in setRect. added by guich |
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 | |
protected |
Control()
creates the font for this control as the same font of the MainWindow. added by guich |
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. |
Rect |
getAbsoluteRect()
returns the absolute coordinates of this control relative to the MainWindow. added by guich |
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. |
int |
getPreferredHeight()
returns the preffered height of this control. added by guich |
int |
getPreferredWidth()
returns the preffered width of this control. added by guich |
Rect |
getRect()
Returns a copy of the control's rectangle. |
boolean |
isEnabled()
returns if this control can or not accept events |
boolean |
isVisible()
returns true if this control is visible, false otherwise |
protected void |
onBoundsChanged()
called after an setRect. added by guich |
void |
onEvent(Event event)
Called to process key, pen, control and other posted events. |
void |
onPaint(Graphics g)
Called to draw the control. |
protected void |
onWindowPaintFinished()
called after the window has finished a paint. |
void |
postEvent(Event event)
Posts an event. |
boolean |
removeTimer(Timer timer)
Removes a timer from a control. |
void |
repaint()
Redraws the control. |
void |
repaintNow()
Redraws the control immediately. |
void |
setEnabled(boolean enabled)
sets if this control can or not accept events |
void |
setFont(Font font)
sets the font of this conrol. added by guich |
void |
setRect(int x,
int y,
int width,
int height)
Sets or changes a control's position and size. |
void |
setRect(Rect r)
Sets or changes a control's position and size. |
void |
setVisible(boolean visible)
shows or "hides" this control. the "hide" works setting the control's size to zero. it remains attached to its container. unhidding restores the original size. you can change the controls size when hided if you want. calls repaint. |
Methods inherited from class java.lang.Object |
hashCode,
toString |
Field Detail |
public static final int PREFERRED
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public static final int FILL
protected int x
protected int y
protected int width
protected int height
protected Container parent
protected Control next
protected Control prev
protected boolean enabled
protected Font font
public FontMetrics fm
protected static int controlCount
protected java.lang.String name
Constructor Detail |
protected Control()
Method Detail |
public Timer addTimer(int millis)
millis
- the timer tick interval in millisecondsControlEvent
public boolean removeTimer(Timer timer)
public void setFont(Font font)
public int getPreferredWidth()
public int getPreferredHeight()
public FontMetrics getFontMetrics(Font font)
public void setRect(Rect r)
public void setRect(int x, int y, int width, int height)
public void setVisible(boolean visible)
public boolean isVisible()
public Rect getRect()
public Rect getAbsoluteRect()
public Container getParent()
public Control getNext()
public boolean contains(int x, int y)
public void repaint()
public void repaintNow()
public Graphics createGraphics()
public void postEvent(Event event)
Event
public void setEnabled(boolean enabled)
public boolean isEnabled()
public void onEvent(Event event)
event
- the event to processEvent
,
KeyEvent
,
PenEvent
public void onPaint(Graphics g)
g
- the graphics object for drawingGraphics
protected void onBoundsChanged()
protected void onWindowPaintFinished()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |