org.opensourcephysics.ejs.control
Class ParsedEjsControl

java.lang.Object
  extended by org.opensourcephysics.ejs.control.GroupControl
      extended by org.opensourcephysics.ejs.control.EjsControl
          extended by org.opensourcephysics.ejs.control.ParsedEjsControl
All Implemented Interfaces:
Control, SimControl
Direct Known Subclasses:
EjsControlFrame

public class ParsedEjsControl
extends EjsControl
implements SimControl

An Ejs control that behaves like a standard OSP control insofar as it parses mathematical expressions stored as strings to produce integers and doubles.

Version:
1.0
Author:
W. Christian

Field Summary
 
Fields inherited from class org.opensourcephysics.ejs.control.GroupControl
DEBUG_ALL, DEBUG_CONTROL, DEBUG_CONTROL_VERBOSE, DEBUG_DRAWING, DEBUG_DRAWING_VERBOSE, DEBUG_ELEMENTS, DEBUG_NONE, DEBUG_SET_AND_GET, DEBUG_SYSTEM, DEBUG_SYSTEM_VERBOSE, replaceOwnerFrame, replaceOwnerName
 
Fields inherited from interface org.opensourcephysics.controls.Control
NOT_EDITABLE_BACKGROUND
 
Constructor Summary
ParsedEjsControl(java.lang.Object simulation)
          Constructor ParsedEjsControl
 
Method Summary
 double getDouble(java.lang.String var)
          Gets the double keyed to this value.
 int getInt(java.lang.String var)
          Gets the integer keyed to this value.
 java.lang.Object getObject(java.lang.String var)
          Gets the object keyed to the variable.
 void removeParameter(java.lang.String name)
          Removes a parameter from this control.
 void setAdjustableValue(java.lang.String name, boolean val)
          Stores a boolean in the control that can be edited after initialization.
 void setAdjustableValue(java.lang.String name, double val)
          Stores a double in the control that can be edited after initialization.
 void setAdjustableValue(java.lang.String name, int val)
          Stores an integer in the control that can be edited after initialization.
 void setAdjustableValue(java.lang.String name, java.lang.Object val)
          Stores an object in the control that can be edited after initialization.
 void setParameterToFixed(java.lang.String name, boolean fixed)
          Sets the fixed property of the given parameter.
 
Methods inherited from class org.opensourcephysics.ejs.control.EjsControl
addObject, calculationDone, clearMessages, clearValues, getPropertyNames, getValue, print, println, println, reset, setLockValues, setValue
 
Methods inherited from class org.opensourcephysics.ejs.control.GroupControl
add, add, addListener, addListener, addNamed, addObject, addTarget, appendPrefixPath, clear, clearPrefixPath, clearVariables, destroy, destroy, getBoolean, getComponent, getContainer, getControl, getDebugLevel, getDefaultPrefixList, getElement, getLoader, getOwnerFrame, getReplaceOwnerFrame, getReplaceOwnerName, getSimulation, getString, getTarget, getTopLevelAncestor, getVisual, initialize, isVariableRegistered, registerVariable, removeTarget, rename, replaceOwnerFrame, setActive, setDebugLevel, setOwnerFrame, setSimulation, setValue, setValue, setValue, setValue, setValue, update, variableChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Control
calculationDone, clearMessages, clearValues, getBoolean, getPropertyNames, getString, print, println, println, setLockValues, setValue, setValue, setValue, setValue
 

Constructor Detail

ParsedEjsControl

public ParsedEjsControl(java.lang.Object simulation)
Constructor ParsedEjsControl

Parameters:
simulation -
Method Detail

getDouble

public double getDouble(java.lang.String var)
Gets the double keyed to this value. String values are converted to double using a math expression parser.

Specified by:
getDouble in interface Control
Overrides:
getDouble in class GroupControl
Parameters:
var - String
Returns:
double

getObject

public java.lang.Object getObject(java.lang.String var)
Gets the object keyed to the variable.

Specified by:
getObject in interface Control
Overrides:
getObject in class GroupControl
Parameters:
var - String
Returns:
Object

getInt

public int getInt(java.lang.String var)
Gets the integer keyed to this value. String values are converted to int using a math expression parser.

Specified by:
getInt in interface Control
Overrides:
getInt in class GroupControl
Parameters:
var - String
Returns:
double

removeParameter

public void removeParameter(java.lang.String name)
Description copied from interface: SimControl
Removes a parameter from this control.

Specified by:
removeParameter in interface SimControl

setAdjustableValue

public void setAdjustableValue(java.lang.String name,
                               boolean val)
Description copied from interface: SimControl
Stores a boolean in the control that can be edited after initialization.

Specified by:
setAdjustableValue in interface SimControl

setAdjustableValue

public void setAdjustableValue(java.lang.String name,
                               double val)
Description copied from interface: SimControl
Stores a double in the control that can be edited after initialization.

Specified by:
setAdjustableValue in interface SimControl

setAdjustableValue

public void setAdjustableValue(java.lang.String name,
                               int val)
Description copied from interface: SimControl
Stores an integer in the control that can be edited after initialization.

Specified by:
setAdjustableValue in interface SimControl

setAdjustableValue

public void setAdjustableValue(java.lang.String name,
                               java.lang.Object val)
Description copied from interface: SimControl
Stores an object in the control that can be edited after initialization.

Specified by:
setAdjustableValue in interface SimControl

setParameterToFixed

public void setParameterToFixed(java.lang.String name,
                                boolean fixed)
Description copied from interface: SimControl
Sets the fixed property of the given parameter. Fixed parameters can only be changed before initialization.

Specified by:
setParameterToFixed in interface SimControl