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

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


  /**
     *
     */
  private void initRenderExecutor() {
    checkState();
    MultiLayerRenderer renderExecutor = RenderFactory.eINSTANCE
        .createCompositeRenderer();
    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();
        // // FIXME Arbonaut Oy , Vitali Diatchkov
        // System.out.println(
        // "synchronized CompositeRenderContext.clearImage()");
      }

    };
    context.setMapInternal(getMapInternal());
    context.setRenderManagerInternal(this);
   
    renderExecutor.setContext(context);

    initRenderCreator(context);

    renderExecutor.setName(Messages.RenderManagerDynamic_allLayers);
    setRenderExecutor(RenderFactory.eINSTANCE
        .createRenderExecutor(renderExecutor));
  }
View Full Code Here


     */
    @Override
    protected T doSwitch(int classifierID, EObject theEObject) {
        switch (classifierID) {
        case RenderPackage.MULTI_LAYER_RENDERER: {
            MultiLayerRenderer multiLayerRenderer = (MultiLayerRenderer) theEObject;
            T result = caseMultiLayerRenderer(multiLayerRenderer);
            if (result == null)
                result = caseRenderer(multiLayerRenderer);
            if (result == null)
                result = caseIMultiLayerRenderer(multiLayerRenderer);
View Full Code Here

            };
            final Thread jobThread = new Thread(job);
            jobThread.start();
            jobThread.join();
           
        MultiLayerRenderer renderer=(MultiLayerRenderer) RenderFactory.eINSTANCE.createCompositeRenderer();
        RenderContext context=new CompositeRenderContextImpl();
        context.setRenderManagerInternal(rm);
        context.setMapInternal(map);
            context.setGeoResourceInternal(layer.getGeoResources().get(0));
            context.setLayerInternal(layer);
        renderer.setContext(context);
        context = rm.getRendererCreator().getConfiguration().iterator().next();
        ((CompositeRenderContext) renderer.getContext()).addContexts(Collections.singleton(context));
        RenderExecutor ex=RenderFactory.eINSTANCE.createRenderExecutor(renderer);
        rm.setRenderExecutor(ex);
        }
    return map;
  }
View Full Code Here

TOP

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

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.