Class EjsControl

java.lang.Object
org.opensourcephysics.ejs.control.GroupControl
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
  • Constructor Details

    • EjsControl

      public EjsControl(Object _simulation)
      The EjsControl constructor.
      Parameters:
      _simulation -
    • EjsControl

      public EjsControl(Object _simulation, String _replaceName, Frame _replaceOwnerFrame)
      Constructor EjsControl
      Parameters:
      _simulation -
      _replaceName -
      _replaceOwnerFrame -
    • EjsControl

      public EjsControl()
      Constructor EjsControl
  • Method Details

    • addObject

      public ControlElement addObject(Object _object, String _classname, 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 Collection<String> getPropertyNames()
      Reads the current property names.
      Specified by:
      getPropertyNames in interface Control
      Returns:
      the property names
    • getPropertyNamesRaw

      public Collection<String> getPropertyNamesRaw()
      Description copied from interface: Control
      Gets the names of all properties stored in this control.
      Specified by:
      getPropertyNamesRaw in interface Control
      Returns:
      the actual property list
    • 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(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(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(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(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(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.