Class SubrangeConfigKey
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.ConfigKey<Subrange>
-
- uk.ac.starlink.ttools.plot2.config.SubrangeConfigKey
-
-
Constructor Summary
Constructors Constructor Description SubrangeConfigKey(ConfigMeta meta)
Constructs a key with the usual default.SubrangeConfigKey(ConfigMeta meta, Subrange dflt, double vmin, double vmax)
Constructs a key with a given default.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigMeta
createAxisSubMeta(java.lang.String axname, java.lang.String axisName)
Returns a metadata object to describe a SubrangeConfigKey for use with a coordinate axis.static ConfigMeta
createShaderClipMeta(java.lang.String axname, java.lang.String axisName)
Returns a metadaa object to describe a SubrangeConfigKey for use as a restriction on a colour ramp (Shader).Specifier<Subrange>
createSpecifier()
Constructs a graphical control with which the user can specify a suitable value for association with this key.Subrange
stringToValue(java.lang.String txt)
Decodes a string value to the value type of this key.java.lang.String
valueToString(Subrange value)
Reports a value as a string.-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
-
-
-
-
Constructor Detail
-
SubrangeConfigKey
public SubrangeConfigKey(ConfigMeta meta, Subrange dflt, double vmin, double vmax)
Constructs a key with a given default. Thevmin
andvmax
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
- metadatadflt
- default subrangevmin
- minimum value suggested by GUIvmax
- 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 Detail
-
valueToString
public java.lang.String valueToString(Subrange value)
Description copied from class:ConfigKey
Reports a value as a string. If at all possible the roundtripping should be possible, sostringToValue(valueToString(v)).equals(v)
. A null value, if permitted, should be represented as an empty string.- Specified by:
valueToString
in classConfigKey<Subrange>
- Parameters:
value
- possible value associated with this key- Returns:
- string representation
-
stringToValue
public Subrange stringToValue(java.lang.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 classConfigKey<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 classConfigKey<Subrange>
- Returns:
- new specifier
-
createAxisSubMeta
public static ConfigMeta createAxisSubMeta(java.lang.String axname, java.lang.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(java.lang.String axname, java.lang.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
-
-