Index: trunk/src/org/openstreetmap/josm/tools/ImageResource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 6159)
+++ trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 6160)
@@ -1,6 +1,4 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.tools;
-
-import com.kitfox.svg.SVGDiagram;
 
 import java.awt.Dimension;
@@ -8,5 +6,8 @@
 import java.awt.image.BufferedImage;
 import java.util.HashMap;
+
 import javax.swing.ImageIcon;
+
+import com.kitfox.svg.SVGDiagram;
 
 /**
@@ -16,4 +17,5 @@
  * In the first case, 'svg' is not null and in the latter case, 'imgCache' has
  * at least one entry for the key DEFAULT_DIMENSION.
+ * @since 4271
  */
 class ImageResource {
@@ -22,9 +24,9 @@
      * Caches the image data for resized versions of the same image.
      */
-    private HashMap<Dimension, BufferedImage> imgCache = new HashMap<Dimension, BufferedImage>();
+    private HashMap<Dimension, Image> imgCache = new HashMap<Dimension, Image>();
     private SVGDiagram svg;
     public static final Dimension DEFAULT_DIMENSION = new Dimension(-1, -1);
 
-    public ImageResource(BufferedImage img) {
+    public ImageResource(Image img) {
         CheckParameterUtil.ensureParameterNotNull(img);
         imgCache.put(DEFAULT_DIMENSION, img);
@@ -45,9 +47,10 @@
      *          and (width, -1) to set the width, but otherwise scale the image
      *          proportionally.
+     * @return ImageIcon object for the image of this resource, scaled according to dim
      */
     public ImageIcon getImageIcon(Dimension dim) {
         if (dim.width < -1 || dim.width == 0 || dim.height < -1 || dim.height == 0)
             throw new IllegalArgumentException();
-        BufferedImage img = imgCache.get(dim);
+        Image img = imgCache.get(dim);
         if (img != null) {
             return new ImageIcon(img);
@@ -61,5 +64,5 @@
             return new ImageIcon(img);
         } else {
-            BufferedImage base = imgCache.get(DEFAULT_DIMENSION);
+            Image base = imgCache.get(DEFAULT_DIMENSION);
             if (base == null) throw new AssertionError();
 
@@ -86,4 +89,5 @@
      * @param maxSize The maximum size. One of the dimensions (widht or height) can be -1,
      * which means it is not bounded.
+     * @return ImageIcon object for the image of this resource, scaled down if needed, according to maxSize
      */
     public ImageIcon getImageIconBounded(Dimension maxSize) {
@@ -96,5 +100,5 @@
             realHeight = svg.getHeight();
         } else {
-            BufferedImage base = imgCache.get(DEFAULT_DIMENSION);
+            Image base = imgCache.get(DEFAULT_DIMENSION);
             if (base == null) throw new AssertionError();
             ImageIcon icon = new ImageIcon(base);
