devisor2.grid.GUI.dialogs
Class FilePickerFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended bydevisor2.grid.GUI.dialogs.FilePickerFilter

public class FilePickerFilter
extends javax.swing.filechooser.FileFilter

This class represents the non-customizable file filter for the application. It provides (via several constructors) all the file filters needed.
To add a new extension type, do the following:
(1) add a new FILTER_??? constant
(2) add a corresponding case block to the constructor
(3) add a corresponding case block to the getExtensions method
(4) add a corresponding case block to the getSelectedFile method in the FilePicker class

See Also:
MainActionListener, OptionsActionListener for usage example

Field Summary
static int FILTER_ALL
          Use this filter to accept all files
static int FILTER_BIN
          Use this filter to accept binaries
static int FILTER_DEFAULT
          Use this filter to accept all supported file types
static int FILTER_DIRECTORIES
          Use this filter to accept only directories
static int FILTER_FEAST
          Use this filter to accept only files with extension ".feast"
static int FILTER_FEAT
          Use this filter to accept only files with extension ".tri" or ".prm"
static int FILTER_PS
          Use this filter to accept PostScript files
static int FILTER_UCD
          Use this filter to accept only files with extension ".inp"
 
Constructor Summary
FilePickerFilter()
          creates a file filter which accepts *.*
FilePickerFilter(int filterType)
          Creates a file filter that accepts only the given file types
 
Method Summary
 boolean accept(java.io.File f)
          Determines whether the given file should be diaplayed in the FilePicker's file list
 java.lang.String getDescription()
          Returns a textual description for the current filter.
 java.lang.String[] getExtensions()
          returns an array of accepted extensions
 int getFilterType()
          returns the filter type of this instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_UCD

public static final int FILTER_UCD
Use this filter to accept only files with extension ".inp"

See Also:
Constant Field Values

FILTER_FEAT

public static final int FILTER_FEAT
Use this filter to accept only files with extension ".tri" or ".prm"

See Also:
Constant Field Values

FILTER_FEAST

public static final int FILTER_FEAST
Use this filter to accept only files with extension ".feast"

See Also:
Constant Field Values

FILTER_ALL

public static final int FILTER_ALL
Use this filter to accept all files

See Also:
Constant Field Values

FILTER_DIRECTORIES

public static final int FILTER_DIRECTORIES
Use this filter to accept only directories

See Also:
Constant Field Values

FILTER_DEFAULT

public static final int FILTER_DEFAULT
Use this filter to accept all supported file types

See Also:
Constant Field Values

FILTER_BIN

public static final int FILTER_BIN
Use this filter to accept binaries

See Also:
Constant Field Values

FILTER_PS

public static final int FILTER_PS
Use this filter to accept PostScript files

See Also:
Constant Field Values
Constructor Detail

FilePickerFilter

public FilePickerFilter()
creates a file filter which accepts *.*


FilePickerFilter

public FilePickerFilter(int filterType)
Creates a file filter that accepts only the given file types

Parameters:
filterType - - one of the FILTER_??? constants declared in this class
Method Detail

getFilterType

public int getFilterType()
returns the filter type of this instance

Returns:
FILTER_DEFAULT, FILTER_UCD, FILTER_FEAST, FILTER_FEAT etc

accept

public boolean accept(java.io.File f)
Determines whether the given file should be diaplayed in the FilePicker's file list

Parameters:
f - - a file
Returns:
true if the file complies with the filter, false otherwise
See Also:
FileFilter#accepts

getDescription

public java.lang.String getDescription()
Returns a textual description for the current filter.


getExtensions

public java.lang.String[] getExtensions()
returns an array of accepted extensions