All Packages Class Hierarchy This Package Previous Next Index
Class ChaosDemos.textControls
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----ChaosDemos.textControls
- public class textControls
- extends Panel
Array of labelled text fields.
Calls respondToText() method in parent
- Version:
- 2 August 1997
- Author:
- Michael Cross
-
textControls(dynamicGraph, String[], String[], int)
- Constructor with default TextBox length = 8
-
textControls(dynamicGraph, String[], String[], int, int)
- Default constructor
-
action(Event, Object)
- Event handler calls respondToText() method in parent
-
disableText(int)
- Disables ith text box
-
enableText(int)
- Enables ith text box
-
getText(int)
- Gets value of ith textbox
-
hide(int)
- Hides ith label and texbox
-
ncontrols()
- Number of controls
-
parseTextField(int, double)
- Parses text field known to be double.
-
parseTextField(int, double, boolean)
- Parses text field known to be double and of known sign
Resets old value of corresponding variable if input format
is incorrect or wrong sign and brings up alertDialog warning box.
-
parseTextField(int, double, double, double)
- Parses text field known to be double and in known range
Resets old value of corresponding variable if input format
is incorrect or out of range and brings up alertDialog warning box.
-
parseTextField(int, int)
- Parses text field known to be integer.
-
parseTextField(int, int, boolean)
- Parses text field known to be integer of known sign.
-
parseTextField(int, int, int, int)
- Parses text field known to be integer in known range.
-
setLabelText(int, String)
- Sets ith label
-
setText(int, String)
- Sets value of ith textbox
-
show(int)
- Shows ith label and texbox
-
showAll()
- Shows all labels and texboxes
textControls
public textControls(dynamicGraph target,
String text[],
String label[],
int n,
int length)
- Default constructor
- Parameters:
- target - parent of type dynamicGraph
- text[] - vector of text fields of TextBoxes
- l[] - vector of text fields for labels
- n - number of TextBoxes
- length - length of TextBoxes
textControls
public textControls(dynamicGraph target,
String text[],
String l[],
int n)
- Constructor with default TextBox length = 8
- Parameters:
- target - parent of type dynamicGraph
- text[] - vector of text fields of TextBoxes
- l[] - vector of text fields for labels
- n - number of TextBoxes
action
public boolean action(Event evt,
Object arg)
- Event handler calls respondToText() method in parent
- Overrides:
- action in class Component
ncontrols
public int ncontrols()
- Number of controls
- Returns:
- number of controls
parseTextField
public int parseTextField(int n,
int i)
- Parses text field known to be integer.
Resets old value of corresponding variable if input format
is incorrect and brings up alertDialog warning box.
- Parameters:
- n - index of textbox to read
- i - old value of variable
- Returns:
- new value of parameter if textbox format is correct,
otherwise old value.
- See Also:
- alertDialog
parseTextField
public int parseTextField(int n,
int i,
boolean positive)
- Parses text field known to be integer of known sign.
Resets old value of corresponding variable if input format
is incorrect or wrong sign and brings up alertDialog warning box.
- Parameters:
- n - index of textbox to read
- i - old value of variable
- positive - true if value should be positive
- Returns:
- new value of parameter if textbox format is correct,
and value of correct sign, otherwise old value.
- See Also:
- alertDialog
parseTextField
public int parseTextField(int n,
int i,
int min,
int max)
- Parses text field known to be integer in known range.
Resets old value of corresponding variable if input format
is incorrect orout of range and brings up alertDialog warning box.
- Parameters:
- n - index of textbox to read
- i - old value of variable
- min - minimum value of allowed range
- max - maximum value of allowed range
- Returns:
- new value of parameter if textbox format is correct,
and value in of range, otherwise old value.
- See Also:
- alertDialog
parseTextField
public double parseTextField(int n,
double d)
- Parses text field known to be double.
Resets old value of corresponding variable if input format
is incorrect and brings up alertDialog warning box.
- Parameters:
- n - index of textbox to read
- d - old value of variable
- Returns:
- new value of parameter if textbox format is correct,
otherwise old value.
- See Also:
- alertDialog
parseTextField
public double parseTextField(int n,
double d,
boolean positive)
- Parses text field known to be double and of known sign
Resets old value of corresponding variable if input format
is incorrect or wrong sign and brings up alertDialog warning box.
- Parameters:
- n - index of textbox to read
- d - old value of variable
- positive - true if positive, false if negative
- Returns:
- new value of parameter if textbox format is correct,
and value in range, otherwise old value .
- See Also:
- alertDialog
parseTextField
public double parseTextField(int n,
double d,
double min,
double max)
- Parses text field known to be double and in known range
Resets old value of corresponding variable if input format
is incorrect or out of range and brings up alertDialog warning box.
- Parameters:
- n - index of textbox to read
- d - old value of variable
- min - minimum value of allowed range
- max - maximum value of allowed range
- Returns:
- new value of parameter if textbox format is correct,
and value in range, otherwise old value .
- See Also:
- alertDialog
setLabelText
public void setLabelText(int i,
String text)
- Sets ith label
- Parameters:
- i - index of label
- text - label
setText
public void setText(int i,
String text)
- Sets value of ith textbox
- Parameters:
- i - index of textbox
- text - value to be set
getText
public String getText(int i)
- Gets value of ith textbox
- Parameters:
- i - index of textbox
- Returns:
- content of textbox
hide
public void hide(int i)
- Hides ith label and texbox
- Parameters:
- i - index
show
public void show(int i)
- Shows ith label and texbox
- Parameters:
- i - index
showAll
public void showAll()
- Shows all labels and texboxes
disableText
public void disableText(int i)
- Disables ith text box
- Parameters:
- i - index
enableText
public void enableText(int i)
- Enables ith text box
- Parameters:
- i - index
All Packages Class Hierarchy This Package Previous Next Index