Package uk.ac.starlink.ttools.plot2.task
Class StiltsPlot
java.lang.Object
uk.ac.starlink.ttools.plot2.task.StiltsPlot
Represents an abstract model of a STILTS command line.
A list of parameter-value pairs along with basic parameter
grouping information is reprented.
There is no guarantee that the contents of this object
will correspond to a STILTS command that can actually be executed,
so care must be taken in assembling it.
Use a StiltsPlotFormatter
instance to export this object into a
useful external form, such as a shell command line.
- Since:
- 15 Sep 2017
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionStiltsPlot
(AbstractPlot2Task task, String taskName, SettingGroup[] groups) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic <P,
A> StiltsPlot createPlot
(PlotSpec<P, A> plotSpec, StiltsPlotFormatter formatter) Turns a PlotSpec into an abstract model of a STILTS command line to regenerate the same plot.Returns an array of objects that together contain all the parameter settings required to specify this task to stilts.getTask()
Returns the plot task corresponding to this object.Returns the name of this object's plot task, as used by the stilts command line.
-
Constructor Details
-
StiltsPlot
Constructor.- Parameters:
task
- plot tasktaskName
- name of the plot task as used by stilts command linegroups
- all name-value pairs specifying the configuration of the task, grouped for cosmetic purposes
-
-
Method Details
-
getTask
Returns the plot task corresponding to this object.- Returns:
- plot task object
-
getTaskName
Returns the name of this object's plot task, as used by the stilts command line.- Returns:
- task name
-
getGroups
Returns an array of objects that together contain all the parameter settings required to specify this task to stilts. They are grouped for cosmetic purposes.- Returns:
- settings
-
createPlot
public static <P,A> StiltsPlot createPlot(PlotSpec<P, A> plotSpec, StiltsPlotFormatter formatter) throws uk.ac.starlink.util.LoadExceptionTurns a PlotSpec into an abstract model of a STILTS command line to regenerate the same plot. Various methods are provided to export this in a way that can be presented to the user or executed.This is the method that does the work of mapping the internal plot representation to a STILTS command line. It has to understand how the AbstractPlot2Task parameters are specified, which is a complicated job. So (1) the output is not bulletproof, and may get broken by implementation or interface changes elsewhere in the code base, and therefore (2) lots of tests are a good idea. It works on a best efforts basis.
- Parameters:
plotSpec
- programmatic representation of a plotformatter
- defines details of how formatting will take place- Throws:
uk.ac.starlink.util.LoadException
-