Back to index

wims  3.65+svn20090927
Public Member Functions
ptolemy.plot.PlotFrame.PLTOrXMLFileFilter Class Reference

Display only .plt and .xml files. More...

Inheritance diagram for ptolemy.plot.PlotFrame.PLTOrXMLFileFilter:
Inheritance graph
[legend]
Collaboration diagram for ptolemy.plot.PlotFrame.PLTOrXMLFileFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean accept (File fileOrDirectory)
 Accept only .plt or .xml files.
String getDescription ()
 The description of this filter.

Detailed Description

Display only .plt and .xml files.

Definition at line 664 of file PlotFrame.java.


Member Function Documentation

boolean ptolemy.plot.PlotFrame.PLTOrXMLFileFilter.accept ( File  fileOrDirectory) [inline]

Accept only .plt or .xml files.

Parameters:
fileThe file to be checked.
Returns:
true if the file is a directory, a .plot or a .xml file.

Definition at line 669 of file PlotFrame.java.

                                                    {
            if (fileOrDirectory.isDirectory()) {
                return true;
            }

            String fileOrDirectoryName = fileOrDirectory.getName();
            int dotIndex = fileOrDirectoryName.lastIndexOf('.');

            if (dotIndex == -1) {
                return false;
            }

            String extension = fileOrDirectoryName.substring(dotIndex);

            if (extension != null) {
                if (extension.equalsIgnoreCase(".plt")
                        || extension.equalsIgnoreCase(".xml")) {
                    return true;
                } else {
                    return false;
                }
            }

            return false;
        }

The description of this filter.

Definition at line 696 of file PlotFrame.java.

                                       {
            return ".plt and .xml files";
        }

The documentation for this class was generated from the following file: