Package ca.phon.util.icons
Class IconManager
java.lang.Object
ca.phon.util.icons.IconManager
Class for obtaining icons.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateGlyphIcon
(Character c, Font font, Color foreground, Color background) Create a new icon with a single character using the given foreground, background.createIconStrip
(Icon[] icons) Combine icons into an icon strip.createIconStrip
(Icon[] icons, int offset) getDisabledIcon
(String iconName, IconSize size) getDisabledIcon
(Icon icon) getGrayedIcon
(String iconName, IconSize size) getGrayedIcon
(Icon icon) static IconManager
Returns the shared IconManager instancegetSystemIconForFileType
(String filetype, IconSize size) Load system icon for given file type.getSystemIconForFileType
(String filetype, String backupIcon, IconSize size) Load system icon for given file type.getSystemIconForPath
(String path, IconSize size) Load system icon for given path.getSystemIconForPath
(String path, String backupIcon, IconSize size) Load system icon for given path.getSystemStockIcon
(ca.hedlund.desktopicons.StockIcon stockIcon, IconSize size) Load system stock icon.getSystemStockIcon
(ca.hedlund.desktopicons.StockIcon stockIcon, String backupIcon, IconSize size) Load system stock icon.
-
Constructor Details
-
IconManager
protected IconManager()Constructor
-
-
Method Details
-
getInstance
Returns the shared IconManager instance -
getIcon
-
getGrayedIcon
-
getGrayedIcon
-
getDisabledIcon
-
getDisabledIcon
-
getSystemIconForPath
Load system icon for given path.- Parameters:
path
-size
-backupIcon
- icon name used as backup if system icon not found- Returns:
- icon for given path or
null
if not found
-
getSystemIconForPath
Load system icon for given path.- Parameters:
path
-backupIcon
- icon name used as backup if system icon not found. May benull
size
-- Returns:
- icon for given path or backup icon if not found
-
getSystemIconForFileType
Load system icon for given file type. File type should be an extension without a leading '.'- Parameters:
filetype
-size
-- Returns:
- icon for given file type or
null
if not found
-
getSystemIconForFileType
Load system icon for given file type. File type should be an extension without a leading '.'- Parameters:
filetype
-backupIcon
- icon name used as backup if system icon not found, may benull
size
-- Returns:
- icon for given file type or backup icon if not found
-
getSystemStockIcon
Load system stock icon. Use a value from either MacOSStockIcon or WindowsStockIcon enums.- Parameters:
stockIcon
-size
-- Returns:
- icon for given file type or backup icon if not found
-
getSystemStockIcon
public ImageIcon getSystemStockIcon(ca.hedlund.desktopicons.StockIcon stockIcon, String backupIcon, IconSize size) Load system stock icon. Use a value from either MacOSStockIcon or WindowsStockIcon enums.- Parameters:
stockIcon
-backupIcon
- icon name used as backup if system icon not foundsize
-- Returns:
- icon for given file type or backup icon if not found
-
createGlyphIcon
Create a new icon with a single character using the given foreground, background. The size of the icon will be the size of the bounding rectangle returned byFontMetrics.getStringBounds(String, java.awt.Graphics)
- Parameters:
c
-font
-foreground
-background
-
-
createIconStrip
Combine icons into an icon strip.- Parameters:
icons
-
-
createIconStrip
-