Class PerUnitConfigKey<U extends Unit>
java.lang.Object
uk.ac.starlink.ttools.plot2.config.ConfigKey<U>
uk.ac.starlink.ttools.plot2.config.OptionConfigKey<U>
uk.ac.starlink.ttools.plot2.config.PerUnitConfigKey<U>
ConfigKey for unit selection.
The main trick this OptionConfigKey subclass has is to manage
Reporting of a plot's
Combiner.Type
,
so it can work in concert with a Combiner config key to provide
a more comprehensible GUI.
If the Combiner is not density-like, then this selector is
irrelevant, and so the GUI component is disabled.
Client PlotLayers should assemble ReportMaps with the ReportKey
from this ConfigKeys'
getCombinerTypeReportKey()
method filled in appropriately.- Since:
- 25 Jan 2018
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionPerUnitConfigKey
(ConfigMeta meta, Class<U> clazz, U[] options, U dflt) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionConstructs a graphical control with which the user can specify a suitable value for association with this key.Returns a ReportKey that client PlotLayers should fill in when generating their ReportMap.getXmlDescription
(U unit) Returns a description in XML of the given option value.Methods inherited from class uk.ac.starlink.ttools.plot2.config.OptionConfigKey
addOptionsXml, getOptions, getOptionsXml, setOptionUsage, stringToValue, valueToString
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
-
Constructor Details
-
PerUnitConfigKey
Constructor.- Parameters:
meta
- metadataclazz
- class to which all the possible options belongoptions
- array of possible values for this keydflt
- default option, should be one ofoptions
-
-
Method Details
-
getCombinerTypeReportKey
Returns a ReportKey that client PlotLayers should fill in when generating their ReportMap.- Returns:
- combiner key report key
-
getXmlDescription
Description copied from class:OptionConfigKey
Returns a description in XML of the given option value. This, along withOptionConfigKey.valueToString(T)
, is used by theOptionConfigKey.getOptionsXml()
method to assemble a described list of the options.- Specified by:
getXmlDescription
in classOptionConfigKey<U extends Unit>
- Parameters:
unit
- possible value of this key- Returns:
- short snippet of XML (not wrapped in any outer element) describing the value; may be null if no description required or available
-
createSpecifier
Description copied from class:ConfigKey
Constructs a graphical control with which the user can specify a suitable value for association with this key.- Overrides:
createSpecifier
in classOptionConfigKey<U extends Unit>
- Returns:
- new specifier
-