|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Variable
This class provides an interface for entering data via a textfield. The variable's value is automatically set to the Double.parseDouble value of the inputField when focus is lost. If the inputField is unable to be parsed as a double, the value is set 0.0 when focus is lost.
Field Summary | |
java.awt.TextField |
inputField
The input interface for this variable |
double |
maxValue
Maximum value (this.value <= maximum value) |
double |
minValue
Minimum value (this.value >= minimum value) |
double |
value
The numerical value of this variable |
Constructor Summary | |
Variable()
Create a new variable with an initial value of 0.0 |
|
Variable(double value)
Create a new variable with the specified value |
|
Variable(java.lang.String description)
Create a new variable with the specified description |
|
Variable(java.lang.String description,
double value)
Create a new variable with the specified description and value |
Method Summary | |
void |
focusGained(java.awt.event.FocusEvent e)
FocusListenter method to alert this object that input focus has been acquired |
void |
focusLost(java.awt.event.FocusEvent e)
FocusListenter method to alert this object that input focus has been lost Note that this method makes a call specific to the Cosmo applet and will therefore need to be altered before it can be used in other applets. |
double |
getMaxValue()
Get the maximum possible value for this variable |
double |
getMinValue()
Get the minimum possible value for this variable |
double |
getValue()
Returns the numeric value of this variable as a double |
void |
setMaxValue(double max)
Set the maximum possible value for this variable |
void |
setMinValue(double min)
Set the minimum possible value for this variable |
void |
setValue()
Set the value of this variable to the value in its textfield. |
void |
setValue(double value)
Set the value of this variable to the given double value |
void |
setValue(java.lang.String inputValue)
Set the value of this variable to the parsed double value of the given string. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public double value
public java.awt.TextField inputField
public double maxValue
public double minValue
Constructor Detail |
public Variable(double value)
public Variable(java.lang.String description)
public Variable(java.lang.String description, double value)
public Variable()
Method Detail |
public void setValue(java.lang.String inputValue)
public void setValue(double value)
public void setValue()
public double getValue()
public void setMaxValue(double max)
public void setMinValue(double min)
public double getMaxValue()
public double getMinValue()
public void focusGained(java.awt.event.FocusEvent e)
public void focusLost(java.awt.event.FocusEvent e)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |