package com.srbenoit.filter;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 * A file filter to restrict access to ".ftree" files.
 */
public class GraphFileFilter extends FileFilter {

    /**
     * Tests whether or not the specified abstract pathname should be included in a pathname list.
     *
     * @param   pathname  the abstract pathname to be tested
     * @return  <code>true</code> if and only if <code>pathname</code> should be included
     */
    @Override public boolean accept(final File pathname) {

        return pathname.getName().toLowerCase().endsWith(".ftree");
    }

    /**
     * The description of this filter.
     *
     * @return  the description
     */
    @Override public String getDescription() {

        return "*.ftree (Filter Trees)";
    }
}
