Package ptolemy.gui

Class PtFilenameFilter

  • All Implemented Interfaces:
    java.io.FilenameFilter
    Direct Known Subclasses:
    ExtensionFilenameFilter

    public class PtFilenameFilter
    extends javax.swing.filechooser.FileFilter
    implements java.io.FilenameFilter
    A file filter that determines what files are displayed by the file dialog.

    Note that the containing class can use either java.awt.FileDialog or javax.swing.JFileChooser, so classes should extend FilenameFilter, which can be used with either.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.io.File file)
      Return true if the file is acceptable.
      boolean accept​(java.io.File directory, java.lang.String name)
      Return true if the file is acceptable.
      java.lang.String getDescription()
      A description of this FilenameFilter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PtFilenameFilter

        public PtFilenameFilter()
    • Method Detail

      • accept

        public boolean accept​(java.io.File file)
        Return true if the file is acceptable.
        Specified by:
        accept in class javax.swing.filechooser.FileFilter
        Parameters:
        file - The file to be checked.
        Returns:
        true if the file is acceptable
      • accept

        public boolean accept​(java.io.File directory,
                              java.lang.String name)
        Return true if the file is acceptable.
        Specified by:
        accept in interface java.io.FilenameFilter
        Parameters:
        directory - The directory that contains the file.
        name - The name of the file.
        Returns:
        true if the file is acceptable.
      • getDescription

        public java.lang.String getDescription()
        A description of this FilenameFilter.
        Specified by:
        getDescription in class javax.swing.filechooser.FileFilter
        Returns:
        In this base class, return the string "All Files".