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 javax.swing.filechooser.FileFilter

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

 

Field Summary
static java.lang.String gif
           
static java.lang.String jpeg
           
static java.lang.String jpg
           
static java.lang.String png
           
static java.lang.String svg
           
static java.lang.String svgz
           
static java.lang.String tif
           
static java.lang.String tiff
           
 
Constructor Summary
IconFilter()
           
 
Method Summary
 boolean accept(java.io.File f)
          This filter accepts all files which end with one of the static constants in this class, except for SVG images.
 java.lang.String getDescription()
          Return the description of this filter.
static java.lang.String getExtension(java.io.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 java.lang.String jpeg
See Also:
Constant Field Values

jpg

public static final java.lang.String jpg
See Also:
Constant Field Values

gif

public static final java.lang.String gif
See Also:
Constant Field Values

tiff

public static final java.lang.String tiff
See Also:
Constant Field Values

tif

public static final java.lang.String tif
See Also:
Constant Field Values

png

public static final java.lang.String png
See Also:
Constant Field Values

svg

public static final java.lang.String svg
See Also:
Constant Field Values

svgz

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

IconFilter

public IconFilter()
Method Detail

accept

public boolean accept(java.io.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 javax.swing.filechooser.FileFilter
Returns:
true iff this file is a valid image icon format, determined by its extension

getDescription

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

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
"Icon files"

getExtension

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


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