Class IconManager

java.lang.Object
ca.phon.util.icons.IconManager

public class IconManager extends Object
Class for obtaining icons.
  • Constructor Details

    • IconManager

      protected IconManager()
      Constructor
  • Method Details

    • getInstance

      public static IconManager getInstance()
      Returns the shared IconManager instance
    • getIcon

      public ImageIcon getIcon(String iconName, IconSize size)
    • getGrayedIcon

      public ImageIcon getGrayedIcon(String iconName, IconSize size)
    • getGrayedIcon

      public ImageIcon getGrayedIcon(Icon icon)
    • getDisabledIcon

      public ImageIcon getDisabledIcon(String iconName, IconSize size)
    • getDisabledIcon

      public ImageIcon getDisabledIcon(Icon icon)
    • getSystemIconForPath

      public ImageIcon getSystemIconForPath(String path, IconSize size)
      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

      public ImageIcon getSystemIconForPath(String path, String backupIcon, IconSize size)
      Load system icon for given path.
      Parameters:
      path -
      backupIcon - icon name used as backup if system icon not found. May be null
      size -
      Returns:
      icon for given path or backup icon if not found
    • getSystemIconForFileType

      public ImageIcon getSystemIconForFileType(String filetype, IconSize size)
      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

      public ImageIcon getSystemIconForFileType(String filetype, String backupIcon, IconSize size)
      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 be null
      size -
      Returns:
      icon for given file type or backup icon if not found
    • getSystemStockIcon

      public ImageIcon getSystemStockIcon(ca.hedlund.desktopicons.StockIcon stockIcon, IconSize size)
      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 found
      size -
      Returns:
      icon for given file type or backup icon if not found
    • createGlyphIcon

      public ImageIcon createGlyphIcon(Character c, Font font, Color foreground, Color background)
      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 by FontMetrics.getStringBounds(String, java.awt.Graphics)
      Parameters:
      c -
      font -
      foreground -
      background -
    • createIconStrip

      public ImageIcon createIconStrip(Icon[] icons)
      Combine icons into an icon strip.
      Parameters:
      icons -
    • createIconStrip

      public ImageIcon createIconStrip(Icon[] icons, int offset)