de.esprit.common.gui

## Class Icons

- java.lang.Object
- - de.esprit.common.gui.Icons

-     public class Icons
      extends java.lang.Object

  This class implements an image/icon cache. The desired icon or image can be requested by a static method and is loaded on demand. Once loaded it is cached in a hash table for reusage.
  Note that icons or images are looked up by scanning the CLASSPATH.

  This class maintains a missingList which stores failed accesses. This is to avoid accessing the file system repeatedly for a missing icon.

  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Icons()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.swing.Icon` | `getIcon(IconKey key)`
    `static javax.swing.Icon` | `getIcon(java.lang.String key)` Returns the requested icon by name.
    `static javax.swing.Icon` | `getIcon(java.lang.String key, boolean withWarning)` Returns the requested icon by name.
    `static java.awt.Image` | `getImage(IconKey key)`
    `static java.awt.Image` | `getImage(java.lang.String key)` Returns the requested image by name.
    `static void` | `preloadAllIcons(IconKey[] iconKeys)` Preload the icons for all given `IconKey`s into the icon cache and prints a warning if the according icon resource was not found.
    `static java.lang.String` | `resourcePartNameOf(IconKey key)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Icons

          public Icons()

  - ### Method Detail

    - #### getImage

          public static java.awt.Image getImage(IconKey key)

    - #### getImage

          public static java.awt.Image getImage(java.lang.String key)

      Returns the requested image by name. Note that `name` must be a pure name string or a relative pathname under the `images` subdirectory and must not have any extension.

    - #### getIcon

          public static javax.swing.Icon getIcon(java.lang.String key)

      Returns the requested icon by name. Note that `name` must be a pure name string or a relative pathname under the `images` subdirectory and must not have any extension.

    - #### getIcon

          public static javax.swing.Icon getIcon(java.lang.String key,
                                 boolean withWarning)

      Returns the requested icon by name. Note that `name` must be a pure name string or a relative pathname under the `images` subdirectory and must not have any extension.

    - #### getIcon

          public static javax.swing.Icon getIcon(IconKey key)

    - #### resourcePartNameOf

          public static java.lang.String resourcePartNameOf(IconKey key)

    - #### preloadAllIcons

          public static void preloadAllIcons(IconKey[] iconKeys)

      Preload the icons for all given `IconKey`s into the icon cache and prints a warning if the according icon resource was not found.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.