org.opensourcephysics.ejs.control
Class EjsControl

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

public class EjsControl
extends GroupControl
implements Control

A blend of GroupControl and org.opensourcephysics.control.Control


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
EjsControl()
          Constructor EjsControl
EjsControl(java.lang.Object _simulation)
          The EjsControl constructor.
EjsControl(java.lang.Object _simulation, java.lang.String _replaceName, java.awt.Frame _replaceOwnerFrame)
          Constructor EjsControl
 
Method Summary
 ControlElement addObject(java.lang.Object _object, java.lang.String _classname, java.lang.String _propList)
          Creates a new ControlElement that wrapps an existing object If the object is not of the right class it will print a warning and ignore the object provided.
 void calculationDone(java.lang.String message)
          Notifies the control when a calculation has completed.
 void clearMessages()
          Clears all text from the control's message area.
 void clearValues()
          Clears all text from the control's data input area.
 java.util.Collection<java.lang.String> getPropertyNames()
          Reads the current property names.
 Value getValue(java.lang.String _variable)
          Returns the group value of a variable.
 void print(java.lang.String s)
          Prints a string in the control's message area.
 void println()
          Prints a blank line in the control's message area.
 void println(java.lang.String s)
          Prints a string in the control's message area followed by a CR and LF.
 void reset()
          Reset all elements
 void setLockValues(boolean lock)
          Locks the control's interface.
 void setValue(java.lang.String _variable, Value _value)
          Sets the group value for a variable.
 
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, getDouble, getElement, getInt, getLoader, getObject, 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
getBoolean, getDouble, getInt, getObject, getString, setValue, setValue, setValue, setValue
 

Constructor Detail

EjsControl

public EjsControl(java.lang.Object _simulation)
The EjsControl constructor.

Parameters:
_simulation -

EjsControl

public EjsControl(java.lang.Object _simulation,
                  java.lang.String _replaceName,
                  java.awt.Frame _replaceOwnerFrame)
Constructor EjsControl

Parameters:
_simulation -
_replaceName -
_replaceOwnerFrame -

EjsControl

public EjsControl()
Constructor EjsControl

Method Detail

addObject

public ControlElement addObject(java.lang.Object _object,
                                java.lang.String _classname,
                                java.lang.String _propList)
Description copied from class: GroupControl
Creates a new ControlElement that wrapps an existing object If the object is not of the right class it will print a warning and ignore the object provided.

Overrides:
addObject in class GroupControl

reset

public void reset()
Description copied from class: GroupControl
Reset all elements

Overrides:
reset in class GroupControl

setLockValues

public void setLockValues(boolean lock)
Locks the control's interface. Values sent to the control will not update the display until the control is unlocked.

Specified by:
setLockValues in interface Control
Parameters:
lock - boolean

getPropertyNames

public java.util.Collection<java.lang.String> getPropertyNames()
Reads the current property names.

Specified by:
getPropertyNames in interface Control
Returns:
the property names

clearValues

public void clearValues()
Description copied from interface: Control
Clears all text from the control's data input area.

Specified by:
clearValues in interface Control

clearMessages

public void clearMessages()
Description copied from interface: Control
Clears all text from the control's message area.

Specified by:
clearMessages in interface Control

println

public void println(java.lang.String s)
Description copied from interface: Control
Prints a string in the control's message area followed by a CR and LF. GUI controls will usually display messages in a non-editable text area.

Specified by:
println in interface Control

println

public void println()
Description copied from interface: Control
Prints a blank line in the control's message area. GUI controls will usually display messages in a non-editable text area.

Specified by:
println in interface Control

print

public void print(java.lang.String s)
Description copied from interface: Control
Prints a string in the control's message area. GUI controls will usually display messages in a non-editable text area.

Specified by:
print in interface Control

calculationDone

public void calculationDone(java.lang.String message)
Description copied from interface: Control
Notifies the control when a calculation has completed. Some controls, such as the animation control, change their appearance during a calculation. A completed calculation, such as when a predetermined tolerance is reached, can call this method. The message will be displayed in the control's message area.

Specified by:
calculationDone in interface Control

setValue

public void setValue(java.lang.String _variable,
                     Value _value)
Description copied from class: GroupControl
Sets the group value for a variable. This includes the value in all the elements of this group that are registered to this variable name.

Overrides:
setValue in class GroupControl

getValue

public Value getValue(java.lang.String _variable)
Description copied from class: GroupControl
Returns the group value of a variable.

Overrides:
getValue in class GroupControl
Returns:
the Value object of the variable. If the variable has never been set, it returns null.