private synchronized BufferedImage createResponse() {
if (image == null) {
if (cMapLegendCreator != null)
image = cMapLegendCreator.getLegend();
else {
image = ImageUtils.createImage(width, height, (IndexColorModel) null, transparent);
final Graphics2D graphics =
ImageUtils.prepareTransparency(
transparent,
bgColor,
image,
new HashMap<RenderingHints.Key, Object>());
if (defaultLegend == null) {
drawRasterIcon(graphics);
} else {
graphics.setRenderingHint(
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
graphics.drawImage(defaultLegend, 0, 0, width, height, null);
}
graphics.dispose();
}
}
return image;
}