Package org.dawb.common.ui.printing
Class PlotExportPrintUtil
java.lang.Object
org.dawb.common.ui.printing.PlotExportPrintUtil
Utility class for exporting any active plotting area as an image file
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyGraph(org.eclipse.swt.graphics.Image image) Copy the graph to the clip board.static voidSave the graph with the given filename.static org.eclipse.core.runtime.IStatussaveSVG(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.
-
Field Details
-
FILE_TYPES
-
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 drawfile- the file to write the SVG DOM tomonitor-- Throws:
ExceptionIOException
-
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 savedfileType- type of the fileprintableFigure- IFigure used to export to svgimage-- Throws:
Exception
-
copyGraph
public static void copyGraph(org.eclipse.swt.graphics.Image image) Copy the graph to the clip board.- Parameters:
image-
-