Package gov.nih.mipav.view
Class ViewImageFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
gov.nih.mipav.view.ViewImageFileFilter
- All Implemented Interfaces:
FileFilter
A simple file filter to display only files with the appropriate extension in the file dialog.
- Author:
- Harman Singh
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDisplay all files.static final intFilter avi files (*.avi).static final intClass Files (*.class).static final intmipav data provenance (*.xmp) filesprivate static String[]description strings for each filterType.static final intDicom Matrix info Files (*.dicomMatrix).static final intFilter made up on-the-fly.protected StringDescription of dynamic filter.protected String[]Extensions to look at for the dynamic filter.static final intFiber track filesprotected final intFilter type of this filter.static final intFreeSurfer ascii files (*.asc).static final intTransfer Function Files (*.fun).static final intGeneral( *.gif; *.jpeg; *.jpg; *.pict; *.psd; *.tif; *.tiff).static final intstatic final intLook-Up-Table Files (*.lut).static final int.tps contains int N and float C[][] for thin plate splinestatic final intMicroscopy files (*.avi; *.ics; *.liff; *.lsm; *.pic; *.stk; *.tif; *.tiff; *.xml).static final intMisc.(*.bmp; *.pcx; *.png; *.tga; *.xbm; *.xpm).static final intB-Spline Nonlinear Transformation Files (*.nlt).static final intOptical Files (for ophthalmology) (*.avi; *.bmp; *.jpg; *.pict; *.tif; *.tiff; *.img; *.psd).static final intGraphs (*.plt).static final intAll plugin related files (.class, .jar, .zip, .tar, .tar.gz).static final intR-table (*.rtb)static final intScript Files (*.sct).private static String[]short description strings for each filterType.static final intSurface Files (*.sur).static final intMedical Formats(*.dcm; *.ima; *.img; *.mnc; *.sig; *.xml; *.head; *.nii, *.rec, *.frec, *.nrrd, *.gz, *.bz2, *.zip).static final intstatic final intUser definedprotected static StringThis is the user defined file extensions Stringprotected static String[]array of user defined extensionsstatic final intVOI Files (*.voi). -
Constructor Summary
ConstructorsConstructorDescriptionViewImageFileFilter(int filterType) Constructs new filter of given type.ViewImageFileFilter(String[] exts) Constructs a dynamic filter, with the given extensions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanOne of the overrides to FileFilter.booleanChecks if extension matches what is accepted for the filter type.booleanequals(FileFilter filter) Determines if this file filter is equal (in value) to another.One of the overrides to FileFilter.static StringgetDescription(int filter) Returns the description of the given file filter.static String[]Returns the list of descriptions.static intgetFilterIndex(String filter) DOCUMENT ME!static StringgetShortDescription(int filter) Returns the dshort escription of the given file filter.String[]Returns a list of the files in the directory that satisfy the file filter.static booleanmatches(FileFilter filter, int filterType) Determines if the given file filter's description matches the description associated with the given filterType.static voidsetUdefDescription(String desc) This sets the udef description becasue as the user edits the file extensions, the description changesstatic voidThis sets the user defined Exts String as well as the Arraay of exts from the Preferences
-
Field Details
-
ALL
public static final int ALLDisplay all files.- See Also:
-
AVI
public static final int AVIFilter avi files (*.avi).- See Also:
-
CLASS
public static final int CLASSClass Files (*.class).- See Also:
-
FREESURFER
public static final int FREESURFERFreeSurfer ascii files (*.asc).- See Also:
-
GEN
public static final int GENGeneral( *.gif; *.jpeg; *.jpg; *.pict; *.psd; *.tif; *.tiff).- See Also:
-
PLOT
public static final int PLOTGraphs (*.plt).- See Also:
-
LUT
public static final int LUTLook-Up-Table Files (*.lut).- See Also:
-
MATRIX
public static final int MATRIX.tps contains int N and float C[][] for thin plate spline- See Also:
-
TECH
public static final int TECHMedical Formats(*.dcm; *.ima; *.img; *.mnc; *.sig; *.xml; *.head; *.nii, *.rec, *.frec, *.nrrd, *.gz, *.bz2, *.zip).- See Also:
-
MICROSCOPY
public static final int MICROSCOPYMicroscopy files (*.avi; *.ics; *.liff; *.lsm; *.pic; *.stk; *.tif; *.tiff; *.xml).- See Also:
-
MISC
public static final int MISCMisc.(*.bmp; *.pcx; *.png; *.tga; *.xbm; *.xpm).- See Also:
-
OPTICAL
public static final int OPTICALOptical Files (for ophthalmology) (*.avi; *.bmp; *.jpg; *.pict; *.tif; *.tiff; *.img; *.psd).- See Also:
-
SCRIPT
public static final int SCRIPTScript Files (*.sct).- See Also:
-
SURFACE
public static final int SURFACESurface Files (*.sur).- See Also:
-
FUNCT
public static final int FUNCTTransfer Function Files (*.fun).- See Also:
-
VOI
public static final int VOIVOI Files (*.voi).- See Also:
-
NLT
public static final int NLTB-Spline Nonlinear Transformation Files (*.nlt).- See Also:
-
DYNAMIC
public static final int DYNAMICFilter made up on-the-fly.- See Also:
-
PLUGIN
public static final int PLUGINAll plugin related files (.class, .jar, .zip, .tar, .tar.gz).- See Also:
-
UDEF
public static final int UDEFUser defined- See Also:
-
RTABLE
public static final int RTABLER-table (*.rtb)- See Also:
-
DATA_PROVENANCE
public static final int DATA_PROVENANCEmipav data provenance (*.xmp) files- See Also:
-
TIFF
public static final int TIFF- See Also:
-
DICOMMATRIX
public static final int DICOMMATRIXDicom Matrix info Files (*.dicomMatrix).- See Also:
-
FIBER
public static final int FIBERFiber track files- See Also:
-
JSON
public static final int JSON- See Also:
-
descriptions
description strings for each filterType. -
shortDescriptions
short description strings for each filterType. -
userDefinedExtensions
array of user defined extensions -
udefExtsString
This is the user defined file extensions String -
dynamicDescription
Description of dynamic filter. -
dynamicExts
Extensions to look at for the dynamic filter. -
filterType
protected final int filterTypeFilter type of this filter.
-
-
Constructor Details
-
ViewImageFileFilter
public ViewImageFileFilter(int filterType) Constructs new filter of given type.- Parameters:
filterType- Type of filter (GEN, TECH, etc.)
-
ViewImageFileFilter
Constructs a dynamic filter, with the given extensions.- Parameters:
exts- Extensions to accept for dynamic filter.
-
-
Method Details
-
getDescription
Returns the description of the given file filter.- Parameters:
filter- Filter to check.- Returns:
- Description of filter.
-
getDescriptions
Returns the list of descriptions.- Returns:
- The list of descriptions.
-
getFilterIndex
DOCUMENT ME!- Parameters:
filter- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getShortDescription
Returns the dshort escription of the given file filter.- Parameters:
filter- Filter to check.- Returns:
- Short description of filter.
-
matches
Determines if the given file filter's description matches the description associated with the given filterType.- Parameters:
filter- The filter to be testedfilterType- The filter type to test for a match- Returns:
trueif and only if the filter's description matches the filterType description.
-
accept
One of the overrides to FileFilter. This function is called for each file in the current directory of the file dialog to test if it is a file with the appropriate extension. If so, it is accepted for display in the file dialog.- Specified by:
acceptin interfaceFileFilter- Specified by:
acceptin classFileFilter- Parameters:
f- The file whose name is to be tested for extension.- Returns:
trueif and only if the file has an appropriate extension.
-
accept
Checks if extension matches what is accepted for the filter type. If so, returnstrue; if not, returnsfalse.- Parameters:
extension- Extension of file to check.- Returns:
trueif extension is in file filter.
-
equals
Determines if this file filter is equal (in value) to another.- Parameters:
filter- The filter to be tested for equality- Returns:
trueif and only if the filter is the same type as this filter.
-
getDescription
One of the overrides to FileFilter. This function is called just to access the description of the filter.- Specified by:
getDescriptionin classFileFilter- Returns:
- The description for the filter.
-
listFiles
Returns a list of the files in the directory that satisfy the file filter.- Parameters:
file- Directory- Returns:
- List of files in directory that satisfy file filter.
-
setUdefDescription
This sets the udef description becasue as the user edits the file extensions, the description changes- Parameters:
desc- Description String
-
setUserDefinedExtensions
public static void setUserDefinedExtensions()This sets the user defined Exts String as well as the Arraay of exts from the Preferences
-