Class PlotExporter

java.lang.Object
uk.ac.starlink.topcat.plot2.PlotExporter

public class PlotExporter extends Object
Provides a GUI for exporting a plot to an external format, generally to a file.
Since:
12 Mar 2013
Author:
Mark Taylor
  • Constructor Details

    • PlotExporter

      public PlotExporter()
      Constructor.
  • Method Details

    • exportPlot

      public void exportPlot(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 window
      ifact - 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 paint
      file - destination file
      exporter - output graphics format handler
      Throws:
      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