diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 /src/StandardIO/MFileFilter.java | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
Diffstat (limited to 'src/StandardIO/MFileFilter.java')
| -rw-r--r-- | src/StandardIO/MFileFilter.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/StandardIO/MFileFilter.java b/src/StandardIO/MFileFilter.java new file mode 100644 index 0000000..8484806 --- /dev/null +++ b/src/StandardIO/MFileFilter.java @@ -0,0 +1,40 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.File; +/* */ +/* */ public class MFileFilter extends javax.swing.filechooser.FileFilter +/* */ { +/* */ java.io.FileFilter filter; +/* */ String description; +/* */ String[] ext; +/* */ +/* */ public MFileFilter(java.io.FileFilter f, String description) +/* */ { +/* 18 */ this.filter = f; +/* 19 */ this.description = description; +/* 20 */ this.ext = null; +/* */ } +/* */ +/* */ public MFileFilter(String[] acceptedExtensions, String description) { +/* 24 */ this.ext = acceptedExtensions; +/* 25 */ this.description = description; +/* 26 */ this.filter = null; +/* */ } +/* */ public boolean accept(File f) { +/* 29 */ if (f.isDirectory()) return true; +/* 30 */ if (this.filter != null) +/* 31 */ return this.filter.accept(f); +/* 32 */ for (String ex : this.ext) +/* 33 */ if (f.toString().endsWith(ex)) +/* 34 */ return true; +/* 35 */ return false; +/* */ } +/* */ public String getDescription() { +/* 38 */ return this.description; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.MFileFilter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |