Tile tile = getOrCreateTile(referencedEnvelope);
boolean rendertile = (tile.getRenderState() == Tile.RenderState.INVALID || tile.getRenderState() == Tile.RenderState.NEW);
tile.setTileState(Tile.ValidatedState.VALIDATED);
RenderExecutorComposite re = tile.getRenderExecutor();
// creates the contexts - this function returns the "new" contexts; these are the ones
//that need to be refreshed.
List<AbstractRenderMetrics> forrefresh = null;
if (tile.getContextState() == Tile.ContextState.INVALID){
forrefresh = validateRendererConfiguration(tile);
tile.setContextState(Tile.ContextState.OKAY);
if (forrefresh == null){
rendertile = true;
}
}
if (!rendertile && forrefresh != null ){
//only refresh the layers that have changed
for(AbstractRenderMetrics context : forrefresh){
//kick the child renderer that has been updated
List<TiledCompositeRendererImpl.RenderInfo> kids = ((TiledCompositeRendererImpl)re.getRenderer()).getChildren();
for (TiledCompositeRendererImpl.RenderInfo r : kids){
if (r.getMetrics().getRenderContext().equals(context.getRenderContext())){
//we need to render this layer
// layer to refresh
r.getExecutor().getRenderer().setRenderBounds(referencedEnvelope);
r.getExecutor().getRenderer().setState(IRenderer.RENDER_REQUEST);
}
}
}
}else if (rendertile){
// if (re.getState() != IRenderer.STARTING) { // && re.getState() != IRenderer.RENDERING){
// re.setState(IRenderer.STARTING);
// re.setRenderBounds(referencedEnvelope);
// re.render();
List<TiledCompositeRendererImpl.RenderInfo> kids = ((TiledCompositeRendererImpl)re.getRenderer()).getChildren();
for (TiledCompositeRendererImpl.RenderInfo r : kids){
// layer to refresh
r.getExecutor().getRenderer().setRenderBounds(referencedEnvelope);
r.getExecutor().getRenderer().setState(IRenderer.RENDER_REQUEST);
}
re.setState(IRenderer.RENDER_REQUEST);
// }
}
}
if (!getMapInternal().getContextModel().eAdapters().contains(contextModelAdapter)){