com.sun.kjava
Class ValueSelector

java.lang.Object
  |
  +--com.sun.kjava.ValueSelector

public class ValueSelector
extends java.lang.Object

An object that presents a user interface for integer value selection.

It contains three Buttons:


Constructor Summary
ValueSelector(java.lang.String label, int min, int max, int init, int x, int y)
          Create a new ValueSelector.
 
Method Summary
 int getValue()
          What's the current value?
 void paint()
          Paint the ValueSelector.
 boolean pressed(int x, int y)
          If one of the Buttons was pressed, have it deal with it.
 void setValue(int value)
          Set the current value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueSelector

public ValueSelector(java.lang.String label,
                     int min,
                     int max,
                     int init,
                     int x,
                     int y)
Create a new ValueSelector.
Parameters:
label - the label for the ValueSelector
min - minimum value to allow
max - maximum value to allow
init - initial value
x - the X coordinate of our position
y - the Y coordinate of our position
Method Detail

paint

public void paint()
Paint the ValueSelector.

getValue

public int getValue()
What's the current value?
Returns:
the current value

setValue

public void setValue(int value)
Set the current value.
Parameters:
value - the value to set

pressed

public boolean pressed(int x,
                       int y)
If one of the Buttons was pressed, have it deal with it.
Parameters:
x - the X coordinate of the user's press
y - the Y coordinate of the user's press
Returns:
true if the position was handled by one of the Buttons