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

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


    /**
     * @param renderer
     */
    protected RenderExecutor createRenderExecutor( Renderer renderer ) {
         final RenderExecutor executor = RenderFactory.eINSTANCE.createRenderExecutor(renderer);
        executor.eAdapters().add(new RenderListenerAdapter(){

            /**
             * @see org.locationtech.udig.project.internal.render.RenderListenerAdapter#renderDisposed(org.eclipse.emf.common.notify.Notification)
             */
            protected void renderDisposed( Notification msg ) {
                EObject obj = (EObject) getTarget();
                obj.eAdapters().remove(this);
            }

            /**
             * @see org.locationtech.udig.project.internal.render.RenderListenerAdapter#renderDone()
             */
            protected void renderDone() {
               setState(DONE);
            }

            protected void renderRequest() {
                setRenderBounds(executor.getRenderBounds());
                setState(RENDER_REQUEST);
            }

            @Override
            protected void renderStarting() {
View Full Code Here


     *
     * @param renderer the renderer that has been removed
     */
    protected RenderExecutor findExecutor( IRenderContext context ) {
        for( Iterator<RenderExecutor> eIter = getRenderExecutors().iterator(); eIter.hasNext(); ) {
            RenderExecutor executor = (RenderExecutor) eIter.next();
            if (executor.getRenderer().getContext().equals(context))
                return executor;
        }
        return null;
    }
View Full Code Here

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public void setRenderExecutor(RenderExecutor newRenderExecutor) {
        RenderExecutor oldRenderExecutor = renderExecutor;
        renderExecutor = newRenderExecutor;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    RenderPackage.RENDER_MANAGER__RENDER_EXECUTOR, oldRenderExecutor,
                    renderExecutor));
View Full Code Here

     * and set the state for the executor.
     *
     * @param renderer
     */
    protected RenderExecutor createRenderExecutor( Renderer renderer ) {
         final RenderExecutor executor = RenderFactory.eINSTANCE.createRenderExecutor(renderer);
        
        executor.eAdapters().add(new RenderListenerAdapter(){

            /**
             * @see org.locationtech.udig.project.internal.render.RenderListenerAdapter#renderDisposed(org.eclipse.emf.common.notify.Notification)
             */
            protected void renderDisposed( Notification msg ) {
                EObject obj = (EObject) getTarget();
                obj.eAdapters().remove(this);
            }

            /**
             * @see org.locationtech.udig.project.internal.render.RenderListenerAdapter#renderDone()
             */
            protected void renderDone() {
               setState(DONE);
            }

            protected void renderRequest() {
                setRenderBounds(executor.getRenderBounds());
                setState(RENDER_REQUEST);
            }

            @Override
            protected void renderStarting() {
View Full Code Here

     */
    public void addChild(AbstractRenderMetrics metrics){
        synchronized (childrenRenderers) {
            Renderer render = metrics.createRenderer();
            render.setContext(metrics.getRenderContext());
            RenderExecutor executor = createRenderExecutor(render);
            RenderInfo ri = new RenderInfo(executor, metrics);
            childrenRenderers.add(ri);
        }
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case RenderPackage.RENDER_EXECUTOR: {
            RenderExecutor renderExecutor = (RenderExecutor) theEObject;
            T result = caseRenderExecutor(renderExecutor);
            if (result == null)
                result = caseRenderer(renderExecutor);
            if (result == null)
                result = caseIRenderer(renderExecutor);
View Full Code Here

   * Test method for 'org.locationtech.udig.project.internal.render.impl.RenderExecutorImpl.render(Envelope, IProgressMonitor)'
   */
  @Ignore
    @Test
  public void testRenderEnvelopeIProgressMonitor() throws Exception {
    RenderExecutor ex=map.getRenderManagerInternal().getRenderExecutor();
    BufferedImage image = ex.getContext().getImage(w,h);

        testImage(image,true, -1,-1,-1,-1);
       
    int minx=30;
    int miny=0;
    int maxx=300;
    int maxy=120;
    ex.setRenderBounds(new Envelope(minx, maxx, miny, maxy));
    ex.render();
   
    Platform.getJobManager().join(map.getRenderManager(), new NullProgressMonitor());
   
    showImage( "testRenderEnvelopeIProgressMonitor", image); //$NON-NLS-1$
    testImage(image, false, minx, 512-maxy,maxx,512-miny );
    assertTrue(image==ex.getContext().getImage(w,h));
   
  }
View Full Code Here

   * Test method for 'org.locationtech.udig.project.internal.render.impl.RenderExecutorImpl.render(Envelope, IProgressMonitor)'
   */
  @Ignore
    @Test
  public void testRenderRectangle() throws Exception {
    RenderExecutor ex=map.getRenderManagerInternal().getRenderExecutor();
    BufferedImage image = ex.getContext().getImage(w,h);


        testImage(image,true, -1,-1,-1,-1);
       
   
    int minx=30;
    int miny=270;
    int maxx=300;
    int maxy=470;
        ex.setRenderBounds(new Rectangle(minx,miny, maxx-minx, maxy-miny));
    ex.render();
       

    Platform.getJobManager().join(map.getRenderManager(), new NullProgressMonitor());
   
    BufferedImage image2 = ex.getContext().getImage(w,h);
    assertEquals( image, image2 );
   
    showImage( "testRenderRectangle", image ); //$NON-NLS-1$

    testImage(image, false, minx, miny,maxx,maxy);
    assertTrue(image==ex.getContext().getImage());

  }
View Full Code Here

   * Test method for 'org.locationtech.udig.project.internal.render.impl.RenderExecutorImpl.render()'
   */
  @Ignore
    @Test
  public void testRender() throws Exception {
    RenderExecutor ex=map.getRenderManagerInternal().getRenderExecutor();
    BufferedImage image = ex.getContext().getImage(w,h);

        testImage(image,true, -1,-1,-1,-1);
       
   
    map.getRenderManagerInternal().getRenderExecutor().render();
   

    Platform.getJobManager().join(map.getRenderManager(), new NullProgressMonitor());

    BufferedImage image2 = ex.getContext().getImage(w,h);
    assertEquals( image, image2 );
   
    showImage("testRender",image); //$NON-NLS-1$
   

    testImage(image, false, 0,0,512,512);
    assertTrue(image==ex.getContext().getImage(w,h));
  }
View Full Code Here

   * Test method for 'org.locationtech.udig.project.internal.render.impl.RenderExecutorImpl.render(Envelope)'
   */
    @Ignore
    @Test
  public void testRenderEnvelope() throws Exception {
    RenderExecutor ex=map.getRenderManagerInternal().getRenderExecutor();
    BufferedImage image = ex.getContext().getImage();


        testImage(image,true, -1,-1,-1,-1);
       
   
    int minx=30;
    int miny=0;
    int maxx=300;
    int maxy=120;
        ex.setRenderBounds(new Envelope(minx, maxx, miny, maxy));
    ex.render();

    Platform.getJobManager().join(map.getRenderManager(), new NullProgressMonitor());
   
    BufferedImage image2 = ex.getContext().getImage();
    assertEquals( image, image2 );
    RenderExecutor executor = ((CompositeRendererImpl) ex.getRenderer()).getRenderExecutors().iterator().next();
        BufferedImage rendererImage=executor.getContext().getImage();
        showImage( "testRenderEnvelope", image ); //$NON-NLS-1$
       
        testImage(image, false, minx, 512-maxy,maxx,512-miny );
    assertTrue(image==ex.getContext().getImage());
        Graphics2D graphics = rendererImage.createGraphics();
View Full Code Here

TOP

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

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.