waba.ui
Class Radio

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Radio

public class Radio
extends Control

Radio is a radio control.

Here is an example showing a radio being used:

 public class MyProgram extends MainWindow
 {
 Radio radio;

 public void onStart()
  {
  radio = new Button("Check me");
  radio.setRect(10, 10, 80, 30);
  add(radio);
  }

 public void onEvent(Event event)
  {
  if (event.type == ControlEvent.PRESSED &&
      event.target == radio)
   {
   ... handle radio being pressed
 


Fields inherited from class waba.ui.Control
height, next, parent, prev, width, x, y
 
Constructor Summary
Radio(java.lang.String text)
          Creates a radio control displaying the given text.
 
Method Summary
static void drawRadio(Graphics g, boolean checked, int x, int y)
          Draws the radio circle graphic at the given position.
 boolean getChecked()
          Returns the checked state of the control.
 java.lang.String getText()
          Gets the text displayed in the radio.
 void onEvent(Event event)
          Called by the system to pass events to the radio control.
 void onPaint(Graphics g)
          Called by the system to draw the radio control.
 void setChecked(boolean checked)
          Sets the checked state of the control.
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, postEvent, removeTimer, repaint, setRect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Radio

public Radio(java.lang.String text)
Creates a radio control displaying the given text.
Method Detail

getText

public java.lang.String getText()
Gets the text displayed in the radio.

getChecked

public boolean getChecked()
Returns the checked state of the control.

setChecked

public void setChecked(boolean checked)
Sets the checked state of the control.

onEvent

public void onEvent(Event event)
Called by the system to pass events to the radio control.
Overrides:
onEvent in class Control
Tags copied from class: Control
Parameters:
event - the event to process
See Also:
Event, KeyEvent, PenEvent

drawRadio

public static void drawRadio(Graphics g,
                             boolean checked,
                             int x,
                             int y)
Draws the radio circle graphic at the given position.

onPaint

public void onPaint(Graphics g)
Called by the system to draw the radio control.
Overrides:
onPaint in class Control
Tags copied from class: Control
Parameters:
g - the graphics object for drawing
See Also:
Graphics