Class ComboFileFilter

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

public class ComboFileFilter extends FileFilter implements FileFilter, Comparable
A file filter that recognizes files from a union of other filters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComboFileFilter(FileFilter[] filters, String description)
    Constructs a new filter from a list of other filters.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Accepts files with the proper filename prefix.
    int
    Compares two FileFilter objects alphanumerically.
    Returns the filter's description.
    Gets the list of file filters forming this filter combination.
    static FileFilter[]
    Sorts the given list of file filters, and combines filters with identical descriptions into a combination filter that accepts anything any of its constituant filters do.
    static FileFilter[]
    Sorts the given list of file filters, and combines filters with identical descriptions into a combination filter that accepts anything any of its constituant filters do.
    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

    • ComboFileFilter

      public ComboFileFilter(FileFilter[] filters, String description)
      Constructs a new filter from a list of other filters.
  • Method Details

    • getFilters

      public FileFilter[] getFilters()
      Gets the list of file filters forming this filter combination.
    • sortFilters

      public static FileFilter[] sortFilters(FileFilter[] filters)
      Sorts the given list of file filters, and combines filters with identical descriptions into a combination filter that accepts anything any of its constituant filters do.
    • sortFilters

      public static FileFilter[] sortFilters(Vector filters)
      Sorts the given list of file filters, and combines filters with identical descriptions into a combination filter that accepts anything any of its constituant filters do.
    • accept

      public boolean accept(File f)
      Accepts files with the proper filename prefix.
      Specified by:
      accept in interface FileFilter
      Specified by:
      accept in class FileFilter
    • getDescription

      public String getDescription()
      Returns 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