|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjcontrol.ui.wombat.Component
jcontrol.ui.wombat.AbstractFocusComponent
jcontrol.ui.wombat.CheckBox
public class CheckBox
The CheckBox is a graphical component that can
be in either an "on" (true) or "off" (false) state.
When the user changes the state, an ActionEvent
of type STATE_CHANGED is fired.
(c) Copyright 2003-2007 DOMOLOGIC GmbH
| Field Summary |
|---|
| Fields inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
|---|
BORDER_WIDTH, listener |
| Fields inherited from interface jcontrol.ui.wombat.IFocusable |
|---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
| Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
|---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
| Constructor Summary | |
|---|---|
CheckBox(String label,
int x,
int y)
Create a new labeled CheckBox which is initially "off". |
|
CheckBox(String label,
int x,
int y,
int width,
int height)
Create a new labeled CheckBox with specified bounds which
is initially "off". |
|
| Method Summary | |
|---|---|
boolean |
isSelected()
Get the current state of this CheckBox. |
KeyEvent |
onKeyEvent(KeyEvent e)
Handle key events. |
int |
onTouchEvent(TouchEvent e)
Every time a touch event is fired, this method will be called. |
void |
paint(XGraphics g)
Paint the checkbox. |
void |
setSelected(boolean onoff)
Set the state of this CheckBox. |
void |
setText(String text)
Change the label if this check box. |
| Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
|---|
clearCorners, drawBevelRect, drawButton, drawDottedRect, drawFocusRect, getActionListener, onActionEvent, requestFocus, setActionListener, setEnabled, setVisible |
| Methods inherited from class jcontrol.ui.wombat.Component |
|---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, redrawInternalAndParent, repaint, repaintAll, safeExec, setBackgroundColor, setBackgroundColorInternal, setBounds, setDirty, setFont, setForegroundColor, setForegroundColorInternal, setParametersInternal, setRedraw, setTransparentColor, unsafeExec, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, notifyAll, toString, wait |
| Constructor Detail |
|---|
public CheckBox(String label,
int x,
int y)
CheckBox which is initially "off".
When no width and height are specified, a preferred size depending on the
label dimensions is calculated.
label - A String that is written on the CheckBox.x - The x-coordinate of this CheckBox.y - The y-coordinate of this CheckBox.
public CheckBox(String label,
int x,
int y,
int width,
int height)
CheckBox with specified bounds which
is initially "off".
label - A String that is written on the CheckBox.x - The x-coordinate of this CheckBox.y - The y-coordinate of this CheckBox.width - The width of this CheckBox.height - The height of this CheckBox.| Method Detail |
|---|
public void setText(String text)
text - The new label.public void setSelected(boolean onoff)
CheckBox. On calling this method, no ActionEvent is fired.
onoff - The new state of the check box.public boolean isSelected()
CheckBox.
public void paint(XGraphics g)
paint in class Componentg - the application's graphics object.public KeyEvent onKeyEvent(KeyEvent e)
onKeyEvent in interface KeyListeneronKeyEvent in class AbstractFocusComponente - The KeyEvent.
null if the KeyEvent has been consumed by the KeyListener,public int onTouchEvent(TouchEvent e)
TouchListener
onTouchEvent in interface TouchListeneronTouchEvent in class AbstractFocusComponente - The touch event.
RESULT_ACCEPTED if the TouchEvent has been consumed by the TouchListener,RESULT_EXECUTED if the TouchEvent has been consumed by the TouchListener and some important action has been performed, e.g. an action event has been invoked,RESULT_NONE if the TouchEvent should be passed on to the next TouchListener.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||