se.umu.cs.SequenceDiagramEditor
Class SDFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended byse.umu.cs.SequenceDiagramEditor.SDFilter

public class SDFilter
extends javax.swing.filechooser.FileFilter

This class is used to filter files. It just approve files with the extension .sd (sequence diagrams).

Author:
Matilda Östling

Field Summary
private  boolean directory
          Used to filter away directories.
 
Constructor Summary
SDFilter()
           
 
Method Summary
 boolean accept(java.io.File f)
          This method is used to filter files.
 java.lang.String getDescription()
          This method returns the description of this filter.
static java.lang.String getExtension(java.io.File f)
          This method is used to get the extension from the name of a file.
 void setDirectorySearch(boolean b)
          This methods sets wether or not directorys should be shown for the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directory

private boolean directory
Used to filter away directories.

Constructor Detail

SDFilter

public SDFilter()
Method Detail

accept

public boolean accept(java.io.File f)
This method is used to filter files. It looks for files with the extension .sd

Parameters:
f - The file to be filtered
Returns:
Returns true if the file has an extension .sd, otherwise it returns false

getDescription

public java.lang.String getDescription()
This method returns the description of this filter.

Returns:
A string containing the description

getExtension

public static java.lang.String getExtension(java.io.File f)
This method is used to get the extension from the name of a file.

Parameters:
f - The file to get the extension from
Returns:
A String containing the extension of the file

setDirectorySearch

public void setDirectorySearch(boolean b)
This methods sets wether or not directorys should be shown for the user.

Parameters:
b - True if directories should be shown, and false otherwise.