Package org.locationtech.udig.project.internal.render.impl

Examples of org.locationtech.udig.project.internal.render.impl.RenderExecutorComposite$CompositeRendererJob


     *
     * @param key
     * @return
     */
    private Tile createTile(ReferencedEnvelope key){
        RenderExecutorComposite newRE = createRenderExecutor(key);
        Tile tile = new Tile(key, newRE, getTileSize());
        tile.setStateChangedListener(tileStateListener);
        importantTiles.add(tile);
        ((RenderContextImpl)newRE.getContext()).setLabelPainterLocal(newRE.getContext().getLabelPainter());
        return tile;
    }
View Full Code Here


            Tile tile = getOrCreateTile(env);
           
            tile.setTileState(Tile.ValidatedState.VALIDATED);
            tile.setRenderState(Tile.RenderState.RENDERED);
           
            RenderExecutorComposite re = tile.getRenderExecutor();
           
            //validate the context if necessary
            List<AbstractRenderMetrics> torefresh = new ArrayList<AbstractRenderMetrics>();
            if (tile.getContextState() == Tile.ContextState.INVALID){
                torefresh = validateRendererConfiguration(tile);
                tile.setContextState(Tile.ContextState.OKAY);
            }
           
            //determine which layers need to be updated
            Collection<ILayer> layersToUpdate = new ArrayList<ILayer>();
            layersToUpdate.add(layer);
            if (selectionLayer != null) layersToUpdate.add(selectionLayer);
            if (torefresh != null){
                for( AbstractRenderMetrics metrics : torefresh ) {
                    layersToUpdate.add(metrics.getRenderContext().getLayer());
                }
            }
         
            for( final ILayer newlayer : layersToUpdate) {
                re.visit(new ExecutorVisitor(){
                    public void visit( RenderExecutor executor ) {
                        if (executor.getContext().getLayer() == newlayer) {
                            // layer to refresh
                            executor.getRenderer().setRenderBounds(bbox);
                            // register request
View Full Code Here

        for( ReferencedEnvelope env : tileBounds ) {
            Tile tile = getOrCreateTile(env);
           
            tile.setRenderState(Tile.RenderState.RENDERED);
            tile.setTileState(Tile.ValidatedState.VALIDATED);
            RenderExecutorComposite re = tile.getRenderExecutor();
        
            // creates the contexts
            if (tile.getContextState() == Tile.ContextState.INVALID){
                validateRendererConfiguration(tile);
                tile.setContextState(Tile.ContextState.OKAY);
            }

            final Envelope bbox = env;

            //set render requests for the selection layer
            re.visit(new ExecutorVisitor(){

                public void visit( RenderExecutor executor ) {
                    IRenderContext context = executor.getContext();
                    if (selectionLayer == context.getLayer()) {
                        executor.getRenderer().setRenderBounds(bbox);
View Full Code Here

     * @param tile
     */
    public void renderTile( Tile tile ) {
        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(tile.getReferencedEnvelope());
                        r.getExecutor().getRenderer().setState(IRenderer.RENDER_REQUEST);
                    }
                }
            }
        } else if (rendertile) {
            // refresh all layers 
            re.setRenderBounds(tile.getReferencedEnvelope());
            re.render();
        }
        tile.setRenderState(Tile.RenderState.RENDERED);
        refreshImage();
    }
View Full Code Here

           
            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)){
View Full Code Here

        for( Iterator<ReferencedEnvelope> iterator = tileBounds.iterator(); iterator.hasNext(); ) {
            ReferencedEnvelope referencedEnvelope = (ReferencedEnvelope) iterator.next();

            Tile tile = getOrCreateTile(referencedEnvelope);

            RenderExecutorComposite re = tile.getRenderExecutor();
            if (tile.getRenderState() == Tile.RenderState.INVALID) {
                re.setRenderBounds(tile.getReferencedEnvelope());
                re.getRenderer().setState(IRenderer.RENDER_REQUEST);
                re.render();
            } else {
                //kick the renderer to refresh the image
               re.getRenderer().setState(IRenderer.DONE);
            }
            tile.setRenderState(Tile.RenderState.RENDERED);
        }
    }
View Full Code Here

        checkState();
   
        if (rendererCreator == null){
            initRenderCreator();
        }
        RenderExecutorComposite re = t.getRenderExecutor();
        TiledCompositeRendererImpl renderer = null;
        try{
            renderer = (TiledCompositeRendererImpl)re.getRenderer();
        }catch (Exception ex){
            ProjectPlugin.log("Error creating context for tile - Tile does not have a renderer.", ex); //$NON-NLS-1$
            return null;
        }
       
View Full Code Here

        ((CompositeRenderContextImpl)context).setLabelPainterLocal(new UDIGLabelCache(new LabelCacheImpl()));
        renderer.setContext(context);
       
        renderer.setName(Messages.RenderManagerDynamic_allLayers);
       
        RenderExecutorComposite renderExecutor = (RenderExecutorComposite)RenderFactory.eINSTANCE.createRenderExecutor(renderer);
        renderExecutor.setName("Tiled (" + bounds.hashCode() + "): " + bounds.toString()); //$NON-NLS-1$ //$NON-NLS-2$
        renderExecutor.eAdapters().add(renderExecutorListener);
       
        return renderExecutor;
    }
View Full Code Here

        if (t == null){
            //no tile found
            return false;
        }

        RenderExecutorComposite parent  = t.getRenderExecutor();
        Collection<TiledCompositeRendererImpl.RenderInfo>  kids = ((TiledCompositeRendererImpl)parent.getRenderer()).getChildren();
       
        for( Iterator<TiledCompositeRendererImpl.RenderInfo> iterator = kids.iterator(); iterator.hasNext(); ) {
            TiledCompositeRendererImpl.RenderInfo kid = iterator.next();
            IRenderContext childcontext = kid.getRenderer().getContext()
            ;
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.render.impl.RenderExecutorComposite$CompositeRendererJob

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.