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

Examples of org.locationtech.udig.project.internal.render.CompositeRenderContext


        compRenderer.eAdapters().add(adapterImpl);
        List<Renderer> renderers = compRenderer.children();
        for( Renderer renderer : renderers ) {
            renderer.eAdapters().add(listener);
        }
        CompositeRenderContext compContext = ((CompositeRenderContext)map.getRenderManagerInternal().getRenderExecutor().getContext());
        compContext.addListener(contextListener);
       
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(LayersView.ID);
        ApplicationGISInternal.getActiveEditor().setTesting(true);

    }
View Full Code Here


    protected String getRenderJobName() {
        if (jobName == null) {
            synchronized (this) {
                if (jobName == null) {
                    StringBuffer buffer = new StringBuffer("["); //$NON-NLS-1$
                    CompositeRenderContext context = (CompositeRenderContext) getContext();
                    for( IRenderContext rc : context.getContexts() ) {
                        buffer.append(rc.getLayer().getName());
                        buffer.append(","); //$NON-NLS-1$
                    }
                    buffer.replace(buffer.length() - 1, buffer.length(), "]"); //$NON-NLS-1$
                    jobName = buffer.toString();
View Full Code Here

         * @see org.locationtech.udig.project.internal.render.impl.RenderExecutorAdapters.ILayerListener#layerNotVisible(org.locationtech.udig.project.Layer,
         *      org.eclipse.emf.common.notify.Notification)
         */
        protected void layerNotVisible( Layer layer, Notification msg ) {
            executor.getContext().getLabelPainter().disableLayer(executor.getContext().getLayer().getID().toString());
            CompositeRenderContext context = ((RenderExecutorMultiLayer) executor).getContext();
            if (context.isVisible() && context.getContexts().size() > 1) {
                executor.getContext().getRenderManager().refresh(layer, (Envelope) null);
            } else {
                super.layerNotVisible(layer, msg);
            }
        }
View Full Code Here

        /**
         * @see org.locationtech.udig.project.internal.render.impl.RenderExecutorAdapters.ILayerListener#layerVisible(org.locationtech.udig.project.Layer,
         *      org.eclipse.emf.common.notify.Notification)
         */
        protected void layerVisible( Layer layer, Notification msg ) {
            CompositeRenderContext context = ((RenderExecutorMultiLayer) executor).getContext();

            executor.getContext().getLabelPainter().disableLayer(executor.getContext().getLayer().getID().toString());
            if (context.getContexts().size() > 1 )
                executor.getContext().getRenderManager().refresh(layer, (Envelope) null);
            else
                super.layerVisible(layer, msg);
        }
View Full Code Here

                        executor.getRenderer().setState(IRenderer.RENDER_REQUEST);
                    }
                }

                public void visit( RenderExecutorMultiLayer executor ) {
                    CompositeRenderContext contexts = executor.getContext();
                    for( IRenderContext context : contexts.getContexts() ) {
                        if (context.getLayer() == selectionLayer) {
                            executor.getRenderer().setState(IRenderer.RENDER_REQUEST);
                            return;
                        }
                    }
View Full Code Here

    private RenderExecutorComposite createRenderExecutor(ReferencedEnvelope bounds) {
        checkState();
       
        CompositeRendererImpl renderer = (CompositeRendererImpl)RenderFactory.eINSTANCE.createTiledCompositeRenderer();

        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();
            }

        };
       
        context.setMapInternal(getMapInternal());
        context.setRenderManagerInternal(this);
        context.setImageBounds(bounds);
        context.setImageSize(new Dimension(getTileSize(), getTileSize()));
       
        ((CompositeRenderContextImpl)context).setLabelPainterLocal(new UDIGLabelCache(new LabelCacheImpl()));
        renderer.setContext(context);
       
        renderer.setName(Messages.RenderManagerDynamic_allLayers);
View Full Code Here

        Rectangle rect = new Rectangle(size.width - 1, size.height - 1);
        layer.getStyleBlackboard().put(LocationStyleContent.ID, rect);
        layers.add(layer);

        MapGraphicRenderer renderer = new MapGraphicRenderer();
        CompositeRenderContext toUseForRendering = createRenderContext(info, layer);
        renderer.setContext(toUseForRendering);

        renderer.render(graphics, monitor);
    }
View Full Code Here

        }

        context.setLayerInternal(layer);
        context.setGeoResourceInternal(layer.getGeoResource());

        CompositeRenderContext toUseForRendering = new CompositeRenderContextImpl();
        toUseForRendering.addContexts(Collections.singleton(context));
        toUseForRendering.setRenderManagerInternal(context.getRenderManagerInternal());
        toUseForRendering.setMapInternal(context.getMapInternal());
        return toUseForRendering;
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.render.CompositeRenderContext

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.