Class PlotExportUtil

java.lang.Object
org.dawnsci.plotting.jreality.print.PlotExportUtil

public class PlotExportUtil extends Object
Utility class for exporting any active plotting area either as Image file or hardcopy on a printer device
  • Field Summary

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    copyGraph(de.jreality.ui.viewerapp.AbstractViewerApp viewerApp)
    Copy the graph to the Clipboard.
    static org.eclipse.swt.graphics.Image
    createImage(de.jreality.ui.viewerapp.AbstractViewerApp viewerApp, org.eclipse.swt.widgets.Display display, Plot1DGraphTable legendTable, org.eclipse.swt.printing.PrinterData printerData, int resolutionMultiplier)
     
    static void
    printGraph(org.eclipse.swt.printing.PrinterData printerData, de.jreality.ui.viewerapp.AbstractViewerApp viewerApp, org.eclipse.swt.widgets.Display display, Plot1DGraphTable legendTable, float scaling)
    Print the graph to a printer.
    static void
    saveGraph(String filename, String fileType, de.jreality.ui.viewerapp.AbstractViewerApp viewerApp)
    Save the graph with the given filename.

    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
  • Constructor Details

    • PlotExportUtil

      public PlotExportUtil()
  • Method Details

    • saveGraph

      public static void saveGraph(String filename, String fileType, de.jreality.ui.viewerapp.AbstractViewerApp viewerApp) 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
      viewerApp - ViewerApp containing the current display
      Throws:
      FileNotFoundException
      Exception
    • copyGraph

      public static void copyGraph(de.jreality.ui.viewerapp.AbstractViewerApp viewerApp) throws IOException
      Copy the graph to the Clipboard.
      Parameters:
      viewerApp - ViewerApp containing the current display
      Throws:
      IOException
    • printGraph

      public static void printGraph(org.eclipse.swt.printing.PrinterData printerData, de.jreality.ui.viewerapp.AbstractViewerApp viewerApp, org.eclipse.swt.widgets.Display display, Plot1DGraphTable legendTable, float scaling)
      Print the graph to a printer. This will temporary create an image with 4 times super sampling for good quality and then sends the image to the printer, afterwards deleting the image again
      Parameters:
      printerData - SWT specific printer object
      viewerApp - ViewerApp containing the current display
      display - SWT display // * @param scaling factor
    • createImage

      public static org.eclipse.swt.graphics.Image createImage(de.jreality.ui.viewerapp.AbstractViewerApp viewerApp, org.eclipse.swt.widgets.Display display, Plot1DGraphTable legendTable, org.eclipse.swt.printing.PrinterData printerData, int resolutionMultiplier)