Class OSPControlTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable, Control

public class OSPControlTable extends XMLTable implements Control
OSPControlTable automatically converts strings, such "pi" or "sqrt(2)" to numbers when getDouble and getInt are invoked.
Version:
1.1
Author:
W. Christian
See Also:
  • Constructor Details

    • OSPControlTable

      public OSPControlTable()
      Constructs OSPControlTable and creates an XMLControlElement.
    • OSPControlTable

      public OSPControlTable(XMLControlElement control)
      Constructs OSPControlTable with the given control.
      Parameters:
      control - XMLControlElement
  • Method Details

    • 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
    • setValue

      public void setValue(String par, Object val)
      Adds a parameter to the input display.
      Specified by:
      setValue in interface Control
      Parameters:
      par - the parameter name
      val - the initial parameter value
    • setDecimalFormat

      public void setDecimalFormat(String pattern)
      Sets the format pattern used for floating point numbers.
      Parameters:
      pattern - String
    • setValue

      public void setValue(String par, double val)
      Adds an initial value of a parameter to the input display.
      Specified by:
      setValue in interface Control
      Parameters:
      par - the parameter name
      val - the initial parameter value
    • setValue

      public void setValue(String par, int val)
      Adds an initial value of a parameter to the input display.
      Specified by:
      setValue in interface Control
      Parameters:
      par - the parameter name
      val - the initial parameter value
    • setValue

      public void setValue(String par, boolean val)
      Description copied from interface: Control
      Stores a name and a boolean value in the control. GUI controls will usually display the name followed by an equal sign followed by the toString<\code> representation of the integer.
      Specified by:
      setValue in interface Control
    • getInt

      public int getInt(String par)
      Reads a parameter value from the input display.
      Specified by:
      getInt in interface Control
      Parameters:
      par -
      Returns:
      int the value of of the parameter
    • inputError

      public boolean inputError(String par)
      Test if the last "get" method produced an input error.
      Parameters:
      par - String
      Returns:
      boolean
    • getDouble

      public double getDouble(String par)
      Reads a double value from the table.
      Specified by:
      getDouble in interface Control
      Parameters:
      par - String the parameter key
      Returns:
      double the value of of the parameter
    • getObject

      public Object getObject(String par) throws UnsupportedOperationException
      Gets the object with the specified property name. Throws an UnsupportedOperationException if the named object has not been stored.
      Specified by:
      getObject in interface Control
      Parameters:
      par -
      Returns:
      the object
      Throws:
      UnsupportedOperationException
    • getString

      public String getString(String par)
      Description copied from interface: Control
      Gets a stored string from the control. Srings have usually been initialized with the setValue (String name, Object val)<\code> method. GUI controls will usually allow the user to edit the value of the parameter.
      Specified by:
      getString in interface Control
      Returns:
      the value of the parameter
    • getBoolean

      public boolean getBoolean(String par)
      Description copied from interface: Control
      Gets a stored boolean from the control. Srings have usually been initialized with the setValue (String name, Object val)<\code> method. GUI controls will usually allow the user to edit the value of the parameter.
      Specified by:
      getBoolean in interface Control
      Returns:
      the value of the parameter
    • getPropertyNames

      public Collection<String> getPropertyNames()
      Description copied from interface: Control
      Gets the names of all properties stored in this control.
      Specified by:
      getPropertyNames in interface Control
      Returns:
      a clone of the properties List
    • 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
    • removeParameter

      public void removeParameter(String par)
      Removes a parameter from the table.
      Parameters:
      par - the parameter name
    • 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
    • clearMessages

      public void clearMessages()
      Description copied from interface: Control
      Clears all text from the control's message area.
      Specified by:
      clearMessages in interface Control
    • 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
    • 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
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load data for this object.
      Returns:
      the object loader