Class SubrangeConfigKey

java.lang.Object
uk.ac.starlink.ttools.plot2.config.ConfigKey<Subrange>
uk.ac.starlink.ttools.plot2.config.SubrangeConfigKey

public class SubrangeConfigKey extends ConfigKey<Subrange>
Config key that specifies a Subrange.
Since:
23 Feb 2013
Author:
Mark Taylor
  • Constructor Details

    • SubrangeConfigKey

      public SubrangeConfigKey(ConfigMeta meta, Subrange dflt, double vmin, double vmax)
      Constructs a key with a given default. The vmin and vmax parameters do not impose any hard limits on the value associated with this key, but they influence the values offered by the Specifier component.
      Parameters:
      meta - metadata
      dflt - default subrange
      vmin - minimum value suggested by GUI
      vmax - maximum value suggested by GUI
    • SubrangeConfigKey

      public SubrangeConfigKey(ConfigMeta meta)
      Constructs a key with the usual default. The default subrange covers the whole range 0..1.
      Parameters:
      meta - metadata
  • Method Details

    • valueToString

      public String valueToString(Subrange value)
      Description copied from class: ConfigKey
      Reports a value as a string. If at all possible the roundtripping should be possible, so stringToValue(valueToString(v)).equals(v). A null value, if permitted, should be represented as an empty string.
      Specified by:
      valueToString in class ConfigKey<Subrange>
      Parameters:
      value - possible value associated with this key
      Returns:
      string representation
    • stringToValue

      public Subrange stringToValue(String txt) throws ConfigException
      Description copied from class: ConfigKey
      Decodes a string value to the value type of this key. An empty string should be interpreted as a null value, but this may cause an exception if null is not a permissible value for this key.
      Specified by:
      stringToValue in class ConfigKey<Subrange>
      Parameters:
      txt - string representation of value
      Returns:
      value
      Throws:
      ConfigException
    • createSpecifier

      public Specifier<Subrange> createSpecifier()
      Description copied from class: ConfigKey
      Constructs a graphical control with which the user can specify a suitable value for association with this key.
      Specified by:
      createSpecifier in class ConfigKey<Subrange>
      Returns:
      new specifier
    • createAxisSubMeta

      public static ConfigMeta createAxisSubMeta(String axname, String axisName)
      Returns a metadata object to describe a SubrangeConfigKey for use with a coordinate axis.
      Parameters:
      axname - abbreviated axis name (for CLI)
      axisName - full axis name (for GUI)
      Returns:
      metadata object describing a subrange config key for an axis
    • createShaderClipMeta

      public static ConfigMeta createShaderClipMeta(String axname, String axisName)
      Returns a metadaa object to describe a SubrangeConfigKey for use as a restriction on a colour ramp (Shader).
      Parameters:
      axname - abbreviated axis name (for CLI)
      axisName - full axis name (for GUI)
      Returns:
      metadata object describing a subrange config key for a shader