Package uk.ac.starlink.ttools.build
Class PlotExample
- java.lang.Object
-
- uk.ac.starlink.ttools.build.PlotExample
-
public class PlotExample extends java.lang.Object
Programmatically generates example text and images for STILTS plotting tasks. Used in generating the documentation.- Since:
- 9 Oct 2008
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description PlotExample(java.lang.String name, java.lang.String taskName, java.lang.String[] params, java.lang.String[] comments)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PlotExample[]
createPlot2dExamples()
Returns a list of examples for the plot2d task.static PlotExample[]
createPlot3dExamples()
Returns a list of examples for the plot3d task.static PlotExample[]
createPlotHistExamples()
Returns a list of examples for the plothist task.static void
main(java.lang.String[] args)
Writes example files ready for incorporation into documentation.java.lang.String
writeImage()
Generates and outputs the image file showing the result of this example.void
writeXml(java.io.PrintStream out)
Outputs the XML for this example as a <dt><dd> element pair.
-
-
-
Constructor Detail
-
PlotExample
public PlotExample(java.lang.String name, java.lang.String taskName, java.lang.String[] params, java.lang.String[] comments) throws uk.ac.starlink.task.TaskException, uk.ac.starlink.util.LoadException
Constructor.- Parameters:
name
- example nametaskName
- name of the STILTS task being usedparams
- array of name=value pairs giving parameters; a null in the list signifies line break for formattingcomments
- array of lines consituting the example description; concatenated must form one or more XML <p> elements- Throws:
uk.ac.starlink.task.TaskException
uk.ac.starlink.util.LoadException
-
-
Method Detail
-
writeXml
public void writeXml(java.io.PrintStream out) throws java.io.IOException
Outputs the XML for this example as a <dt><dd> element pair.- Parameters:
out
- destination stream- Throws:
java.io.IOException
-
writeImage
public java.lang.String writeImage() throws java.io.IOException, uk.ac.starlink.task.TaskException
Generates and outputs the image file showing the result of this example.- Returns:
- name of the written file in the current directory
- Throws:
java.io.IOException
uk.ac.starlink.task.TaskException
-
createPlot2dExamples
public static PlotExample[] createPlot2dExamples() throws uk.ac.starlink.task.TaskException, uk.ac.starlink.util.LoadException
Returns a list of examples for the plot2d task.- Returns:
- example array
- Throws:
uk.ac.starlink.task.TaskException
uk.ac.starlink.util.LoadException
-
createPlot3dExamples
public static PlotExample[] createPlot3dExamples() throws uk.ac.starlink.task.TaskException, uk.ac.starlink.util.LoadException
Returns a list of examples for the plot3d task.- Returns:
- example array
- Throws:
uk.ac.starlink.task.TaskException
uk.ac.starlink.util.LoadException
-
createPlotHistExamples
public static PlotExample[] createPlotHistExamples() throws uk.ac.starlink.task.TaskException, uk.ac.starlink.util.LoadException
Returns a list of examples for the plothist task.- Returns:
- example array
- Throws:
uk.ac.starlink.task.TaskException
uk.ac.starlink.util.LoadException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
Writes example files ready for incorporation into documentation.- Throws:
java.lang.Exception
-
-