|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--com.jjt.utbeg.SeismicDesignExerciseApplet
An abstract parent class for all of the Seismic Design Exercise Applets.
This Component lays out three main Panels in which subclasses can place components: A Parameter Display Panel for showing static parameters that may have been input by the user in previous excercises, a Parameter Input Panel for input Components used by the human to enter parameter values for this exercise, and a Viewer Panel for displaying the results of parameters for this exercise. Subclasses should only place components into one of these Panels, accessed by getParameterDisplayPanel(), getParameterInputPanel(), and getViewerPanel().
getParameterDisplayPanel()
,
getParameterInputPanel()
,
getViewerPanel()
, Serialized FormInner classes inherited from class java.awt.Component |
Component.AWTTreeLock,
Component.NativeInLightFixer |
Field Summary | |
private boolean |
inputParametersAreValid
Flag set during init() after validateInputParameters() is called. |
private static Insets |
insets
Empty border Insets for these Applets. |
private Panel |
parameterDisplayPanel
The panel for displaying (read-only) parameters that were set in previous exercises. |
private Panel |
parameterInputPanel
The panel where the human specifies parameters for this exercise. |
private UserParameters |
parameters
The saved parameter values for the current human user. |
private Panel |
viewerPanel
The panel where the graphical viewer will reside. |
Fields inherited from class java.applet.Applet |
serialVersionUID,
stub |
Fields inherited from class java.awt.Panel |
base,
nameCounter,
serialVersionUID |
Fields inherited from class java.awt.Container |
component,
containerListener,
containerSerializedDataVersion,
dispatcher,
layoutMgr,
maxSize,
ncomponents,
serialVersionUID |
Constructor Summary | |
SeismicDesignExerciseApplet()
|
Method Summary | |
Container |
getContentPane()
Returns the main Container for this Applet's components. |
Insets |
getInsets()
Component method over-ridden to define an empty border around this Applet. |
double |
getNumericAppletParameter(String parameterName)
Loads an Applet parameter as a number. |
protected Container |
getParameterDisplayPanel()
Returns the Container where static display Components should be placed. |
protected Container |
getParameterInputPanel()
Returns the Container where parameter input Components should be placed. |
protected UserParameters |
getParameters()
Returns the collection of parameters for this and other Applets. |
protected java.net.URL |
getPostURL()
Returns the URL to submit this applet's parameters to the server. |
protected Container |
getViewerPanel()
Returns the Container where the viewer Component should be placed. |
void |
init()
Initializes this Applet. |
protected boolean |
inputParametersAreValid()
Returns true if the input parameters were valid
when verifyInputParameters() was called during init(). |
protected void |
loadParameters()
Loads the parameters for this user, which were set in previous exercises. |
String[] |
readAppletParameterArray(String arrayName)
Utility method for reading Applet parameters that make up an array sequence. |
void |
saveInputs()
Submits the parameters in this Applet to the server, by making an HTTP request to the AGIServlet. |
protected abstract void |
setInitialParameters()
Sets initial parameters for this exercise. |
protected abstract String |
verifyInputParameters()
This method is called so that subclasses may verify that all their required parameters have been set. |
Methods inherited from class java.applet.Applet |
destroy,
getAppletContext,
getAppletInfo,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
getParameter,
getParameterInfo,
isActive,
newAudioClip,
play,
play,
resize,
resize,
setStub,
showStatus,
start,
stop |
Methods inherited from class java.awt.Panel |
addNotify,
constructComponentName |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
Field Detail |
private Panel parameterInputPanel
This panel includes the "save" button.
private Panel parameterDisplayPanel
private Panel viewerPanel
private UserParameters parameters
getParameters()
private boolean inputParametersAreValid
This flag can be accessed by subclasses via the inputParametersAreValid() method.
inputParametersAreValid()
private static Insets insets
Constructor Detail |
public SeismicDesignExerciseApplet()
Method Detail |
public void init()
Because of the Applet implementation, Applets create components during init() instead of construction.
In addition, this method calls loadParameters(), then verifyInputParameters(), and then, if valid, setInitialParameters().
loadParameters()
,
verifyInputParameters()
,
setInitialParameters()
protected Container getParameterDisplayPanel()
protected Container getParameterInputPanel()
protected Container getViewerPanel()
public Container getContentPane()
This currently returns the Applet itself, but if a status bar is needed in the future, this method could return a separate Panel.
Subclasses which use the three default panels should not need to use this method.
protected UserParameters getParameters()
protected void loadParameters()
protected abstract String verifyInputParameters()
If this exercise (Applet) requires parameters to be set by previous exercises, then that will be validated here. Parameters are set in the UserParameters Object which can be retrieved by the getParameters() method.
null
if all required parameters are loaded.getParameters()
protected abstract void setInitialParameters()
Initial parameter values are usually based on input parameters which have been set in previous exercises. When this method is called, verifyInputParameters() has already been called, so all required input parameters can be assumed present.
verifyInputParameters()
protected boolean inputParametersAreValid()
true
if the input parameters were valid
when verifyInputParameters() was called during init().
This method is available so that subclasses can check after there super.init() call, so that visual components will not be created needlessly.
true
if the verifyInputParameters() validated the
input parameters okay.public Insets getInsets()
public String[] readAppletParameterArray(String arrayName)
For example, if arrayName
is "peanut", then the parameters
read would be peanut1, peanut2, peanut3, etc., until no parameter is found.
If a parameter #0 is available, it is treated as the first element in the
array. If no #0 is found, parameter #1 is used for the first element. If
no elements are found, a zero-length array is returned.
arrayName
- the prefix of each parameter in the array.public double getNumericAppletParameter(String parameterName)
Applet parameters are String values specified in the APPLET tag of the HTML code presenting this Applet.
protected java.net.URL getPostURL() throws java.net.MalformedURLException
The URL is probably actually an HTTP GET request, with the parameters attached as query arguments.
This parent method returns a simple Servlet URL with one query parameter.
public void saveInputs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |