Class SVGExporter

java.lang.Object
jspecview.export.SVGExporter
All Implemented Interfaces:
JSVExporter

public class SVGExporter extends Object
class SVGExporter contains static methods to export a Graph as as SVG. Uses a template file called 'plot.vm'. So any changes in design should be done in this file. Modified 6 Oct 2010 added lastX for Inkscape SVG export so baseline could be printed 2021.05.08 Bob Hanson fixes SVG export for HTML5
Author:
Debbie-Ann Facey, Khari A. Bryan, Craig A.D. Walters, Prof Robert J. Lancashire
  • Field Details

    • out

      protected OC out
    • vwr

      protected JSViewer vwr
  • Constructor Details

    • SVGExporter

      public SVGExporter()
  • Method Details

    • exportTheSpectrum

      public String exportTheSpectrum(JSViewer viewer, ExportType mode, OC out, Spectrum spec, int startIndex, int endIndex, PanelData pd, boolean asBase64) throws IOException
      Export a Graph as SVG to a file given by fileName
      Parameters:
      out - the file path
      spec - the Graph
      startIndex -
      endIndex -
      mode - TODO
      pd - only for SVG/SVGI
      asBase64 - TODO
      Returns:
      data if fileName is null
      Throws:
      IOException
    • initForm

      protected void initForm(JSViewer viewer, OC out)
    • writeForm

      protected String writeForm(String templateFile) throws IOException
      Throws:
      IOException