Package uk.ac.starlink.ttools.plot2.task
Class LayerTypeParameter
- All Implemented Interfaces:
ExtraParameter
public class LayerTypeParameter
extends uk.ac.starlink.task.ChoiceParameter<LayerType>
implements ExtraParameter
Parameter that specifies a LayerType to be used for a plot layer.
LayerTypes in some cases correspond to Plotters, and in some cases
to families of Plotters.
Most of the complication here is generating the auto-documentation. It's not 100% obvious that code belongs here, but I can't think of a better place to put it.
- Since:
- 3 Sep 2014
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class uk.ac.starlink.task.Parameter
BY_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionLayerTypeParameter
(String prefix, String suffix, PlotContext<?, ?> context) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic uk.ac.starlink.task.Parameter<?>[]
getCoordParams
(Coord[] coords, String suffix, boolean fullDetail) Gets parameters used for specifying coordinate values for a plot.Returns an extended usage message.static uk.ac.starlink.task.Parameter<?>[]
getInputParams
(String suffix) Gets parameters used for specifying a table with input data for a plot.static uk.ac.starlink.task.Parameter<?>[]
getLayerConfigParams
(ConfigKey<?>[] configKeys, String suffix, boolean fullDetail) Gets parameters used for speciyfing ConfigKey-based values for a plot.static LayerType[]
getLayerTypes
(Plotter<?>[] plotters) Returns the list of LayerTypes represented by a given list of Plotters.stringifyOption
(LayerType ltype) static String
usageWord
(uk.ac.starlink.task.Parameter<?> param) Returns a "name=<usage>" string for a parameter.usageWords
(uk.ac.starlink.task.Parameter<?>[] params) List of name=usage strings for a given set of parameters.Methods inherited from class uk.ac.starlink.task.ChoiceParameter
getUsage, objectToString, setDefaultOption, setUsage, stringToObject
Methods inherited from class uk.ac.starlink.task.AbstractChoiceParameter
addOption, addOption, choiceToString, clearOptions, getName, getOption, getOptionNames, getOptions, getOptionValueList, stringToChoice
Methods inherited from class uk.ac.starlink.task.Parameter
clearValue, getDescription, getName, getPosition, getPreferExplicit, getPrompt, getStringDefault, getValueClass, isNullPermitted, objectValue, setDescription, setDescription, setName, setNullPermitted, setPosition, setPreferExplicit, setPrompt, setStringDefault, setValue, setValueFromObject, setValueFromString, stringValue, toArray, toString
-
Constructor Details
-
LayerTypeParameter
Constructor.- Parameters:
prefix
- non-suffix part of this parameter's namesuffix
- layer-specific part of this parameter's namecontext
- plot context
-
-
Method Details
-
stringifyOption
-
getExtraUsage
Description copied from interface:ExtraParameter
Returns an extended usage message. This should not repeat the content of the normal usage message. It should be preformatted, that is it should contain newlines to keep the line length down to less than 80 characters.- Specified by:
getExtraUsage
in interfaceExtraParameter
- Parameters:
env
- execution envrionment- Returns:
- extended usage message
-
getInputParams
Gets parameters used for specifying a table with input data for a plot.- Parameters:
suffix
- layer suffix- Returns:
- input table parameters
-
getCoordParams
public static uk.ac.starlink.task.Parameter<?>[] getCoordParams(Coord[] coords, String suffix, boolean fullDetail) Gets parameters used for specifying coordinate values for a plot.- Parameters:
coords
- coordinates requiredsuffix
- layer suffixfullDetail
- if true, extra detail is appended to the parameter descriptions- Returns:
- coord parameters
-
getLayerConfigParams
public static uk.ac.starlink.task.Parameter<?>[] getLayerConfigParams(ConfigKey<?>[] configKeys, String suffix, boolean fullDetail) Gets parameters used for speciyfing ConfigKey-based values for a plot.- Parameters:
configKeys
- configuration keyssuffix
- layer suffixfullDetail
- if true, extra detail is appended to the parameter descriptions- Returns:
- config parameters
-
usageWords
List of name=usage strings for a given set of parameters.- Parameters:
params
- parameter list- Returns:
- list of name=usage strings, one for each param
-
usageWord
Returns a "name=<usage>" string for a parameter.- Parameters:
param
- parameter- Returns:
- usage string
-
getLayerTypes
Returns the list of LayerTypes represented by a given list of Plotters.- Parameters:
plotters
- plotter list- Returns:
- layer type list
-