Class ColorParameter
java.lang.Object
uk.ac.starlink.task.Parameter<Color>
uk.ac.starlink.ttools.plottask.NamedObjectParameter<Color>
uk.ac.starlink.ttools.plottask.ColorParameter
-
Field Summary
Fields inherited from class uk.ac.starlink.task.Parameter
BY_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolorValue(uk.ac.starlink.task.Environment env) Returns the value of this parameter as a Color object.fromString(String name) Translates a string value for this parameter into the object value which it represents.Returns an XML string, suitable for inclusion in a parameter description, which explains the format of values accepted by this parameter.voidsetDefaultColor(Color color) Sets the default value of this parameter to a given color object.Translates a possible option value of this parameter into a string which represents it as a string value.Methods inherited from class NamedObjectParameter
addOption, getNames, getOptionList, getOptions, getUsage, setDefaultOption, setUsage, stringToObjectMethods inherited from class uk.ac.starlink.task.Parameter
clearValue, getDescription, getName, getPosition, getPreferExplicit, getPrompt, getStringDefault, getValueClass, isNullPermitted, objectToString, objectValue, setDescription, setDescription, setName, setNullPermitted, setPosition, setPreferExplicit, setPrompt, setStringDefault, setValue, setValueFromObject, setValueFromString, stringValue, toArray, toString
-
Constructor Details
-
ColorParameter
-
-
Method Details
-
colorValue
public Color colorValue(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException Returns the value of this parameter as a Color object.- Parameters:
env- execution environment- Throws:
uk.ac.starlink.task.TaskException
-
setDefaultColor
Sets the default value of this parameter to a given color object.- Parameters:
color- colour
-
toString
Description copied from class:NamedObjectParameterTranslates a possible option value of this parameter into a string which represents it as a string value.- Overrides:
toStringin classNamedObjectParameter<Color>- Parameters:
option- object value- Returns:
- corresponding string
-
fromString
Description copied from class:NamedObjectParameterTranslates a string value for this parameter into the object value which it represents. Must return a suitable object value for this parameter, or throw an unchecked exception.The implementation must be such that
fromString(toString(o)).equals(o).- Specified by:
fromStringin classNamedObjectParameter<Color>- Parameters:
name- option name- Returns:
- corresponding option value
-
getFormatDescription
Returns an XML string, suitable for inclusion in a parameter description, which explains the format of values accepted by this parameter. The returned string is not enclosed in a <p> element.- Returns:
- format description XML string
-