return;
}
final Monitor monitor = imageSynch;
Rectangle clip = g1.getClipBounds();
try {
synchronized (monitor) {
Dimension currentSize = new Dimension(getWidth(), getHeight());
Graphics2D g = (Graphics2D) g1;
g.clipRect(0, 0, currentSize.width, currentSize.height);
g.setBackground(background);
Composite cps = g.getComposite();
g.setColor(g.getBackground());
if (isOpaque()) {
g.fillRect(0, 0, currentSize.width, currentSize.height);
}
g.setColor(Color.BLACK);
AffineTransform bgResizeTx = AffineTransform.getScaleInstance((double) ((float) currentSize.width) / ((float) bgImg.getWidth(this)), (double) ((float) currentSize.height) / ((float) bgImg.getHeight(this)));
AffineTransform dispResizeTx = AffineTransform.getScaleInstance((double) ((float) currentSize.width) / ((float) display.getWidth(this)), (double) ((float) currentSize.height) / ((float) display.getHeight(this)));
if (!currentImageSize.equals(currentSize)) {
mt.addImage(bgImg, hashCode(), currentSize.width, currentSize.height);
}
if (!tx.equals(currentTx)) {
Rectangle box = this.tx.createTransformedShape(new Rectangle(0, 0, display.getWidth(this), display.getHeight(this))).getBounds();
if (!new Dimension(display.getWidth(this), display.getHeight(this)).equals(box.getSize())) {
mt.addImage(display, hashCode(), box.width, box.height);
}
mt.waitForAll();
cps = g.getComposite();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.33f));
if (opaque) {
g.drawImage(bgImg, bgResizeTx, this);
}
g.setComposite(cps);
g.drawImage(display, tx, this);
currentTx = tx;
} else {
if (!currentImageSize.equals(currentSize)) {
mt.addImage(display, hashCode(), currentSize.width, currentSize.height);
}
mt.waitForAll();
cps = g.getComposite();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.33f));
if (opaque) {
g.drawImage(bgImg, bgResizeTx, this);
}
g.setComposite(cps);
g.drawImage(display, dispResizeTx, this);
currentImageSize = currentSize;
}
mt.removeImage(bgImg, hashCode());
mt.removeImage(display, hashCode());
monitor.notify();
}
} catch (InterruptedException ex) {