if (mapAOI == null) {
return;
}
if (redrawBaseImage) {
MapPaneEvent ev = new MapPaneEvent(this, MapPaneEvent.Type.RENDERING_STARTED);
publishEvent(ev);
baseImage = new BufferedImage(curPaintArea.width + 1, curPaintArea.height + 1, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = baseImage.createGraphics();
g2d.fillRect(0, 0, curPaintArea.width + 1, curPaintArea.height + 1);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// renderer.setContext(context);
java.awt.Rectangle awtRectangle = Utils.toAwtRectangle(curPaintArea);
renderer.paint(g2d, awtRectangle, mapAOI, getWorldToScreenTransform());
// swtImage.dispose();
if (swtImage != null && !swtImage.isDisposed()) {
swtImage.dispose();
swtImage = null;
}
// System.out.println("READRAWBASEIMAGE");
swtImage = new Image(getDisplay(), awtToSwt(baseImage, curPaintArea.width + 1, curPaintArea.height + 1));
}
if (swtImage != null) {
drawFinalImage(swtImage);
}
MapPaneEvent ev = new MapPaneEvent(this, MapPaneEvent.Type.RENDERING_STOPPED);
publishEvent(ev);
clearLabelCache = true;
onRenderingCompleted();
redrawBaseImage = false;
}