spotlightImage.getHeight() != height) {
spotlightImage = new java.awt.image.BufferedImage
(width, height, java.awt.image.BufferedImage.TYPE_INT_ARGB);
}
Graphics2DWrapper sg = new Graphics2DWrapper(spotlightImage.createGraphics());
sg.antiAliasing(true);
if (dim) {
sg.setComposite(java.awt.AlphaComposite.Src);
sg.setColor(DIMMED);
sg.fillRect(0, 0, width, height);
} else {
sg.setComposite(java.awt.AlphaComposite.Clear);
sg.setColor(DIMMED);
sg.fillRect(0, 0, width, height);
}
if (wrap) {
topology.wrapDrawable(this, sg, xcor, ycor, spotlightSize, patchSize);
} else {
sg.push();
double size = spotlightSize * patchSize + adjustSize(spotlightSize, patchSize);
double offset = size / 2.0;
double x = topology.graphicsX(xcor, patchSize) - offset;
double y = topology.graphicsY(ycor, patchSize) - offset;
sg.translate(x, y);
draw(sg, size);
sg.pop();
}
sg.antiAliasing(false);
return spotlightImage;
}