if (scaledImage == null || zoom != myZoom) { scaledImage = getScaledImage(zoom); myZoom = zoom; if (scaledImage != null) { MediaTracker mediaTracker = new MediaTracker(new Canvas()); mediaTracker.addImage(scaledImage, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { System.err.println(ie); return; } mediaTracker.removeImage(scaledImage); g.drawImage( scaledImage, x, y, null); } else {   }
Image img = getScaledImage(zoom); if (img != null) { g.drawImage(img, x, y - img.getHeight(null), null);
    public void drawRaw(Graphics g, int x, int y, double zoom) {        if (scaledImage == null || zoom != myZoom) {            scaledImage = getScaledImage(zoom);            myZoom = zoom;            if (scaledImage != null) {                MediaTracker mediaTracker = new MediaTracker(new Canvas());                mediaTracker.addImage(scaledImage, 0);                try {                    mediaTracker.waitForID(0);                }                catch (InterruptedException ie) {                    System.err.println(ie);                    return;                }                mediaTracker.removeImage(scaledImage);                g.drawImage(                        scaledImage, x, y, null);            } else {                // TODO: Allow drawing IDs when no image data exists as a                // config option            }        } else {            g.drawImage(scaledImage, x, y, null);        }    }