ApplicationGIS.class,
"ApplicationGIS.drawMap() beginning rendering of map '" + map.getName() + "'", null); //$NON-NLS-1$ //$NON-NLS-2$
ReferencedEnvelope bounds = (ReferencedEnvelope) params.toDraw.getViewportModel().getBounds();
ReferencedEnvelope boundsCopy = new ReferencedEnvelope(bounds);
RenderContext tools = configureMapForRendering(map, params.destinationSize, params.dpi, params.boundsStrategy, boundsCopy);
RendererCreator decisive = new RendererCreatorImpl();
decisive.setContext(tools);
decisive.getLayers().addAll(layersToRender);
SortedSet<RenderContext> sortedContexts = new TreeSet<RenderContext>(
decisive.getConfiguration());
render(params, monitor, decisive, sortedContexts);
}
private void render(final DrawMapParameter params,
IProgressMonitor monitor, RendererCreator decisive,
SortedSet<RenderContext> sortedContexts)
throws InvocationTargetException {
monitor.beginTask("Rendering map", sortedContexts.size());
RenderContext mainContext = decisive.getContext();
ILabelPainter labelPainter = mainContext.getLabelPainter();
labelPainter.clear();
labelPainter.start();
Dimension displaySize = params.destinationSize;
Iterator<RenderContext> iter = sortedContexts.iterator();
while (iter.hasNext()) {
RenderContext context = (RenderContext) iter.next();
ILayer layer = context.getLayer();
boolean isLayerFromGrid = layer.getGeoResource().canResolve(GridCoverage.class);
String layerId = getLayerId(layer);
if( !(layer instanceof SelectionLayer) ||
((layer instanceof SelectionLayer) && params.selectionStyle.getShowLabels()) ){