com.mindtree.techworks.insight
Class ResourceManager

java.lang.Object
  extended by com.mindtree.techworks.insight.ResourceManager

public final class ResourceManager
extends java.lang.Object

A simple resource manager implementation for Insight. This implementation starts with loading images, but can be extended for i18n implementation later.

Version:
$Revision: 135 $ $Date: 2008-01-15 19:53:53 -0700 (Tue, 15 Jan 2008) $
Author:
Bindul Bhowmik

Method Summary
 java.util.Locale getDefaultLocale()
           
static ResourceManager getInstance()
          Gets the singleton instance of the resource manager.
 javax.swing.ImageIcon loadImageIcon(java.lang.String imageKey)
          Loads an image from the classpath with the relative key passed in.
 javax.swing.ImageIcon loadImageIcon(java.lang.String imageKey, java.lang.ClassLoader classLoader)
          Loads an image icon using the image key passed in and the class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ResourceManager getInstance()
Gets the singleton instance of the resource manager.

Returns:
The Resource Manager instance.

loadImageIcon

public javax.swing.ImageIcon loadImageIcon(java.lang.String imageKey)
Loads an image from the classpath with the relative key passed in. The default classloader of this class is used.

Parameters:
imageKey - The key to the image
Returns:
The loaded image

loadImageIcon

public javax.swing.ImageIcon loadImageIcon(java.lang.String imageKey,
                                           java.lang.ClassLoader classLoader)
Loads an image icon using the image key passed in and the class loader. The loaded images are cached, and further requests for the same key are resolved from the cache.

Parameters:
imageKey - The key to the image
classLoader - The classloader to use
Returns:
The loaded image

getDefaultLocale

public java.util.Locale getDefaultLocale()
Returns:
the defaultLocale


Copyright © 2003-2008 MindTree Consulting Ltd.. All Rights Reserved.