loci.formats.gui
Class ComboFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by 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.

Source code:
Trac, SVN


Constructor Summary
ComboFileFilter(FileFilter[] filters, String description)
          Constructs a new filter from a list of other filters.
 
Method Summary
 boolean accept(File f)
          Accepts files with the proper filename prefix.
 int compareTo(Object o)
          Compares two FileFilter objects alphanumerically.
 String getDescription()
          Returns the filter's description.
 FileFilter[] getFilters()
          Gets the list of file filters forming this filter combination.
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.
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.
 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

ComboFileFilter

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

Method Detail

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