org.annotation.wordfreak.io
Interface FileFormat

All Superinterfaces:
Plugin
All Known Subinterfaces:
AnnotatedFileFormat, SourceFileFormat
All Known Implementing Classes:
AbstractAnnotatedFileFormat, TextFileFormat

public interface FileFormat
extends Plugin

This defines the interface for implementing new file formats.


Method Summary
 void addProgressListener(ProgressListener pl)
           
 java.lang.String getExtension()
          Returns the default file extension for files in this format.
 javax.swing.filechooser.FileFilter getFileFilter()
          Returns the file filter for this file format.
 java.lang.String getFormatName()
          Returns the name of the file format.
 javax.swing.Icon getIcon(boolean gold, boolean loaded, boolean loading)
          Returns an icon to be displayed with files of this type.
 boolean handlesFile(java.lang.String af)
          Returns true if this can open the file specified by af.
 void removeProgressListener(ProgressListener pl)
           
 void write(AnnotationFile af, java.io.Writer out)
          Writes the contents of the AnnotationFile to the Writer specified by out.
 

Method Detail

write

public void write(AnnotationFile af,
                  java.io.Writer out)
           throws java.io.IOException
Writes the contents of the AnnotationFile to the Writer specified by out. This method should not close the Writer.

Parameters:
af - the annotation file.
out - the Writer to which the file should be written.
Throws:
java.io.IOException

getFileFilter

public javax.swing.filechooser.FileFilter getFileFilter()
Returns the file filter for this file format.

Returns:
the file filter for this file format.

getFormatName

public java.lang.String getFormatName()
Returns the name of the file format.

Returns:
the name of the file format.

getExtension

public java.lang.String getExtension()
Returns the default file extension for files in this format. The extension should not include the period.

Returns:
The file extension for in this format.

handlesFile

public boolean handlesFile(java.lang.String af)
Returns true if this can open the file specified by af.

Returns:
true if this can open the file specified by af, false otherwise.

getIcon

public javax.swing.Icon getIcon(boolean gold,
                                boolean loaded,
                                boolean loading)
Returns an icon to be displayed with files of this type.

Parameters:
gold - true if this is a gold file.
loaded - true if this file has been loaded.
loading - true if this file is loading.
Returns:
the icon to be display with files of this type.

addProgressListener

public void addProgressListener(ProgressListener pl)

removeProgressListener

public void removeProgressListener(ProgressListener pl)


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.