Class FormatFileFilter

java.lang.Object
javax.swing.filechooser.FileFilter
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.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    boolean
    Accepts files in accordance with the file format reader.
    int
    Compares two FileFilter objects alphanumerically.
    Gets the filter's description.
    loci.formats.IFormatReader
    Returns the filter's reader.
    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 Details

    • 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 Details

    • 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
    • getReader

      public loci.formats.IFormatReader getReader()
      Returns the filter's reader.
    • 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