org.xnap.gui.util
Class IconHelper

java.lang.Object
  extended by org.xnap.gui.util.IconHelper

public class IconHelper
extends java.lang.Object

This class provides methods to get icons in certain sizes. All icon directories are searched.


Nested Class Summary
static class IconHelper.EmptyIcon
          Provides an empty, transparent icon.
 
Field Summary
static java.lang.String DEFAULT_ICON_PATH
          The default path to search for icons.
static java.lang.String XNAP_ICON
           
 
Constructor Summary
IconHelper()
           
 
Method Summary
static javax.swing.Icon getButtonIcon(java.lang.String filename)
           
static javax.swing.Icon getEmptyIcon(int size)
           
static javax.swing.Icon getIcon(java.lang.String filename, int size)
           
static javax.swing.Icon getIcon(java.lang.String filename, int size, boolean createEmptyIcon)
          Returns an icon with size height and width.
static java.lang.String getIconPath()
           
static javax.swing.ImageIcon getImage(java.lang.String filename)
          Searches iconPath + #ICON_PATH for filename.
static javax.swing.ImageIcon getImage(java.lang.String path, int size, java.lang.String filename)
           
static javax.swing.Icon getListIcon(java.lang.String filename)
           
static javax.swing.Icon getMenuIcon(java.lang.String filename)
           
static javax.swing.Icon getScaledLogo(int height)
           
static javax.swing.Icon getStatusBarIcon(java.lang.String filename)
           
static javax.swing.Icon getTabTitleIcon(java.lang.String filename)
           
static javax.swing.Icon getToolBarIcon(java.lang.String filename)
           
static javax.swing.Icon getTreeIcon(java.lang.String filename)
           
static javax.swing.Icon getWizardIcon(java.lang.String filename)
           
static void setIconPath(java.lang.String iconPath)
          Sets the search path iconPath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XNAP_ICON

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

DEFAULT_ICON_PATH

public static final java.lang.String DEFAULT_ICON_PATH
The default path to search for icons.

See Also:
Constant Field Values
Constructor Detail

IconHelper

public IconHelper()
Method Detail

getIcon

public static final javax.swing.Icon getIcon(java.lang.String filename,
                                             int size,
                                             boolean createEmptyIcon)
Returns an icon with size height and width. If no icon named filename can be found and createEmptyIcon is true, an empty icon is returned.

If the icon does not fit size it is scaled.


getIcon

public static final javax.swing.Icon getIcon(java.lang.String filename,
                                             int size)
Returns:
never returns null
See Also:
getIcon(String, int, boolean)

getImage

public static final javax.swing.ImageIcon getImage(java.lang.String filename)
Searches iconPath + #ICON_PATH for filename. If filename is not found #ICON_PATH is searched as a fallback.

Returns:
null, if filename does not exists.

getImage

public static final javax.swing.ImageIcon getImage(java.lang.String path,
                                                   int size,
                                                   java.lang.String filename)

getEmptyIcon

public static final javax.swing.Icon getEmptyIcon(int size)

getListIcon

public static final javax.swing.Icon getListIcon(java.lang.String filename)

getButtonIcon

public static final javax.swing.Icon getButtonIcon(java.lang.String filename)

getMenuIcon

public static final javax.swing.Icon getMenuIcon(java.lang.String filename)

getIconPath

public static java.lang.String getIconPath()

getScaledLogo

public static javax.swing.Icon getScaledLogo(int height)

getStatusBarIcon

public static final javax.swing.Icon getStatusBarIcon(java.lang.String filename)

getTabTitleIcon

public static final javax.swing.Icon getTabTitleIcon(java.lang.String filename)

getTreeIcon

public static final javax.swing.Icon getTreeIcon(java.lang.String filename)

getToolBarIcon

public static final javax.swing.Icon getToolBarIcon(java.lang.String filename)

getWizardIcon

public static final javax.swing.Icon getWizardIcon(java.lang.String filename)

setIconPath

public static void setIconPath(java.lang.String iconPath)
Sets the search path iconPath. Used for icon theming.



Copyright © 2001-2005 XNap Team. All Rights Reserved.