FreeHEP API
Version v1.1

org.freehep.graphicsio.exportchooser
Class ExportGraphicsFileTypeAdapter

java.lang.Object
  |
  +--org.freehep.graphicsio.exportchooser.ExportGraphicsFileTypeAdapter
All Implemented Interfaces:
ExportFileType, ExportGraphicsFileType
Direct Known Subclasses:
AbstractExportFileType, CGMExportFileType, EMFExportFileType, EPSIExportFileType, GIFExportFileType, PDFExportFileType, PNGExportFileType, PPMExportFileType, SVGExportFileType, SWFExportFileType

public abstract class ExportGraphicsFileTypeAdapter
extends Object
implements ExportGraphicsFileType

Version:
$Id: ExportGraphicsFileTypeAdapter.java,v 1.3 2002/08/21 16:52:05 duns Exp $
Author:
Charles Loomis

Nested Class Summary
 class ExportGraphicsFileTypeAdapter.CancelThread
           
 
Field Summary
protected  String creator
           
 
Constructor Summary
ExportGraphicsFileTypeAdapter()
           
 
Method Summary
static File adjustExtension(File file, String preferredExtension, String[] acceptableExtensions)
          Change the extension of a file if it is not of the appropriate type.
 File adjustFilename(File file)
          The default implementation of this method does nothing to change the file name.
static boolean checkExtension(File file, String[] acceptableExtensions)
          A utility function that checks a file's extension.
 void done()
          The default implementation does nothing.
 void exportToFile(File file, Component[] saveTargets, Component parent)
          Save all components as the given file type.
 void exportToFile(File file, Component saveTarget, Component parent)
          Show this dialog and save component as the given file type.
 void exportToFile(OutputStream os, Component[] saveTargets, Component parent)
          Save all components as the given file type.
 void exportToFile(OutputStream os, Component saveTarget, Component parent)
          Show this dialog and save component as the given file type.
 boolean fileHasValidExtension(File file)
          The default implementation of this method just returns false.
 Graphics getConfiguredGraphics(File file, Component printTarget)
          Returns a null Graphics object.
 FileFilter getFileFilter()
          The default implementation of this method does nothing.
 JPanel getOptionsPanel()
          The default implementation of this method returns null.
 int getThumbnailSize()
          Default = -1.
 boolean isMultipageCapable()
          Default = false.
 void restoreOptions(Properties props)
          Call this method to restore options from a Properties object.
 void saveOptions(Properties props)
          Call this method to store options in a Properties object.
 void setCreator(String creator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.freehep.graphicsio.exportchooser.ExportGraphicsFileType
getConfiguredGraphics
 

Field Detail

creator

protected String creator
Constructor Detail

ExportGraphicsFileTypeAdapter

public ExportGraphicsFileTypeAdapter()
Method Detail

setCreator

public void setCreator(String creator)
Specified by:
setCreator in interface ExportFileType

getFileFilter

public FileFilter getFileFilter()
The default implementation of this method does nothing.

Specified by:
getFileFilter in interface ExportFileType

getOptionsPanel

public JPanel getOptionsPanel()
The default implementation of this method returns null.

Specified by:
getOptionsPanel in interface ExportFileType

getConfiguredGraphics

public Graphics getConfiguredGraphics(File file,
                                      Component printTarget)
                               throws IOException
Returns a null Graphics object.

Specified by:
getConfiguredGraphics in interface ExportGraphicsFileType
IOException

done

public void done()
          throws IOException
The default implementation does nothing.

Specified by:
done in interface ExportGraphicsFileType
IOException

exportToFile

public void exportToFile(OutputStream os,
                         Component saveTarget,
                         Component parent)
                  throws IOException
Show this dialog and save component as the given file type.

Specified by:
exportToFile in interface ExportFileType
IOException

exportToFile

public void exportToFile(File file,
                         Component saveTarget,
                         Component parent)
                  throws IOException
Show this dialog and save component as the given file type.

Specified by:
exportToFile in interface ExportFileType
IOException

exportToFile

public void exportToFile(OutputStream os,
                         Component[] saveTargets,
                         Component parent)
                  throws IOException
Save all components as the given file type. If getConfiguredGraphics(OutputStream, Component[]) does not return a MultiPageDocument (or null) saveTargets.length numbered documents are created each of which contains a single page.

Specified by:
exportToFile in interface ExportFileType
IOException

exportToFile

public void exportToFile(File file,
                         Component[] saveTargets,
                         Component parent)
                  throws IOException
Save all components as the given file type. If getConfiguredGraphics(File, Component[]) does not return a MultiPageDocument (or null) saveTargets.length numbered documents are created each of which contains a single page.

Specified by:
exportToFile in interface ExportFileType
IOException

adjustFilename

public File adjustFilename(File file)
The default implementation of this method does nothing to change the file name.

Specified by:
adjustFilename in interface ExportFileType

fileHasValidExtension

public boolean fileHasValidExtension(File file)
The default implementation of this method just returns false.

Specified by:
fileHasValidExtension in interface ExportFileType

checkExtension

public static boolean checkExtension(File file,
                                     String[] acceptableExtensions)
A utility function that checks a file's extension.


adjustExtension

public static File adjustExtension(File file,
                                   String preferredExtension,
                                   String[] acceptableExtensions)
Change the extension of a file if it is not of the appropriate type.


saveOptions

public void saveOptions(Properties props)
Description copied from interface: ExportFileType
Call this method to store options in a Properties object. It is up to the particular implementation which options (if any) are stored. The intention is to provide a way to save users' preferences.

Specified by:
saveOptions in interface ExportFileType

restoreOptions

public void restoreOptions(Properties props)
Description copied from interface: ExportFileType
Call this method to restore options from a Properties object. It is up to the particular implementation which options (if any) are read. The intention is to provide a way to restore users' preferences.

Specified by:
restoreOptions in interface ExportFileType

isMultipageCapable

public boolean isMultipageCapable()
Default = false.

Specified by:
isMultipageCapable in interface ExportGraphicsFileType

getThumbnailSize

public int getThumbnailSize()
Default = -1.

Specified by:
getThumbnailSize in interface ExportGraphicsFileType

FreeHEP API
Version v1.1

Copyright © 2000-2002 FreeHEP, All Rights Reserved.