|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.config.ConfigKey<T>
uk.ac.starlink.ttools.plot2.config.ChoiceConfigKey<Color>
uk.ac.starlink.ttools.plot2.config.ColorConfigKey
public class ColorConfigKey
ConfigKey for selecting colours. A null colour is optionally available, controlled by a toggle switch.
Constructor Summary | |
---|---|
ColorConfigKey(ConfigMeta meta,
Color dflt,
boolean allowHide)
Constructor. |
Method Summary | |
---|---|
static ConfigMeta |
createColorMeta(String shortName,
String longName,
String theItem)
Returns a metadata object suitable for use with a ColorConfigKey. |
Specifier<Color> |
createSpecifier()
Constructs a graphical control with which the user can specify a suitable value for association with this key. |
Color |
decodeString(String sval)
Takes a string, and attempts to turn it into an object which may be a value for this key. |
String |
stringifyValue(Color color)
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ColorConfigKey(ConfigMeta meta, Color dflt, boolean allowHide)
meta
- metadatadflt
- default valueallowHide
- true if hiding the colour, which results in a null
value, is a legal optionMethod Detail |
---|
public Color decodeString(String sval)
ChoiceConfigKey
This method should be the opposite of ChoiceConfigKey.stringifyValue(T)
,
but does not need to be consistent with
stringToValue
or
valueToString
.
decodeString
in class ChoiceConfigKey<Color>
sval
- string representation
public String stringifyValue(Color color)
ChoiceConfigKey
This method should if possible
be the opposite of ChoiceConfigKey.decodeString(java.lang.String)
,
but does not need to be consistent with
stringToValue
or
valueToString
.
If no round-trippable value is available, null should be returned.
stringifyValue
in class ChoiceConfigKey<Color>
color
- typed object
public Specifier<Color> createSpecifier()
ConfigKey
createSpecifier
in class ConfigKey<Color>
public static ConfigMeta createColorMeta(String shortName, String longName, String theItem)
shortName
- key name for use in command-line interfacelongName
- key name for use in GUItheItem
- description of the item to use in free-form text,
for instance "the plot grid"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |