org.annotation.wordfreak.io
Class TextColumnsFileFormat

java.lang.Object
  extended byorg.annotation.wordfreak.io.AbstractAnnotatedFileFormat
      extended byorg.annotation.wordfreak.io.TextColumnsFileFormat
All Implemented Interfaces:
AnnotatedFileFormat, FileFormat, Plugin

public class TextColumnsFileFormat
extends AbstractAnnotatedFileFormat

Implements the native TextColumns file format.


Field Summary
static java.lang.String EXTENSION
           
 
Fields inherited from class org.annotation.wordfreak.io.AbstractAnnotatedFileFormat
DOCUMENT, GOLD, iconPaths, icons, LOADED, LOADED_GOLD, LOADING
 
Constructor Summary
TextColumnsFileFormat()
           
 
Method Summary
 void addProgressListener(ProgressListener pl)
           
 java.io.File getAnnotatedFile(java.lang.String sourceFileName)
          Computes the expected annotation file name for this format from the specified source file name.
 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.
static AnnotatedFileFormat getInstance()
           
 void getSettings()
          Used to prompt user for file format settings.
 java.io.File getSourceFile(java.lang.String annotatedFileName)
          Computes the expected source file name for this format from the specified annotated file name.
 SourceFileFormat getSourceFileFormat()
          Returns the file format for the source used with this annotation file format.
 boolean handlesFile(java.lang.String af)
          Returns true if this can open the file specified by af.
 AnnotationFile read(java.lang.String source, java.lang.String ann, java.lang.String encoding)
          Reads an annotated file specified by ann and returns an AnnotationFile object representing its contents.
 void removeProgressListener(ProgressListener pl)
           
 void write(AnnotationFile af, java.io.Writer out)
          Writes the contents of the AnnotationFile to the Writer specified by out.
 
Methods inherited from class org.annotation.wordfreak.io.AbstractAnnotatedFileFormat
getIcon, getNextChunk, getPrevChunk, hasNextChunk, hasPrevChunk, initIcons, setIconPaths
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENSION

public static final java.lang.String EXTENSION
See Also:
Constant Field Values
Constructor Detail

TextColumnsFileFormat

public TextColumnsFileFormat()
Method Detail

getInstance

public static AnnotatedFileFormat getInstance()

getSettings

public void getSettings()
Description copied from interface: AnnotatedFileFormat
Used to prompt user for file format settings.

Specified by:
getSettings in interface AnnotatedFileFormat
Overrides:
getSettings in class AbstractAnnotatedFileFormat

read

public AnnotationFile read(java.lang.String source,
                           java.lang.String ann,
                           java.lang.String encoding)
Description copied from interface: AnnotatedFileFormat
Reads an annotated file specified by ann and returns an AnnotationFile object representing its contents.

Parameters:
source - the source file for the annotated file. This parameter may not be required for non-statndoff annotation.
ann - the name of the annotated file.
encoding - the encoding which should be used to read the files.
Returns:
an AnnotatedFile object representing the contents of the annotated file.

write

public void write(AnnotationFile af,
                  java.io.Writer out)
           throws java.io.IOException
Description copied from interface: AnnotatedFileFormat
Writes the contents of the AnnotationFile to the Writer specified by out. Also writes the source, if the source has changed 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()
Description copied from interface: FileFormat
Returns the file filter for this file format.

Returns:
the file filter for this file format.

getFormatName

public java.lang.String getFormatName()
Description copied from interface: FileFormat
Returns the name of the file format.

Returns:
the name of the file format.

addProgressListener

public void addProgressListener(ProgressListener pl)

removeProgressListener

public void removeProgressListener(ProgressListener pl)

getExtension

public java.lang.String getExtension()
Description copied from interface: FileFormat
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)
Description copied from interface: FileFormat
Returns true if this can open the file specified by af.

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

getSourceFileFormat

public SourceFileFormat getSourceFileFormat()
Description copied from interface: AnnotatedFileFormat
Returns the file format for the source used with this annotation file format. If no source file format exist then null is returned.

Returns:
a file format object or null.

getSourceFile

public java.io.File getSourceFile(java.lang.String annotatedFileName)
Description copied from interface: AnnotatedFileFormat
Computes the expected source file name for this format from the specified annotated file name.

Parameters:
annotatedFileName - The name of the annotated file.
Returns:
The name of the source file for the specified file format or null if no source file name can be determined.

getAnnotatedFile

public java.io.File getAnnotatedFile(java.lang.String sourceFileName)
Description copied from interface: AnnotatedFileFormat
Computes the expected annotation file name for this format from the specified source file name.

Parameters:
sourceFileName - The name of the source file.
Returns:
The name of the annotated file for the specified file format or null if no annotated file name can be determined.


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