Package loci.formats.gui
Class FormatFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
loci.formats.gui.FormatFileFilter
- All Implemented Interfaces:
FileFilter,Comparable
A file filter for a biological file format, for use with a JFileChooser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether it is ok to open a file to determine its type.private StringDescription.private IFormatReaderAssociated file format reader. -
Constructor Summary
ConstructorsConstructorDescriptionFormatFileFilter(IFormatReader reader) Constructs a new filter that accepts files of the given reader's type.FormatFileFilter(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 TypeMethodDescriptionbooleanAccepts files in accordance with the file format reader.intCompares two FileFilter objects alphanumerically.Gets the filter's description.Returns the filter's reader.toString()Gets a string representation of this file filter.
-
Field Details
-
reader
Associated file format reader. -
allowOpen
private boolean allowOpenWhether it is ok to open a file to determine its type. -
desc
Description.
-
-
Constructor Details
-
FormatFileFilter
Constructs a new filter that accepts files of the given reader's type. -
FormatFileFilter
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
Accepts files in accordance with the file format reader.- Specified by:
acceptin interfaceFileFilter- Specified by:
acceptin classFileFilter
-
getReader
Returns the filter's reader. -
getDescription
Gets the filter's description.- Specified by:
getDescriptionin classFileFilter
-
toString
Gets a string representation of this file filter. -
compareTo
Compares two FileFilter objects alphanumerically.- Specified by:
compareToin interfaceComparable
-