Class DiscreteDescriptor

java.lang.Object
com.motivewave.platform.sdk.common.desc.SettingDescriptor<String>
com.motivewave.platform.sdk.common.desc.DiscreteDescriptor

public class DiscreteDescriptor extends SettingDescriptor<String>
Describes a discrete set of values the user can choose from.
  • Constructor Details

    • DiscreteDescriptor

      public DiscreteDescriptor(String name, String label, String defaultValue, List<NVP> values)
      Constructor
      Parameters:
      name - name of this setting (key)
      label - label displayed to the user
      defaultValue - default value for the setting
      values - set of valid choices (as Name Value Pairs ie NVP)
  • Method Details

    • getDefaultValue

      public String getDefaultValue()
      Gets the default value for this setting.
      Overrides:
      getDefaultValue in class SettingDescriptor<String>
      Returns:
      default value for the setting
    • getValues

      public List<NVP> getValues()
      Gets the list of valid choices.
    • findNVP

      public NVP findNVP(String value)
      Gets the NVP associated to the given value.
    • createInputFX

      public javafx.scene.Node createInputFX(Settings settings, boolean readOnly)
      Description copied from class: SettingDescriptor
      Creates the component that will accept the user input. This is called by the study framework.
      Specified by:
      createInputFX in class SettingDescriptor<String>
      Parameters:
      settings - settings for the study
      readOnly - true if the component should not accept user input
      Returns:
      component that will accept user input.
    • fromJson

      public Object fromJson(Object json)
      Overrides:
      fromJson in class SettingDescriptor<String>