Class HTMLWriter

  • All Implemented Interfaces:
    java.io.Serializable, Component, Processor
    Direct Known Subclasses:
    RGBWriter

    public class HTMLWriter
    extends java.lang.Object
    implements Processor
    This class writes the HTML output for SkyView web services
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      HTMLWriter()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      A description for the compontent.
      java.lang.String getName()
      A name for the component
      protected void printoutTemplate​(java.lang.String fileSetting)
      Fill out the appropriate file template by reading the template and substituting in any variables with the current settings.
      void process​(Image[] inputs, Image output, int[] sources, Sampler samp, DepthSampler dpSamp)
      Process the image.
      protected void setSettings()
      This method writes out the settings so that JavaScript can use them.
      static java.lang.String slurp​(java.lang.String file)
      Read a file into a big string.
      void updateHeader​(nom.tam.fits.Header hdr)
      Update the FITS header.
      protected void updateSettings​(Image output, Sampler samp)
      Update the settings before creating the appropriate HTML.
      void writeFooter()
      Write the footer for the HTML plage
      void writeHeader()
      Write the header for the HTML page
      • Methods inherited from class java.lang.Object

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

      • HTMLWriter

        public HTMLWriter()
    • Method Detail

      • process

        public void process​(Image[] inputs,
                            Image output,
                            int[] sources,
                            Sampler samp,
                            DepthSampler dpSamp)
        Process the image. This should happen late.
        Specified by:
        process in interface Processor
        Parameters:
        inputs - The input images.
        output - The output image
        sources - Usually a map giving the input image used for each output pixel
        samp - The sampler used to create the output
        dpSamp - For 3-d images the sampler in the energy axis.
      • updateHeader

        public void updateHeader​(nom.tam.fits.Header hdr)
        Update the FITS header. This processor does not modify the FITS file.
        Specified by:
        updateHeader in interface Processor
        Parameters:
        hdr - The header to be modified.
      • setSettings

        protected void setSettings()
        This method writes out the settings so that JavaScript can use them.
      • getName

        public java.lang.String getName()
        A name for the component
        Specified by:
        getName in interface Component
      • getDescription

        public java.lang.String getDescription()
        A description for the compontent.
        Specified by:
        getDescription in interface Component
      • writeHeader

        public void writeHeader()
        Write the header for the HTML page
      • writeFooter

        public void writeFooter()
        Write the footer for the HTML plage
      • printoutTemplate

        protected void printoutTemplate​(java.lang.String fileSetting)
        Fill out the appropriate file template by reading the template and substituting in any variables with the current settings.
        Parameters:
        fileSetting - The file template to be used.
      • slurp

        public static java.lang.String slurp​(java.lang.String file)
        Read a file into a big string.
        Parameters:
        file - The file to be read
        Returns:
      • updateSettings

        protected void updateSettings​(Image output,
                                      Sampler samp)
        Update the settings before creating the appropriate HTML.
        Parameters:
        output - The output image
        samp - The sampler used to create the output image.