|
||||||||
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.RadioButton
public class RadioButton
A radio button is a graphical component that can be in either
an "on" (true) or "off" (false) state. When a radio button's
state is changed to "on", all other radio buttons in the same container
are set to "off".
When the user changes the state, an ActionEvent
of type STATE_CHANGED
is fired.
(c) Copyright 2005 DOMOLOGIC GmbH
Field Summary |
---|
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 | |
---|---|
RadioButton(java.lang.String label,
int x,
int y)
Create a new labeled RadioButton which is initially "off". |
|
RadioButton(java.lang.String label,
int x,
int y,
int width,
int height)
Create a new labeled RadioButton with specified bounds which
is initially "off". |
Method Summary | |
---|---|
boolean |
isSelected()
Get the current state of this RadioButton . |
KeyEvent |
onKeyEvent(KeyEvent e)
This method is called when a keyboard action has been performed. |
int |
onTouchEvent(TouchEvent e)
Every time a touch event is fired, this method will be called. |
void |
paint(jcontrol.graphics.XGraphics g)
Paint the radio button. |
void |
setSelected(boolean onoff)
Set the state of this RadioButton . |
void |
setText(java.lang.String label)
Change the label of this radio button. |
Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
---|
getActionListener, requestFocus, setActionListener, setEnabled, setVisible |
Methods inherited from class jcontrol.ui.wombat.Component |
---|
getFrame, isEnabled, isVisible, repaint, repaintAll, safeExec, setBackgroundColor, setBounds, setDirty, setFont, setForegroundColor, setRedraw, setTransparentColor, unsafeExec, update |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notifyAll, toString, wait |
Constructor Detail |
---|
public RadioButton(java.lang.String label, int x, int y)
RadioButton
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 RadioButton
.x
- The x-coordinate of this RadioButton
.y
- The y-coordinate of this RadioButton
.public RadioButton(java.lang.String label, int x, int y, int width, int height)
RadioButton
with specified bounds which
is initially "off".
label
- A String
that is written on the RadioButton
.x
- The x-coordinate of this RadioButton
.y
- The y-coordinate of this RadioButton
.width
- The width of this RadioButton
.height
- The height of this RadioButton
.Method Detail |
---|
public boolean isSelected()
RadioButton
.
public KeyEvent onKeyEvent(KeyEvent e)
AbstractFocusComponent
onKeyEvent
in interface KeyListener
onKeyEvent
in class AbstractFocusComponent
e
- the event that contains information about the key.
null
if the KeyEvent has been consumed by the KeyListener,public int onTouchEvent(TouchEvent e)
TouchListener
onTouchEvent
in interface TouchListener
onTouchEvent
in class AbstractFocusComponent
e
- 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.public void paint(jcontrol.graphics.XGraphics g)
paint
in class Component
g
- the application's graphics object.public void setSelected(boolean onoff)
RadioButton
.
onoff
- The new state of the RadioButton.public void setText(java.lang.String label)
label
- The new label.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |