ukcrobots.simplecore
Class Button

java.lang.Object
  |
  +--ukcrobots.simplecore.Button

public class Button
extends Object

Model a button on the RCX. Implementation based on josx.platform.rcx.Button.

Version:
2003.03.04
Author:
David J. Barnes (d.j.barnes @at@ kent.ac.uk)

Field Summary
static Button[] BUTTONS
          Array containing VIEW, PRGM and RUN, in that order.
static int NUM_BUTTONS
           
static int PRGM
           
static int RUN
           
static int VIEW
           
 
Method Summary
static Button getButton(int id)
           
 boolean isActive()
          A Button is always active.
 boolean isPressed()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Field Detail

NUM_BUTTONS

public static final int NUM_BUTTONS
See Also:
Constant Field Values

RUN

public static final int RUN
See Also:
Constant Field Values

VIEW

public static final int VIEW
See Also:
Constant Field Values

PRGM

public static final int PRGM
See Also:
Constant Field Values

BUTTONS

public static final Button[] BUTTONS
Array containing VIEW, PRGM and RUN, in that order.

Method Detail

getButton

public static Button getButton(int id)
                        throws NoSuchDeviceException
Parameters:
id - A value of Button.RUN, Button.VIEW or Button.PRGM.
Returns:
The requested button
NoSuchDeviceException

isActive

public boolean isActive()
A Button is always active.

Returns:
true

isPressed

public final boolean isPressed()
Returns:
true if the button is pressed, false otherwise.