Class DashConfigKey
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.ConfigKey<T>
-
- uk.ac.starlink.ttools.plot2.config.ChoiceConfigKey<float[]>
-
- uk.ac.starlink.ttools.plot2.config.DashConfigKey
-
public class DashConfigKey extends ChoiceConfigKey<float[]>
ConfigKey for selecting line dash types.- Since:
- 9 Sep 2014
- Author:
- Mark Taylor
- See Also:
BasicStroke.getDashArray()
-
-
Constructor Summary
Constructors Constructor Description DashConfigKey(ConfigMeta meta)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigMeta
createDashMeta(java.lang.String shortName, java.lang.String longName)
Returns a metadata object suitable for use with a DashConfigKey.Specifier<float[]>
createSpecifier()
Constructs a graphical control with which the user can specify a suitable value for association with this key.float[]
decodeString(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.String
stringifyValue(float[] dash)
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
-
DashConfigKey
public DashConfigKey(ConfigMeta meta)
Constructor.- Parameters:
meta
- key metadata
-
-
Method Detail
-
decodeString
public float[] decodeString(java.lang.String sval)
Description copied from class:ChoiceConfigKey
Takes 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 withstringToValue
orvalueToString
.- Specified by:
decodeString
in classChoiceConfigKey<float[]>
- Parameters:
sval
- string representation- Returns:
- typed object represented by sval, or null
-
stringifyValue
public java.lang.String stringifyValue(float[] dash)
Description copied from class:ChoiceConfigKey
Takes 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 withstringToValue
orvalueToString
. If no round-trippable value is available, null should be returned.- Specified by:
stringifyValue
in classChoiceConfigKey<float[]>
- Parameters:
dash
- typed object- Returns:
- string representing object, or null
-
createSpecifier
public Specifier<float[]> 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<float[]>
- Returns:
- new specifier
-
createDashMeta
public static ConfigMeta createDashMeta(java.lang.String shortName, java.lang.String longName)
Returns a metadata object suitable for use with a DashConfigKey.- Parameters:
shortName
- short key namelongName
- long key name- Returns:
- dash config metadata
-
-