Class ShaderConfigKey
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.ConfigKey<T>
-
- uk.ac.starlink.ttools.plot2.config.ChoiceConfigKey<Shader>
-
- uk.ac.starlink.ttools.plot2.config.ShaderConfigKey
-
public class ShaderConfigKey extends ChoiceConfigKey<Shader>
ConfigKey for selecting shader objects.- Since:
- 9 Sep 2014
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description ShaderConfigKey(ConfigMeta meta, Shader[] shaders, Shader dflt)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ShaderConfigKeyappendShaderDescription()Appends a list of the available shaders, as well as rules for naming custom ones, to the end of the existing XML documentation for this key.static ConfigMetacreateAxisMeta(java.lang.String shortName, java.lang.String longName, java.lang.String axName)Creates a key description suitable for a colour map applied to a named axis.Specifier<Shader>createSpecifier()Constructs a graphical control with which the user can specify a suitable value for association with this key.ShaderdecodeString(java.lang.String sval)Takes a string, and attempts to turn it into an object which may be a value for this key.java.lang.StringstringifyValue(Shader value)Takes an object which may be a value of this key, and attempts to turn it into a string for reporting purposes.-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ChoiceConfigKey
addOption, getOptionMap, stringToValue, valueToString
-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
-
-
-
-
Constructor Detail
-
ShaderConfigKey
public ShaderConfigKey(ConfigMeta meta, Shader[] shaders, Shader dflt)
Constructor.- Parameters:
meta- metadatashaders- list of optionsdflt- default value
-
-
Method Detail
-
decodeString
public Shader decodeString(java.lang.String sval)
Description copied from class:ChoiceConfigKeyTakes a string, and attempts to turn it into an object which may be a value for this key. If the string is not of a recognised form, null is returned.This method should be the opposite of
ChoiceConfigKey.stringifyValue(T), but does not need to be consistent withstringToValueorvalueToString.- Specified by:
decodeStringin classChoiceConfigKey<Shader>- Parameters:
sval- string representation- Returns:
- typed object represented by sval, or null
-
stringifyValue
public java.lang.String stringifyValue(Shader value)
Description copied from class:ChoiceConfigKeyTakes an object which may be a value of this key, and attempts to turn it into a string for reporting purposes.This method should if possible be the opposite of
ChoiceConfigKey.decodeString(java.lang.String), but does not need to be consistent withstringToValueorvalueToString. If no round-trippable value is available, null should be returned.- Specified by:
stringifyValuein classChoiceConfigKey<Shader>- Parameters:
value- typed object- Returns:
- string representing object, or null
-
createSpecifier
public Specifier<Shader> createSpecifier()
Description copied from class:ConfigKeyConstructs a graphical control with which the user can specify a suitable value for association with this key.- Specified by:
createSpecifierin classConfigKey<Shader>- Returns:
- new specifier
-
appendShaderDescription
public ShaderConfigKey appendShaderDescription()
Appends a list of the available shaders, as well as rules for naming custom ones, to the end of the existing XML documentation for this key.- Returns:
- this object, as a convenience
-
createAxisMeta
public static ConfigMeta createAxisMeta(java.lang.String shortName, java.lang.String longName, java.lang.String axName)
Creates a key description suitable for a colour map applied to a named axis.- Parameters:
shortName- metadata short namelongName- metadata long nameaxName- user-readable name of axis to which this applies- Returns:
- new metadata object
-
-