uk.ac.starlink.ttools.plottask
Class ColorParameter

java.lang.Object
  extended by uk.ac.starlink.task.Parameter
      extended by uk.ac.starlink.ttools.plottask.NamedObjectParameter
          extended by uk.ac.starlink.ttools.plottask.ColorParameter

public class ColorParameter
extends NamedObjectParameter


Constructor Summary
ColorParameter(String name)
          Constructor.
 
Method Summary
 Color colorValue(uk.ac.starlink.task.Environment env)
          Returns the value of this parameter as a Color object.
 Object fromString(String name)
          Translates a string value for this parameter into the object value which it represents.
 String getFormatDescription()
          Returns an XML string, suitable for inclusion in a parameter description, which explains the format of values accepted by this parameter.
 void setDefaultColor(Color color)
          Sets the default value of this parameter to a given color object.
 String toString(Object option)
          Translates a possible option value of this parameter into a string which represents it as a string value.
 
Methods inherited from class uk.ac.starlink.ttools.plottask.NamedObjectParameter
addOption, getNames, getOptionList, getOptions, getUsage, objectValue, setDefaultOption, setUsage, setValueFromString
 
Methods inherited from class uk.ac.starlink.task.Parameter
checkGotValue, clearValue, getDefault, getDescription, getName, getPosition, getPreferExplicit, getPrompt, isNullPermitted, setDefault, setDescription, setDescription, setGotValue, setName, setNullPermitted, setPosition, setPreferExplicit, setPrompt, setStringValue, stringValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorParameter

public ColorParameter(String name)
Constructor.

Parameters:
name - parameter name
Method Detail

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

public void setDefaultColor(Color color)
Sets the default value of this parameter to a given color object.

Parameters:
color - colour

toString

public String toString(Object option)
Description copied from class: NamedObjectParameter
Translates a possible option value of this parameter into a string which represents it as a string value.

Overrides:
toString in class NamedObjectParameter
Parameters:
option - object value
Returns:
corresponding string

fromString

public Object fromString(String name)
Description copied from class: NamedObjectParameter
Translates 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:
fromString in class NamedObjectParameter
Parameters:
name - option name
Returns:
corresponding option value

getFormatDescription

public String 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


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.