# Class GenericPlot2Task

java.lang.Object
uk.ac.starlink.ttools.plot2.task.AbstractPlot2Task
uk.ac.starlink.ttools.plot2.task.GenericPlot2Task

All Implemented Interfaces:
  `uk.ac.starlink.task.Task, DynamicTask`

public class GenericPlot2Task extends AbstractPlot2Task
Generic plot2 task for STILTS. The plot type is determined from the environment using a Parameter. The resulting task is very flexible, but the details of the parameters that will actually be used cannot be determined in absence of the plot type (that is, before the Environment is available), so the task is not very good at describing its required parameters.

Since:
  22 Aug 2014
Author:
  Mark Taylor

## Field Summary

### Fields inherited from class AbstractPlot2Task

`DOC_ZONE_SUFFIX, DOMAINMAPPER_SUFFIX, EXAMPLE_LAYER_SUFFIX, EXAMPLE_ZONE_SUFFIX, LAYER_PREFIX, ZONE_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`GenericPlot2Task(boolean allowAnimate, boolean hasZoneSuffixes)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`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<?>[]`
`getParameters()`
`PlotContext<?,?>`
`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.
`String`
`getPurpose()`

### Methods inherited from class 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`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### GenericPlot2Task

public GenericPlot2Task(boolean allowAnimate, boolean hasZoneSuffixes)
Constructor.

Parameters:
  `allowAnimate` - true iff animation options should be provided
  `hasZoneSuffixes` - true iff zone content can be controlled explicitly by use of parameter suffixes

## Method Details

### getPurpose

public String getPurpose()

### getParameters

public uk.ac.starlink.task.Parameter<?>[] getParameters()

### getPlotContext

public PlotContext<?,?> getPlotContext(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException
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 class `AbstractPlot2Task`
Parameters:
  `env` - execution environment
Returns:
  context
Throws:
  `uk.ac.starlink.task.TaskException`

### getConfigParamDefault

protected <T> String getConfigParamDefault(uk.ac.starlink.task.Environment env, ConfigKey<T> key, String[] suffixes)
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 class `AbstractPlot2Task`
Parameters:
  `env` - execution environment
  `key` - config key for which a parameter is required
  `suffixes` - 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