/** * Returns the scaled Image of the source Figure. If the Image needs to be updated, the * ThumbnailUpdater will notified. * * @return The thumbnail image */ protected Image getThumbnailImage() { Dimension oldSize = targetSize; targetSize = getPreferredSize(); targetSize.expand(new Dimension(getInsets().getWidth(), getInsets().getHeight()).negate()); setScales( targetSize.width / (float) getSourceRectangle().width, targetSize.height / (float) getSourceRectangle().height); if ((isDirty()) && !updater.isRunning()) updater.start(); else if (oldSize != null && !targetSize.equals(oldSize)) { revalidate(); updater.restart(); } return thumbnailImage; }
/** Deactivates this Thumbnail. */ public void deactivate() { sourceFigure.getUpdateManager().removeUpdateListener(this); updater.deactivate(); }