Search this API

y.option
Class IconFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by y.option.IconFilter

public class IconFilter
extends FileFilter

Custom file filter prepared to deal with a range of image icon formats.


Field Summary
static String gif
           
static String jpeg
           
static String jpg
           
static String png
           
static String svg
           
static String svgz
           
static String tif
           
static String tiff
           
 
Constructor Summary
IconFilter()
           
 
Method Summary
 boolean accept(File f)
          This filter accepts all files which end with one of the static constants in this class, except for SVG images.
 String getDescription()
          Return the description of this filter.
static String getExtension(File f)
          Return the extension of this file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jpeg

public static final String jpeg
See Also:
Constant Field Values

jpg

public static final String jpg
See Also:
Constant Field Values

gif

public static final String gif
See Also:
Constant Field Values

tiff

public static final String tiff
See Also:
Constant Field Values

tif

public static final String tif
See Also:
Constant Field Values

png

public static final String png
See Also:
Constant Field Values

svg

public static final String svg
See Also:
Constant Field Values

svgz

public static final String svgz
See Also:
Constant Field Values
Constructor Detail

IconFilter

public IconFilter()
Method Detail

accept

public boolean accept(File f)
This filter accepts all files which end with one of the static constants in this class, except for SVG images.

Specified by:
accept in class FileFilter
Returns:
true iff this file is a valid image icon format, determined by its extension

getDescription

public String getDescription()
Return the description of this filter.

Specified by:
getDescription in class FileFilter
Returns:
"Icon files"

getExtension

public static String getExtension(File f)
Return the extension of this file.


© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.