Image i = getImage(); if (i != null) { if (zoom == 1.0) { return i; } else { return i.getScaledInstance(
if (zoom == 1.0) { return getImage(); } else if (zoom == myZoom && scaledImage != null) { return scaledImage; } else { Image img = getImage(); if (img != null) { scaledImage = img.getScaledInstance(
    public Image getScaledImage(double zoom) {        Image i = getImage();        if (i != null) {            if (zoom == 1.0) {                return i;            } else {                return i.getScaledInstance(                        (int)(getWidth() * zoom), (int)(getHeight() * zoom),                        BufferedImage.SCALE_SMOOTH);            }        }        return null;    }