Class SimulationSettings

java.lang.Object
com.eco.bio7.simulation.SimulationSettings

public final class SimulationSettings extends Object
The settings of a simulation model in Bio7: a custom view ("Settings") with a control for each field with the annotation Param and a button for each method with the annotation Action (the same controls as the HTML export, below the headings of their groups). A change sets the field of the running model (live) or, with restart = true, sets it and calls the setup.

A model can show an own panel, e.g., a Composite designed with the WindowBuilder: Simulation.settings(Composite) creates it. The widgets of its fields are bound to the model by their names (see bind(Object, Simulation)).

  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    bind(Object panel, Simulation model)
    Binds the widgets of a panel (e.g., a Composite designed with the WindowBuilder) to the model by the names of the fields of the panel: a Scale or Slider with the name of a Param field: the range of the Param (min, max, step), else the value of the selection a Spinner: the value (with its digits), a Text: the value as text a check Button: a boolean Param, a Combo: a String Param (the options of the Param if the Combo has no items) a Label with the name of a Param and "Value" (e.g., feedValue): shows the value a push Button with the name of an Action method: calls the method; the names setup and export: the setup and the HTML export Called automatically for the panel of Simulation.settings(Composite).
    static void
    Shows the settings of the model (in the thread of the user interface).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • show

      public static void show(Simulation model)
      Shows the settings of the model (in the thread of the user interface).
    • bind

      public static int bind(Object panel, Simulation model)
      Binds the widgets of a panel (e.g., a Composite designed with the WindowBuilder) to the model by the names of the fields of the panel:
      • a Scale or Slider with the name of a Param field: the range of the Param (min, max, step), else the value of the selection
      • a Spinner: the value (with its digits), a Text: the value as text
      • a check Button: a boolean Param, a Combo: a String Param (the options of the Param if the Combo has no items)
      • a Label with the name of a Param and "Value" (e.g., feedValue): shows the value
      • a push Button with the name of an Action method: calls the method; the names setup and export: the setup and the HTML export
      Called automatically for the panel of Simulation.settings(Composite).
      Parameters:
      panel - the object with the widgets as fields
      model - the simulation model
      Returns:
      the number of the bound widgets