/**
*
*/
private void initRenderExecutor() {
checkState();
MultiLayerRenderer renderExecutor = RenderFactory.eINSTANCE
.createCompositeRenderer();
CompositeRenderContext context = new CompositeRenderContextImpl() {
@Override
public synchronized BufferedImage getImage(int width, int height) {
if (image == null || image.getWidth() < width
|| image.getHeight() < height) {
image = new BufferedImage(width, height,
BufferedImage.TYPE_3BYTE_BGR);
Graphics2D g = image.createGraphics();
g.setBackground(Color.WHITE);
g.clearRect(0, 0, width, height);
g.dispose();
}
return image;
}
@Override
public synchronized void clearImage(Rectangle paintArea) {
if (image == null)
return;
Graphics2D g = image.createGraphics();
g.setBackground(Color.WHITE);
g.clearRect(paintArea.x, paintArea.y, paintArea.width,
paintArea.height);
g.dispose();
// // FIXME Arbonaut Oy , Vitali Diatchkov
// System.out.println(
// "synchronized CompositeRenderContext.clearImage()");
}
};
context.setMapInternal(getMapInternal());
context.setRenderManagerInternal(this);
renderExecutor.setContext(context);
initRenderCreator(context);
renderExecutor.setName(Messages.RenderManagerDynamic_allLayers);
setRenderExecutor(RenderFactory.eINSTANCE
.createRenderExecutor(renderExecutor));
}