Class PlotExportPrintUtil

java.lang.Object
org.dawb.common.ui.printing.PlotExportPrintUtil

public class PlotExportPrintUtil extends Object
Utility class for exporting any active plotting area as an image file
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String[]
     
    static final String[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    copyGraph(org.eclipse.swt.graphics.Image image)
    Copy the graph to the clip board.
    static void
    saveGraph(String filename, String fileType, org.eclipse.draw2d.IFigure printableFigure)
    Save the graph with the given filename.
    static org.eclipse.core.runtime.IStatus
    saveSVG(org.eclipse.draw2d.IFigure root, File file, org.eclipse.core.runtime.IProgressMonitor monitor)
    Save a Draw2D figure as Scalable Vector Graphics to an output stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FILE_TYPES

      public static final String[] FILE_TYPES
    • FILE_FORMATS

      public static final String[] FILE_FORMATS
  • Constructor Details

    • PlotExportPrintUtil

      public PlotExportPrintUtil()
  • Method Details

    • saveSVG

      public static org.eclipse.core.runtime.IStatus saveSVG(org.eclipse.draw2d.IFigure root, File file, org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException
      Save a Draw2D figure as Scalable Vector Graphics to an output stream. Should be run in a UI thread
      Parameters:
      root - the figure to draw
      file - the file to write the SVG DOM to
      monitor -
      Throws:
      Exception
      IOException
    • saveGraph

      public static void saveGraph(String filename, String fileType, org.eclipse.draw2d.IFigure printableFigure) throws Exception
      Save the graph with the given filename. If the file name ends with a known extension, this is used as the file type otherwise it is the string passed in which is read from the save as dialog form normally.
      Parameters:
      filename - the name under which the graph should be saved
      fileType - type of the file
      printableFigure - IFigure used to export to svg
      image -
      Throws:
      Exception
    • copyGraph

      public static void copyGraph(org.eclipse.swt.graphics.Image image)
      Copy the graph to the clip board.
      Parameters:
      image -