Package uk.ac.starlink.ttools.plot2.task
Class PlotContext<P,A>
java.lang.Object
uk.ac.starlink.ttools.plot2.task.PlotContext<P,A>
Aggregates some miscellaneous information required for a plot task
that may not be available until execution time.
- Since:
- 22 Aug 2014
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PlotContext
(PlotType<P, A> plotType, DataGeom[] exampleGeoms) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic <P,
A> PlotContext<P, A> createFixedContext
(PlotType<P, A> plotType, DataGeom geom) Constructs a PlotContext which always uses a fixed given DataGeom.static <P,
A> PlotContext<P, A> createStandardContext
(PlotType<P, A> plotType) Constructs a PlotContext which allows per-layer choice between those known by a given plot type.DataGeom[]
Returns a list of one or more DataGeom objects to be used for example purposes.abstract DataGeom
Returns the DataGeom to use for a given layer in the context of a given execution environment.abstract uk.ac.starlink.task.Parameter<?>[]
getGeomParameters
(String layerSuffix) Returns an array of parameters associated with a particular layer required for determining DataGeom at runtime.Returns the plot type.
-
Constructor Details
-
PlotContext
Constructor. Information that is not dependent on other variables (environment, layer suffix) is specified here.- Parameters:
plotType
- plot typeexampleGeoms
- example data geoms
-
-
Method Details
-
getPlotType
Returns the plot type.- Returns:
- plot type
-
getExampleGeoms
Returns a list of one or more DataGeom objects to be used for example purposes. These may be used to construct parameter auto-documentation, which is needed in absence of an execution environment. The first item in the list is considered most important.- Returns:
- one or more example data geoms
-
getGeomParameters
Returns an array of parameters associated with a particular layer required for determining DataGeom at runtime.- Parameters:
layerSuffix
- parameter suffix string identifying a plot layer- Returns:
- list of zero or more parameters used for determining DataGeom
-
getGeom
public abstract DataGeom getGeom(uk.ac.starlink.task.Environment env, String layerSuffix) throws uk.ac.starlink.task.TaskException Returns the DataGeom to use for a given layer in the context of a given execution environment.- Parameters:
env
- execution environmentlayerSuffix
- parameter suffix string identifying a plot layer- Returns:
- datageom
- Throws:
uk.ac.starlink.task.TaskException
-
createStandardContext
Constructs a PlotContext which allows per-layer choice between those known by a given plot type. The choice is offered (a per-layer parameter is present) even if only a single DataGeom is known by the PlotType. This might conceivably be useful, in that it allows pluggable DataGeoms specified by classname.- Parameters:
plotType
- plot type- Returns:
- standard plot context
-
createFixedContext
Constructs a PlotContext which always uses a fixed given DataGeom. No DataGeom-specific parameters are required or provided.- Parameters:
plotType
- plot typegeom
- data geom used in all cases- Returns:
- fixed-geom plot context
-