loci.formats.gui
Class FormatFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by loci.formats.gui.FormatFileFilter
All Implemented Interfaces:
FileFilter, Comparable

public class FormatFileFilter
extends FileFilter
implements FileFilter, Comparable

A file filter for a biological file format, for use with a JFileChooser.

Source code:
Trac, SVN


Constructor Summary
FormatFileFilter(loci.formats.IFormatReader reader)
          Constructs a new filter that accepts files of the given reader's type.
FormatFileFilter(loci.formats.IFormatReader reader, boolean allowOpen)
          Constructs a new filter that accepts files of the given reader's type, allowing the reader to open files only if the allowOpen flag is set.
 
Method Summary
 boolean accept(File f)
          Accepts files in accordance with the file format reader.
 int compareTo(Object o)
          Compares two FileFilter objects alphanumerically.
 String getDescription()
          Gets the filter's description.
 String toString()
          Gets a string representation of this file filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormatFileFilter

public FormatFileFilter(loci.formats.IFormatReader reader)
Constructs a new filter that accepts files of the given reader's type.


FormatFileFilter

public FormatFileFilter(loci.formats.IFormatReader reader,
                        boolean allowOpen)
Constructs a new filter that accepts files of the given reader's type, allowing the reader to open files only if the allowOpen flag is set.

Parameters:
reader - The reader to use for verifying a file's type.
allowOpen - Whether it is ok to open a file to determine its type.
Method Detail

accept

public boolean accept(File f)
Accepts files in accordance with the file format reader.

Specified by:
accept in interface FileFilter
Specified by:
accept in class FileFilter

getDescription

public String getDescription()
Gets the filter's description.

Specified by:
getDescription in class FileFilter

toString

public String toString()
Gets a string representation of this file filter.

Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
Compares two FileFilter objects alphanumerically.

Specified by:
compareTo in interface Comparable