Class ImageProvider

java.lang.Object
net.simplace.ui.ImageProvider

public final class ImageProvider extends Object
Resource manager for images. It has the ability to load a predefined set of icons at initialization time and keep them in memory. The set of images to be loaded is defined in the file 'images.properties' which must be located somewhere in the class path. it is also possible to locate localized images. use localization as follows: main.flag=frde.gif - default if non of the given local images are found main.flag.de_DE=de.gif - german image main.flag.fr_FR=fr.gif - french image main.flag.en_US=en.gif - english image
Author:
Andreas Enders
  • Field Details

    • DEFAULT_EMPTY

      public static final BufferedImage DEFAULT_EMPTY
      Default Empty Icon for ImageProvider
  • Method Details

    • getInstance

      public static ImageProvider getInstance()
      Get Singleton instance of ImageResourceManager.
    • hasImage

      public boolean hasImage(String aKey)
      Returns if the given icon is in this manager.
    • hasLocalizedImage

      public boolean hasLocalizedImage(String aKey)
      Returns if the given image is accessable in this manager.
    • getImageURL

      public URL getImageURL(String aKey)
      Returns the url for the given icon.
    • getImage

      public ImageIcon getImage(String aKey, ImageIcon aDefault)
      Get ImageIcon specified by the name supplied as an argument to this method.
    • getBufferedImage

      public BufferedImage getBufferedImage(String aKey, BufferedImage aDefault)
      Get ImageIcon specified by the name supplied as an argument to this method.
    • getImage

      public ImageIcon getImage(String aKey)
      Get ImageIcon specified by the name supplied as an argument to this method.
    • getBufferedImage

      public BufferedImage getBufferedImage(String aKey)
      Get ImageIcon specified by the name supplied as an argument to this method.
    • getLocalizedImage

      public ImageIcon getLocalizedImage(String aKey, ImageIcon aDefault)
      Get ImageIcon specified by the name supplied as an argument to this method.
    • getLocalizedBufferedImage

      public BufferedImage getLocalizedBufferedImage(String aKey, BufferedImage aDefault)
      Get ImageIcon specified by the name supplied as an argument to this method.
    • getLocalizedImage

      public ImageIcon getLocalizedImage(String aKey)
      Get ImageIcon specified by the name supplied as an argument to this method.
      Returns:
      the image icon
    • setInterceptedIcon

      public void setInterceptedIcon(String aKey, String aURL)
      Get ImageIcon specified by the name supplied as an argument to this method. Looks on the server if the image is available.
    • resolveResourceTags

      public String resolveResourceTags(String aHTMLCode)
      Parses content for embedded resources, and inserts additional information for resource location found in classpath.
    • getImageFromPanel

      public static final BufferedImage getImageFromPanel(JPanel aJPanel)
    • getImageFromRessource

      public ImageIcon getImageFromRessource(String aImageName)
      Parameters:
      aImageName -
      Returns:
      s Image for given Name. Image is searched in Classpath.