Package uk.ac.starlink.topcat.plot2
Class PlotExporter
java.lang.Object
uk.ac.starlink.topcat.plot2.PlotExporter
Provides 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 ClassesModifier and TypeClassDescriptionstatic interface
Defines an object that can supply an icon for exporting. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
attemptSave
(Icon icon, File file, uk.ac.starlink.ttools.plot.GraphicExporter exporter) Attempts to write a given icon to a file in a particular graphics format.void
exportPlot
(Component parent, PlotExporter.IconFactory ifact) Offers the user a GUI to export a supplied plot icon in a user-chosen format.static PlotExporter
Returns a single instance of this class.
-
Constructor Details
-
PlotExporter
public PlotExporter()Constructor.
-
-
Method Details
-
exportPlot
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(Icon icon, File file, uk.ac.starlink.ttools.plot.GraphicExporter exporter) throws IOException Attempts 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:
IOException
- in case of write error
-
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
-