ParameterDialog Class
Package : cam.visuals.dialogs
Extends : java.awt.Dialogs
This class uses the Java 1.0 event model.
An instance of this class is a dialog box that facilitates the setting of parameter values associated with a ParameterList object.
Using the ParameterList object passed in via the constructor this class creates a dialog that prompts the user for values for each item in the ParameterList. (Be sure to call the show() method to have the dialog appear). The current values of the ParameterList variables are displayed when the dialog is shown. If the user selects "OK" or "Apply" then the values in the dialog overwrite the original ParameterList values.
An Action event is also sent to the parent when "OK" or "Apply" is selected. This event can be captured by using the
if(event.target instanceof ParameterDialog) {…}
programming construct within the handle_event(…) method. The argument of the event is a string notifying which button was pressed: either "ok" or "apply".
Class Reference
Sample Program: ParameterTest.java
Mark Hoefer, Chris Anderson © UCLA 1997
Constructors
Constructs a new modeless ParameterDialog that is associated with the parent Frame. params is the ParameterList which will be used to construct the dialog. When the user makes changes in the dialog to the parameters, it will destructively change params. |
Get/Set Methods
|
Sets padx, the distance between components in the horizontal direction. To have the changes take effect, call layoutComponents(). |
|
Sets pady, the distance between components in the vertical direction. To have the changes take effect, call layoutComponents(). |
|
Sets numTextColumns, the number of columns in each TextField that displays the values of each parameter in the ParameterList. |
Other Methods
|
Lays out the Labels and TextFields using the current state of the variables padx, pady, and numTextColumns. |