sims.ihm
Class MachineFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by sims.ihm.MachineFilter
Direct Known Subclasses:
RegFilter, TurFilter

public class MachineFilter
extends javax.swing.filechooser.FileFilter


Constructor Summary
MachineFilter()
           
 
Method Summary
 boolean accept(java.io.File f)
          Test if the file matches the filter criterias: if its extension is "reg" or "tur".
 java.lang.String getDescription()
          Gives the String that will be printed on the dialog box when applying the filter.
static java.lang.String getExtension(java.io.File f)
          Build a substring of the filename corresponding to its extension (the word after the last occurence of '.').
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MachineFilter

public MachineFilter()
Method Detail

accept

public boolean accept(java.io.File f)
Test if the file matches the filter criterias: if its extension is "reg" or "tur".

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
f - the file passing the filter.
Returns:
true if the file is accepted by the filter, false otherwise

getDescription

public java.lang.String getDescription()
Gives the String that will be printed on the dialog box when applying the filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
a String describing the filter.

getExtension

public static java.lang.String getExtension(java.io.File f)
Build a substring of the filename corresponding to its extension (the word after the last occurence of '.').

Parameters:
f - the File we want to get the extension.
Returns:
f extension