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

Constructor Index

 o textControls(dynamicGraph, String[], String[], int)
Constructor with default TextBox length = 8
 o textControls(dynamicGraph, String[], String[], int, int)
Default constructor

Method Index

 o action(Event, Object)
Event handler calls respondToText() method in parent
 o disableText(int)
Disables ith text box
 o enableText(int)
Enables ith text box
 o getText(int)
Gets value of ith textbox
 o hide(int)
Hides ith label and texbox
 o ncontrols()
Number of controls
 o parseTextField(int, double)
Parses text field known to be double.
 o 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.
 o 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.
 o parseTextField(int, int)
Parses text field known to be integer.
 o parseTextField(int, int, boolean)
Parses text field known to be integer of known sign.
 o parseTextField(int, int, int, int)
Parses text field known to be integer in known range.
 o setLabelText(int, String)
Sets ith label
 o setText(int, String)
Sets value of ith textbox
 o show(int)
Shows ith label and texbox
 o showAll()
Shows all labels and texboxes

Constructors

 o 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
 o 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

Methods

 o action
 public boolean action(Event evt,
                       Object arg)
Event handler calls respondToText() method in parent

Overrides:
action in class Component
 o ncontrols
 public int ncontrols()
Number of controls

Returns:
number of controls
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o setLabelText
 public void setLabelText(int i,
                          String text)
Sets ith label

Parameters:
i - index of label
text - label
 o setText
 public void setText(int i,
                     String text)
Sets value of ith textbox

Parameters:
i - index of textbox
text - value to be set
 o getText
 public String getText(int i)
Gets value of ith textbox

Parameters:
i - index of textbox
Returns:
content of textbox
 o hide
 public void hide(int i)
Hides ith label and texbox

Parameters:
i - index
 o show
 public void show(int i)
Shows ith label and texbox

Parameters:
i - index
 o showAll
 public void showAll()
Shows all labels and texboxes

 o disableText
 public void disableText(int i)
Disables ith text box

Parameters:
i - index
 o enableText
 public void enableText(int i)
Enables ith text box

Parameters:
i - index

All Packages  Class Hierarchy  This Package  Previous  Next  Index