Class ScriptParam

java.lang.Object
ca.phon.script.params.ScriptParam
Direct Known Subclasses:
BooleanScriptParam, DiacriticOptionsScriptParam, EnumScriptParam, LabelScriptParam, MultiboolScriptParam, SeparatorScriptParam, StringScriptParam, TierListScriptParam, TierSelectionScriptParam

public abstract class ScriptParam extends Object
A parameter for a script. These parameters are setup by the PhonScriptContext when running the script. Each ScriptParam can have more than one paramId which maps to the same property name in the script.
  • Field Details

    • ENABLED_PROP

      public static final String ENABLED_PROP
    • VISIBLE_PROP

      public static final String VISIBLE_PROP
    • propSupport

      protected final PropertyChangeSupport propSupport
      Property change support
  • Constructor Details

    • ScriptParam

      public ScriptParam()
      Constructor
    • ScriptParam

      public ScriptParam(String[] ids, Object[] defaultValues)
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
    • addPropertyChangeListener

      public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
    • getPropertyChangeListeners

      public PropertyChangeListener[] getPropertyChangeListeners()
    • getPropertyChangeListeners

      public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
    • getParamId

      public String getParamId()
      Returns the first (and many times only) param id for this ScriptParam
      Returns:
      first param id
    • getParamIds

      public Collection<String> getParamIds()
    • getParamType

      public String getParamType()
    • setParamType

      public void setParamType(String paramType)
    • getParamDesc

      public String getParamDesc()
    • setParamDesc

      public void setParamDesc(String paramDesc)
    • getValue

      public Object getValue(String paramId)
    • setValue

      public void setValue(String paramId, Object val)
    • getDefaultValue

      public Object getDefaultValue(String paramId)
    • setDefaultValue

      public void setDefaultValue(String paramId, Object defaultValue)
    • hasChanged

      public boolean hasChanged()
      Has the value of any of the paramIds changed from the default value.
      Returns:
    • getStringRepresentation

      public abstract String getStringRepresentation()
      Get the string representation of this param.
    • isEnabled

      public boolean isEnabled()
      Is this param enabled. If a script param is not enabled it will not be added to the scriptable scope for the script during execution. As well, if a UI is visible, the component controlling this param should also appear 'disabled'
      Returns:
      true if this param is enabled, false otherwise
    • setEnabled

      public void setEnabled(boolean enabled)
      Set the enabled state of this ScriptParam
      Parameters:
      enabled -
    • getVisible

      public boolean getVisible()
      Get the visiblity status of this param. This property affects any UI component that is controlling this param. An invisible param may still be enabled and setup during script execution.
      Returns:
      true if this param should be invisible, false otherwise
    • setVisible

      public void setVisible(Boolean visible)
      Set visibility status of param
      Parameters:
      visible -