for( Iterator<IRenderMetricsFactory> iterator = factories.iterator(); iterator.hasNext(); ) {
IRenderMetricsFactory renderMetricsFactory = (IRenderMetricsFactory) iterator.next();
List<IGeoResource> data = layer.getGeoResources();
for( IGeoResource resource : data ) {
RenderContext context;
try{
if (IMultiLayerRenderer.class.isAssignableFrom(renderMetricsFactory.getRendererType())){
context = new CompositeRenderContextImpl();
}else{
context = new RenderContextImpl(layer instanceof SelectionLayer);
}
}catch (Throwable e){
context = new RenderContextImpl(layer instanceof SelectionLayer);
}
context.setMapInternal(manager.getMapInternal());
context.setRenderManagerInternal(manager);
context.setLayerInternal(layer);
context.setGeoResourceInternal(resource);
context.setImageSize(new Dimension(tilesize, tilesize));
context.setImageBounds(bounds);
try {
if (renderMetricsFactory.canRender(context)){
AbstractRenderMetrics metric = ((InternalRenderMetricsFactory.InternalRenderMetrics) renderMetricsFactory.createMetrics(context)).delegate;
// we need to assign an id here for the metrics sorting