Package uk.ac.starlink.ttools.build
Class Plot2Example
java.lang.Object
uk.ac.starlink.ttools.build.Plot2Example
Instances of this class represent a given figure plotted using
the plot2 plotting classes and some externally supplied data.
A number of instances are defined, representing examples of
various different aspects of the plotting classes.
The main method provides options for external invocation to
plot the figures to the screen or to external graphics files,
list the required data files, etc.
- Since:
- 1 Mar 2017
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionPlot2Example
(String label, uk.ac.starlink.ttools.build.Plot2Example.Context context, uk.ac.starlink.ttools.build.Plot2Example.PlotTask task, String[] params) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreatePicture
(String[] extraParams) Constructs an object giving this example's plot ready for output.Returns a map from the names of the known examples to their XML invocation text.getLabel()
Returns this example's name.String[]
getLines()
Returns the lines representing the stilts command you would type to execute this example.String[]
Returns the names of table files that must be in place for this example to run.getXml()
Returns XML text representing the stilts command you would type to execute this example.static void
Main method.void
Tests that this example can execute, but does not run the actual plotting code.
-
Constructor Details
-
Plot2Example
public Plot2Example(String label, uk.ac.starlink.ttools.build.Plot2Example.Context context, uk.ac.starlink.ttools.build.Plot2Example.PlotTask task, String[] params) Constructor.- Parameters:
label
- name of examplecontext
- example execution contexttask
- the STILTS task used for the plotparams
- array of [*!]name=value pairs giving parameters; a prepended "*" indicates emphasis; a prepended "!" hides it from user view;value
part may be enclosed in single quotes; a null in the list signifies line break for formatting
-
-
Method Details
-
getLabel
Returns this example's name.- Returns:
- identification string
-
getLines
Returns the lines representing the stilts command you would type to execute this example.- Returns:
- one or more lines of text; intended to be presented in a fixed-width font
-
getXml
Returns XML text representing the stilts command you would type to execute this example.- Returns:
- XML text wrapped in a <verbati> element
-
createPicture
public Picture createPicture(String[] extraParams) throws IOException, uk.ac.starlink.task.TaskException, InterruptedException, uk.ac.starlink.util.LoadException Constructs an object giving this example's plot ready for output.- Parameters:
extraParams
- additional name=value strings to apply when doing the plot- Returns:
- picture
- Throws:
IOException
uk.ac.starlink.task.TaskException
InterruptedException
uk.ac.starlink.util.LoadException
-
testParams
Tests that this example can execute, but does not run the actual plotting code. Required external data files must be in place.- Throws:
Exception
-
getRequiredTableNames
Returns the names of table files that must be in place for this example to run.- Returns:
- array of required table names
-
getExamplesXml
Returns a map from the names of the known examples to their XML invocation text.- Returns:
- label->verbatim command elements
-
main
Main method. This is intended for invocation from the stilts/topcat build systems.Use the
-help
flag for usage information.- Throws:
Exception
-