All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ChaosDemos.sliderControls

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ChaosDemos.sliderControls

public class sliderControls
extends Panel
Class for ntext labelled text fields updated by slider controls. Text field for controls is (ntext+1)th textfield.

Version:
2 August, 1997
Author:
Michael Cross

Constructor Index

 o sliderControls(dynamicGraph, String[], String[], int, double)
Adds n text fields of default size 8 with values text[] labelled by l[]
 o sliderControls(dynamicGraph, String[], String[], int, int)
Adds n text fields of size length with values text[] labelled by l[]
 o sliderControls(dynamicGraph, String[], String[], int, int, boolean)
Adds n text fields of size length with values text[] labelled by l[]
 o sliderControls(dynamicGraph, String[], String[], int, int, double)
Adds n text fields of size length with values text[] labelled by l[]
 o sliderControls(dynamicGraph, String[], String[], int, int, double, boolean)
Adds n text fields of size length with values text[] labelled by l[]

Method Index

 o action(Event, Object)
Event handler: responds to slider events
Calls respondToSliderButtons() and respondToSliderText() methods in parent.
 o disable(int)
Disables ith textbox (i  o enable(int)
Enables ith textbox (i  o getCheckState(int)
Gets state of ith checkbox
 o getText(int)
Gets value of ith textbox
 o ncontrols()
Method to give number of controls
 o parseTextField(int, double)
Parses text field known to be double.
 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(String)
Sets label of increment buttons
 o setText(int, String)
Sets value of ith textbox

Constructors

 o sliderControls
 public sliderControls(dynamicGraph target,
                       String text[],
                       String l[],
                       int n,
                       int length,
                       boolean showButtons)
Adds n text fields of size length with values text[] labelled by l[]

Parameters:
target - parent class of type dynamicGraph
text - vector of fields of textboxes
l - vector of labels of textboxes
n - number of textboxes
length - length of textboxes
showButtons - true if show buttons
 o sliderControls
 public sliderControls(dynamicGraph target,
                       String text[],
                       String l[],
                       int n,
                       int length)
Adds n text fields of size length with values text[] labelled by l[]

Parameters:
target - parent class of type dynamicGraph
text - vector of fields of textboxes
l - vector of labels of textboxes
n - number of textboxes
length - length of textboxes
 o sliderControls
 public sliderControls(dynamicGraph target,
                       String text[],
                       String l[],
                       int n,
                       int length,
                       double inInc)
Adds n text fields of size length with values text[] labelled by l[]

Parameters:
target - parent class of type dynamicGraph
text - vector of fields of textboxes
l - vector of labels of textboxes
n - number of textboxes
length - length of textboxes
inInc - value of increment applied by sliders
 o sliderControls
 public sliderControls(dynamicGraph target,
                       String text[],
                       String l[],
                       int n,
                       int length,
                       double inInc,
                       boolean showButtons)
Adds n text fields of size length with values text[] labelled by l[]

Parameters:
target - parent class of type dynamicGraph
text - vector of fields of textboxes
l - vector of labels of textboxes
n - number of textboxes
length - length of textboxes
inInc - value of increment applied by sliders
showButtons - true if show buttons
 o sliderControls
 sliderControls(dynamicGraph target,
                String text[],
                String l[],
                int n,
                double inInc)
Adds n text fields of default size 8 with values text[] labelled by l[]

Parameters:
target - parent class of type dynamicGraph
text - vector of fields of textboxes
l - vector of labels of textboxes
n - number of textboxes
inInc - value of increment applied by sliders

Methods

 o action
 public boolean action(Event evt,
                       Object arg)
Event handler: responds to slider events
Calls respondToSliderButtons() and respondToSliderText() methods in parent.

Overrides:
action in class Component
See Also:
dynamicGraph
 o ncontrols
 public int ncontrols()
Method to give 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,
                              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 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 disable
 public void disable(int i)
Disables ith textbox (i
Parameters:
i - index to be disabled
 o enable
 public void enable(int i)
Enables ith textbox (i
Parameters:
i - index to be enabled
 o getCheckState
 public boolean getCheckState(int i)
Gets state of ith checkbox

Parameters:
i - index of checkbox
Returns:
true or false
 o setLabelText
 public void setLabelText(String text)
Sets label of increment buttons

Parameters:
text - text to be shown

All Packages  Class Hierarchy  This Package  Previous  Next  Index