|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.UserExhibit.Support
public static class UserExhibit.Support
An object of type UserExhibit.Support holds the information need for a user
exhibit and provides some methods for manipulating that information. Most
users of this class will only have to declare an instance variable of
type UserExhibit.Support and create and customize the object in the constructor
of the user exhibit class (saving references to the UserExhibit.FunctionInfo
objects created by the support object). This Support object should be returned
as the value of UserExhibit.getUserExhibitSupport()
.
Note that the once the support object has been created, the system handles most of the details, such as showing the dialog box where the user will enter the definitions of the functions and saving the values of those functions when the user exhibit is saved to a settings file.
Nested Class Summary | |
---|---|
protected class |
UserExhibit.Support.Dialog
Implements the dialog box where the user enters the data for a user exhibit. |
protected static class |
UserExhibit.Support.ExtraPanel
An object of type ExtraPanel can be added to the dialog box to get some extra data from the user. |
Constructor Summary | |
---|---|
UserExhibit.Support(UserExhibit exhibit)
Create a UserExhibit.Support object for use by a specified UserExhibit |
Method Summary | |
---|---|
UserExhibit.FunctionInfo |
addComplexFunction(java.lang.String name,
java.lang.String definition,
java.lang.String... argumentName)
Add a complex-valued function to the user info. |
void |
addFunctionParameter(ComplexVariableParam p)
In addition to the arguments of the function, the definition of a function can contain refereneces to "parameters". |
void |
addFunctionParameter(VariableParam p)
In addition to the arguments of the function, the definition of a function can contain refereneces to "parameters". |
UserExhibit.FunctionInfo |
addRealFunction(java.lang.String name,
java.lang.String definition,
java.lang.String... argumentName)
Add a real-valued function to the user info. |
void |
addToXML(org.w3c.dom.Document containingDocument,
org.w3c.dom.Element userDataElement)
This is called by the system when the user exhibit is being saved to a settings file to write the user data to the settings file. |
protected UserExhibit.Support.Dialog |
createDialog(Display display,
View view,
boolean creating)
Called by showCreateDialog(Display) and showChangeDialog(Display, View)
to actually create the dialog box. |
View |
defaults()
This method initializes the user exhibit to the default values from its create dialog. |
protected void |
finish(UserExhibit.Support.Dialog dialog,
View view,
boolean creating)
Called by showCreateDialog(Display) and showChangeDialog(Display, View)
after the user has clicked the OK button to dismiss the dialog box. |
boolean |
getAllowChangeUserDataCommand()
|
boolean |
getAllowNewParameters()
|
int |
getFunctionCount()
Returns the number of functions, real and complex, that have been added to this Support object. |
UserExhibit.FunctionInfo |
getFunctionInfo(int index)
Returns the FunctionInfo object for the i-th function that was added to this object. |
Parameter[] |
getFunctionParameters()
Gets the list of parameters that can be used in the definitions of the functions. |
boolean |
getShowWindow()
|
AbstractActionVMM |
makeChangeUserDataAction(View view)
Creates the "Change User Data" command for adding to the 3DXM Settings menu. |
void |
readFromXML(org.w3c.dom.Element userDataElement)
This method is called by the system when the user exhibit is being read from a settings file. |
void |
setAllowChangeUserDataCommand(boolean allowChangeUserDataCommand)
Sets the value of the allowChangeUserData property. |
void |
setAllowNewParameters(boolean allowNewParameters)
Sets the value of the allowNewParameters property. |
void |
setShowWindow(boolean showWindow)
Sets the value of the showWindow property. |
boolean |
showChangeDialog(Display display,
View view)
Shows the dialog box where the user enters the data for the exhibit. |
View |
showCreateDialog(Display display)
Shows the dialog box where the user enters the data for the exhibit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserExhibit.Support(UserExhibit exhibit)
exhibit
- the UserExhibit that uses this support object. The value of this
parameter will ordinarily be specified as "this".Method Detail |
---|
public void addFunctionParameter(VariableParam p)
p
- the non-null parameter to be made available for use in the function
definitions. Note that the parameter can belong to the subclass
VariableParamAnimateable
; if that is the case, then the user will
be able to specify upper and lower limits for morphing the parameter.public void addFunctionParameter(ComplexVariableParam p)
Note that, by default, the user can change the list of parameters.
See setAllowNewParameters(boolean)
.
p
- the non-null parameter to be made available for use in the function
definitions. Note that the parameter can belong to the subclass
ComplexVariableParamAnimateable
; if that is the case, then the user will
be able to specify upper and lower limits for morphing the parameter.public UserExhibit.FunctionInfo addRealFunction(java.lang.String name, java.lang.String definition, java.lang.String... argumentName)
name
- The name of the function, which will be used only in the label for the text field
where the user enters the definition.definition
- The initial value for the defintion of the function. This can be modified
by the user. The defintion will be processed by a Parser
to produce the
actual function.argumentName
- The names of the arguments of the function, such as the "x" and
"y" in "f(x,y)". These arguments can be used in the definition of the function.
public UserExhibit.FunctionInfo addComplexFunction(java.lang.String name, java.lang.String definition, java.lang.String... argumentName)
name
- The name of the function, which will be used only in the label for the text field
where the user enters the definition.definition
- The initial value for the defintion of the function. This can be modified
by the user. The defintion will be processed by a Parser
to produce the
actual complex-valued function.argumentName
- The names of the arguments of the function, such as the "z" and
"w" in "f(z,w)". These arguments can be used in the definition of the function.
public int getFunctionCount()
public UserExhibit.FunctionInfo getFunctionInfo(int index)
public Parameter[] getFunctionParameters()
addFunctionParameter(ComplexVariableParam)
or addFunctionParameter(VariableParam)
. (This method is used by the system,
but is not usually needed otherwise.)
public boolean getAllowChangeUserDataCommand()
setAllowChangeUserDataCommand(boolean)
public void setAllowChangeUserDataCommand(boolean allowChangeUserDataCommand)
public boolean getAllowNewParameters()
setAllowNewParameters(boolean)
public void setAllowNewParameters(boolean allowNewParameters)
addFunctionParameter(VariableParam)
and addFunctionParameter(ComplexVariableParam)
.
public boolean getShowWindow()
setShowWindow(boolean)
public void setShowWindow(boolean showWindow)
public View defaults()
showCreateDialog(Display)
were called and the user clicked "OK" without making any changes to the data
in the dialog box, except that the dialog is not actually shown. This is
used to initially load a user exhibit in the main program for 3D-XplorMath-J
and in the 3DXM LauncherApplet; it will probably not be used otherwise.
public View showCreateDialog(Display display)
display
- The display that serves as the parent component of the dialog box; can be null.public boolean showChangeDialog(Display display, View view)
public AbstractActionVMM makeChangeUserDataAction(View view)
public void addToXML(org.w3c.dom.Document containingDocument, org.w3c.dom.Element userDataElement)
public void readFromXML(org.w3c.dom.Element userDataElement) throws java.io.IOException
java.io.IOException
protected UserExhibit.Support.Dialog createDialog(Display display, View view, boolean creating)
showCreateDialog(Display)
and showChangeDialog(Display, View)
to actually create the dialog box. This can be overridden by a subclass to
customize the dialog box.
protected void finish(UserExhibit.Support.Dialog dialog, View view, boolean creating)
showCreateDialog(Display)
and showChangeDialog(Display, View)
after the user has clicked the OK button to dismiss the dialog box. It can be
overridden in a subclass to customize the way the data in the dialog box is applied.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |