Package uk.ac.starlink.topcat.plot2
Class PlotExporter
- java.lang.Object
-
- uk.ac.starlink.topcat.plot2.PlotExporter
-
public class PlotExporter extends java.lang.ObjectProvides a GUI for exporting a plot to an external format, generally to a file.- Since:
- 12 Mar 2013
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePlotExporter.IconFactoryDefines an object that can supply an icon for exporting.
-
Constructor Summary
Constructors Constructor Description PlotExporter()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattemptSave(javax.swing.Icon icon, java.io.File file, uk.ac.starlink.ttools.plot.GraphicExporter exporter)Attempts to write a given icon to a file in a particular graphics format.voidexportPlot(java.awt.Component parent, PlotExporter.IconFactory ifact)Offers the user a GUI to export a supplied plot icon in a user-chosen format.static PlotExportergetInstance()Returns a single instance of this class.
-
-
-
Method Detail
-
exportPlot
public void exportPlot(java.awt.Component parent, PlotExporter.IconFactory ifact)Offers the user a GUI to export a supplied plot icon in a user-chosen format.- Parameters:
parent- parent component for dialogue windowifact- supplies the icon to export
-
attemptSave
public void attemptSave(javax.swing.Icon icon, java.io.File file, uk.ac.starlink.ttools.plot.GraphicExporter exporter) throws java.io.IOExceptionAttempts to write a given icon to a file in a particular graphics format.- Parameters:
icon- image to paintfile- destination fileexporter- output graphics format handler- Throws:
java.io.IOException- in case of write error
-
getInstance
public static PlotExporter getInstance()
Returns a single instance of this class. You don't have to use it as a singleton, but doing it like that allows it to retain current directory for output file etc.- Returns:
- shared instance
-
-