Package uk.ac.starlink.ttools.plot2.task
Class TypedPlot2Task<P,A>
java.lang.Object
uk.ac.starlink.ttools.plot2.task.AbstractPlot2Task
uk.ac.starlink.ttools.plot2.task.TypedPlot2Task<P,A>
- All Implemented Interfaces:
uk.ac.starlink.task.Task
,DynamicTask
- Direct Known Subclasses:
CubePlot2Task
,MatrixPlot2Task
,PlanePlot2Task
,SkyPlot2Task
,SpherePlot2Task
,TimePlot2Task
Plot2 task specialised for a fixed PlotType.
Knowing the PlotType up front doesn't make it more capable,
but it allows much more parameter auto-documentation to be done
than if the PlotType is determined only from the Environment.
- Since:
- 3 Sep 2014
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class uk.ac.starlink.ttools.plot2.task.AbstractPlot2Task
DOC_ZONE_SUFFIX, DOMAINMAPPER_SUFFIX, EXAMPLE_LAYER_SUFFIX, EXAMPLE_ZONE_SUFFIX, LAYER_PREFIX, ZONE_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <P,
A> PlotContext <P, A> createDefaultPlotContext
(PlotType<P, A> plotType) Returns a default plot context for a given PlotType.protected <T> String
getConfigParamDefault
(uk.ac.starlink.task.Environment env, ConfigKey<T> key, String[] suffixes) May provide a default value for a given config parameter that is sensitive to the content of the execution environment.uk.ac.starlink.task.Parameter<?>[]
Returns the fixed plot context for this task.getPlotContext
(uk.ac.starlink.task.Environment env) Concrete subclasses must implement this method to provide the PlotType and other information from the environment that may not be available at construction time.Returns the plot type.Methods inherited from class uk.ac.starlink.ttools.plot2.task.AbstractPlot2Task
createAuxCrowdParameter, createAuxLabelParameter, createAuxVisibleParameter, createAuxWidthParameter, createBasicConfigMap, createCaptioner, createConfigMap, createCustomConfigMap, createDataParameter, createDomainMapperParameter, createExecutable, createFilterParameter, createLabelParameter, createLayerSuffixedConfigMap, createLayerTypeParameter, createLegend, createLegendPositionParameter, createPaintModeParameter, createPlotComponent, createPlotConfiguration, createPlotIcon, createPlotIcon, createShadeAxisFactory, createTableParameter, createTitleParameter, createZoneParameter, getBasicParameters, getBitmapParameter, getCompositorParameter, getContextParameters, getCoordValue, getDataStoreParameter, getInputTable, getLegendBorderParameter, getLegendOpaqueParameter, getLegendParameter, getLegendSequenceParameter, getPaddingParameter, getParameterByName, getPlotters, getSequenceParameter, getXpixParameter, getYpixParameter, getZoneKeyParams, hasDomainMappers, hasZoneSuffixes, testEnv
-
Constructor Details
-
TypedPlot2Task
public TypedPlot2Task(PlotType<P, A> plotType, Map<ConfigKey<String>, Input> axlabelMap, PlotContext<P, A> context) Constructs a plot task with a supplied PlotContext.The
axlabelMap
parameter gives the chance to set up a correspondence between axis label config keys and the coordinates to which they correspond. If this is done, then the names of the data values actually supplied to the task can be used as defaults for the axis labels.- Parameters:
plotType
- fixed plot typeaxlabelMap
- mapping from axis label keys to corresponding common data input coordinates, or nullcontext
- fixed plot context
-
TypedPlot2Task
Constructs a plot task with a default plot context, and without plot ganging. If the plot type has only a single DataGeom no geom selection is allowed, otherwise there is a per-layer geom selection parameter.The
axlabelMap
parameter gives the chance to set up a correspondence between axis label config keys and the coordinates to which they correspond. If this is done, then the names of the data values actually supplied to the task can be used as defaults for the axis labels.- Parameters:
plotType
- fixed plot typeaxlabelMap
- mapping from axis label keys to corresponding common data input coordinates, or null
-
-
Method Details
-
getPlotType
Returns the plot type.- Returns:
- plotType;
-
getPurpose
-
getParameters
public uk.ac.starlink.task.Parameter<?>[] getParameters() -
getPlotContext
Description copied from class:AbstractPlot2Task
Concrete subclasses must implement this method to provide the PlotType and other information from the environment that may not be available at construction time.- Specified by:
getPlotContext
in classAbstractPlot2Task
- Parameters:
env
- execution environment- Returns:
- context
-
getPlotContext
Returns the fixed plot context for this task.- Returns:
- plot context
-
getConfigParamDefault
protected <T> String getConfigParamDefault(uk.ac.starlink.task.Environment env, ConfigKey<T> key, String[] suffixes) throws uk.ac.starlink.task.TaskException Description copied from class:AbstractPlot2Task
May provide a default value for a given config parameter that is sensitive to the content of the execution environment. This is here to provide a hook for subclasses to set up defaults for some config parameters on the basis of what layers are present.- Specified by:
getConfigParamDefault
in classAbstractPlot2Task
- Parameters:
env
- execution environmentkey
- config key for which a parameter is requiredsuffixes
- ordered list of the plot layer suffixes in use for the plot being performed- Returns:
- default for parameter getting value for
key
, or null if none is obvious - Throws:
uk.ac.starlink.task.TaskException
-
createDefaultPlotContext
Returns a default plot context for a given PlotType. If the plot type has only a single DataGeom no geom selection is allowed, otherwise there is a per-layer geom selection parameter.- Parameters:
plotType
- plot type- Returns:
- context
-