uk.ac.starlink.ttools.build
Class PlotExample

java.lang.Object
  extended by uk.ac.starlink.ttools.build.PlotExample

public class PlotExample
extends 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
PlotExample(String name, String taskName, String[] params, String[] comments)
          Constructor.
 
Method Summary
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(String[] args)
          Writes example files ready for incorporation into documentation.
 String writeImage()
          Generates and outputs the image file showing the result of this example.
 void writeXml(PrintStream out)
          Outputs the XML for this example as a <dt><dd> element pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotExample

public PlotExample(String name,
                   String taskName,
                   String[] params,
                   String[] comments)
            throws TaskException,
                   LoadException
Constructor.

Parameters:
name - example name
taskName - name of the STILTS task being used
params - array of name=value pairs giving parameters; a null in the list signifies line break for formatting
comments - array of lines consituting the example description; concatenated must form one or more XML <p> elements
Throws:
TaskException
LoadException
Method Detail

writeXml

public void writeXml(PrintStream out)
              throws IOException
Outputs the XML for this example as a <dt><dd> element pair.

Parameters:
out - destination stream
Throws:
IOException

writeImage

public String writeImage()
                  throws IOException,
                         TaskException
Generates and outputs the image file showing the result of this example.

Returns:
name of the written file in the current directory
Throws:
IOException
TaskException

createPlot2dExamples

public static PlotExample[] createPlot2dExamples()
                                          throws TaskException,
                                                 LoadException
Returns a list of examples for the plot2d task.

Returns:
example array
Throws:
TaskException
LoadException

createPlot3dExamples

public static PlotExample[] createPlot3dExamples()
                                          throws TaskException,
                                                 LoadException
Returns a list of examples for the plot3d task.

Returns:
example array
Throws:
TaskException
LoadException

createPlotHistExamples

public static PlotExample[] createPlotHistExamples()
                                            throws TaskException,
                                                   LoadException
Returns a list of examples for the plothist task.

Returns:
example array
Throws:
TaskException
LoadException

main

public static void main(String[] args)
                 throws Exception
Writes example files ready for incorporation into documentation.

Throws:
Exception


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.