/** * Adds an image associated with a location string to this factory's cache. * The image will be scaled as dictated by this current factory settings. * * @param location the location string uniquely identifying the image * @param image the actual image * @return the final image added to the cache. This may be a scaled version * of the original input image. */ public Image addImage(String location, Image image) { if ( m_maxImageWidth > -1 || m_maxImageHeight > -1 ) { image = getScaledImage(image); image.getWidth(null); // trigger image load } imageCache.put(location, image); return image; }