Image scaled = (Image) scaledImageCaches[zoomIndex].get(base);
Dimension d = getImageBounds(base).getSize(); d.width *= scale; d.height *= scale; ScaledCacheKey key = new ScaledCacheKey(base, d); Image scaled = (Image) scaledImageCache.get(key);
    private Image getScaledImage(Image base) {        if (base == null) {            return null;        }        if ( zoomIndex == BASE_ZOOM_INDEX ) {            return base;        }                        Image scaled = (Image) scaledImageCaches[zoomIndex].get(base);        if (scaled == null) {        	Dimension d = getImageBounds(base).getSize();            d.width *= scale;            d.height *= scale;        	            scaled = scale(base, d.width, d.height);            MediaTracker tracker = new MediaTracker(this);            tracker.addImage( scaled, 1 );            // Wait for image to load            try{                tracker.waitForID( 1 );            } catch ( InterruptedException e ){ e.printStackTrace(); }                          scaledImageCaches[zoomIndex].put(base, scaled);        }        return scaled;    }