Class Plot2Example


  • public class Plot2Example
    extends java.lang.Object
    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

      Constructors 
      Constructor Description
      Plot2Example​(java.lang.String label, uk.ac.starlink.ttools.build.Plot2Example.Context context, uk.ac.starlink.ttools.build.Plot2Example.PlotTask task, java.lang.String[] params)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Picture createPicture​(java.lang.String[] extraParams)
      Constructs an object giving this example's plot ready for output.
      static java.util.Map<java.lang.String,​java.lang.String> getExamplesXml()
      Returns a map from the names of the known examples to their XML invocation text.
      java.lang.String getLabel()
      Returns this example's name.
      java.lang.String[] getLines()
      Returns the lines representing the stilts command you would type to execute this example.
      java.lang.String[] getRequiredTableNames()
      Returns the names of table files that must be in place for this example to run.
      java.lang.String getXml()
      Returns XML text representing the stilts command you would type to execute this example.
      static void main​(java.lang.String[] args)
      Main method.
      void testParams()
      Tests that this example can execute, but does not run the actual plotting code.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Plot2Example

        public Plot2Example​(java.lang.String label,
                            uk.ac.starlink.ttools.build.Plot2Example.Context context,
                            uk.ac.starlink.ttools.build.Plot2Example.PlotTask task,
                            java.lang.String[] params)
        Constructor.
        Parameters:
        label - name of example
        context - example execution context
        task - the STILTS task used for the plot
        params - 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 Detail

      • getLabel

        public java.lang.String getLabel()
        Returns this example's name.
        Returns:
        identification string
      • getLines

        public java.lang.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

        public java.lang.String 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​(java.lang.String[] extraParams)
                              throws java.io.IOException,
                                     uk.ac.starlink.task.TaskException,
                                     java.lang.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:
        java.io.IOException
        uk.ac.starlink.task.TaskException
        java.lang.InterruptedException
        uk.ac.starlink.util.LoadException
      • testParams

        public void testParams()
                        throws java.lang.Exception
        Tests that this example can execute, but does not run the actual plotting code. Required external data files must be in place.
        Throws:
        java.lang.Exception
      • getRequiredTableNames

        public java.lang.String[] getRequiredTableNames()
        Returns the names of table files that must be in place for this example to run.
        Returns:
        array of required table names
      • getExamplesXml

        public static java.util.Map<java.lang.String,​java.lang.String> getExamplesXml()
        Returns a map from the names of the known examples to their XML invocation text.
        Returns:
        label->verbatim command elements
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Main method. This is intended for invocation from the stilts/topcat build systems.

        Use the -help flag for usage information.

        Throws:
        java.lang.Exception