Class FWCalibrationFormComponent

All Implemented Interfaces:
ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, net.simplace.core.FWBusyIndicator, net.simplace.core.FWObserver

public class FWCalibrationFormComponent extends FWAbstractFormComponent implements ChangeListener, ItemListener
Form component to specify the values of a model variable for calibration or sensitivity runs. The session is taken from the parameter named in the attribute session, the variable name from the parameter named in the attribute source. Depending on the data type of the variable it shows
  • DOUBLE/INT: fields for minimum, maximum and count; value min,max,count
  • other types with options: one checkbox per option; value = comma-separated selected options
  • other types without options: a text area for a comma-separated list of values
The component is rebuilt when the source parameter changes.
Author:
Andreas Enders
See Also:
  • Constructor Details

    • FWCalibrationFormComponent

      public FWCalibrationFormComponent(String aFormId, String aFieldId, boolean aShowLabel, org.jdom2.Element aParameters, net.simplace.core.FWObservable aObservable)
      Constructs the component for the variable given by the source parameter.
      Parameters:
      aFormId - id of the form the component is placed in
      aFieldId - id of the component, also the parameter key of its value
      aShowLabel - specifies whether or not a descriptive label is shown to the left of the control
      aParameters - the form element (attributes session and source)
      aObservable - parameters of the functionality, containing the session and the variable name
  • Method Details

    • getValue

      public String getValue()
      Specified by:
      getValue in class FWAbstractFormComponent
      Returns:
      min,max,count for numbers, otherwise the comma-separated selected options (checkbox mode) or the text entered in the text area
    • setValue

      public void setValue(Object aValue)
      Sets the value: min,max,count for numbers, a comma-separated list of options (checkbox mode) or of values (text area) otherwise.
      Specified by:
      setValue in class FWAbstractFormComponent
      Parameters:
      aValue - the value as string; null is ignored
    • getSelectedValueList

      public List<Object> getSelectedValueList()
      Returns:
      the options of the selected checkboxes; empty if there are no checkboxes
    • setEnabled

      public void setEnabled(boolean aIsEnabled)
      Does nothing; the component cannot be disabled.
      Overrides:
      setEnabled in class JComponent
      Parameters:
      aIsEnabled - not used
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Notifies dependent components of the changed value.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - the change event
    • update

      public void update(net.simplace.core.FWObservable aObservable, Object aKeyOfParameterChanged)
      In addition to the base behaviour, rebuilds the controls when the source parameter changes.
      Specified by:
      update in interface net.simplace.core.FWObserver
      Overrides:
      update in class FWAbstractFormComponent
      Parameters:
      aObservable - the parameters
      aKeyOfParameterChanged - key of the changed parameter
    • processFormFiller

      public void processFormFiller()
      Description copied from class: FWAbstractFormComponent
      Fills the component from its form filler (e.g. options or a chart); called after initialisation and whenever the jumper rule of the form filler changes.
      Specified by:
      processFormFiller in class FWAbstractFormComponent
    • getValueCell

      protected com.lowagie.text.Rectangle getValueCell(int aType)
      Description copied from class: FWAbstractFormComponent
      Returns the value cell used for generating the RTF, PDF or HTML version of the form.
      Specified by:
      getValueCell in class FWAbstractFormComponent
      Parameters:
      aType - output type, e.g. PrintHelper.TYPE_PDF
      Returns:
      an iText cell (PdfPCell for PDF, Cell otherwise)
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Keeps at least one checkbox selected and notifies dependent components.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      e - the item event