no.ntnu.vegare.visualizer.client.utils
Class Resources

java.lang.Object
  extended by no.ntnu.vegare.visualizer.client.utils.Resources

public class Resources
extends java.lang.Object

Thread safe singleton implementation by Bill Pugh: http://en.wikipedia.org/wiki/Singleton_pattern

Provides access to static resources related to the project. Allows preloading of large images by using the method preloadResources(). Keeps all loaded resources in memory.

Author:
vegare

Method Summary
 javax.swing.ImageIcon getImage(java.lang.String name)
          Return an imageicon from memory if cached, otherwise load it from disk.
static Resources getInstance()
           
 void preloadResources()
          Preload big images
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Resources getInstance()

preloadResources

public void preloadResources()
Preload big images


getImage

public javax.swing.ImageIcon getImage(java.lang.String name)
Return an imageicon from memory if cached, otherwise load it from disk.

Parameters:
name - Path to file located in the img/ folder
Returns:
ImageIcon representation of the image
See Also:
ImageIcon