anl.aida.client.io
Class ImageExporter

java.lang.Object
  extended by anl.aida.client.io.ImageExporter

public class ImageExporter
extends java.lang.Object

Exports buffered images to a file.


Nested Class Summary
private  class ImageExporter.ImageFileFilter
           
 
Field Summary
static java.lang.String BMP
           
private  java.lang.String currentExt
           
private  Imageable imageable
           
static java.lang.String JPEG
           
static java.lang.String JPG
           
static java.lang.String PNG
           
static java.lang.String TIF
           
static java.lang.String TIFF
           
 
Constructor Summary
ImageExporter(Imageable imageable)
           
 
Method Summary
private  java.lang.String findExtension(java.io.File f)
           
 void run(java.awt.Component parent)
          Run the exporter.
private  void save(java.io.File file)
           
 void save(java.lang.String format, java.io.File file)
          Saves an image of the plot in the specified format to the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JPEG

public static final java.lang.String JPEG
See Also:
Constant Field Values

JPG

public static final java.lang.String JPG
See Also:
Constant Field Values

TIFF

public static final java.lang.String TIFF
See Also:
Constant Field Values

TIF

public static final java.lang.String TIF
See Also:
Constant Field Values

PNG

public static final java.lang.String PNG
See Also:
Constant Field Values

BMP

public static final java.lang.String BMP
See Also:
Constant Field Values

currentExt

private java.lang.String currentExt

imageable

private Imageable imageable
Constructor Detail

ImageExporter

public ImageExporter(Imageable imageable)
Method Detail

run

public void run(java.awt.Component parent)
         throws java.io.IOException
Run the exporter. This will show a file chooser with the current export formats as a file filters and save a snapshot of the plot to those files.

Throws:
java.io.IOException - if there is an error while creating the image or saving the plot.

save

public void save(java.lang.String format,
                 java.io.File file)
          throws java.io.IOException
Saves an image of the plot in the specified format to the specified file.

Parameters:
format - the format of the image file. One of PlotExporter.JPG, PlotExporter.TIF, PlotExporter.PNG, or PlotExporter.BMP
file - the file to save the image to
Throws:
java.io.IOException - if there is an error while saving the image

save

private void save(java.io.File file)
           throws java.io.IOException
Throws:
java.io.IOException

findExtension

private java.lang.String findExtension(java.io.File f)