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

Examples of org.locationtech.udig.project.internal.render.impl.RendererCreatorImpl$DumbRenderer


        LayerImpl layer = MapTests.createLayer(null, new RendererCreatorTestObjForSingleRenderer(), null);
        layer.setName("Layer1"); //$NON-NLS-1$
        Map map=layer.getMapInternal();
        LayerImpl layer2 = MapTests.createLayer(null, new RendererCreatorTestObjForSingleRenderer(), map);
        layer2.setName("Layer2"); //$NON-NLS-1$
        RendererCreatorImpl creator = MapTests.createRendererCreator(layer.getMapInternal());

        layer.getBlackboard().clear();
        layer2.getBlackboard().clear();
        map.getBlackboard().clear();
       
        NotificationImpl notificationImpl = new ENotificationImpl((InternalEObject) layer.getContextModel(), Notification.ADD_MANY,
                ProjectPackage.CONTEXT_MODEL__LAYERS, null, Arrays.asList(new Layer[]{layer,layer2}));
        creator.changed(notificationImpl);
       
        sameRenderer(creator, SingleRenderer.class, 2);
       
        layer.getBlackboard().put(RendererCreator.LAST_RESORT_RENDERER_ID, "org.locationtech.udig.project.tests.single"); //$NON-NLS-1$
       
View Full Code Here


       
        StyleBlackboard bb = layer.getStyleBlackboard();
       
        bb.put(SingleRendererStyleContent.ID, new SingleRendererStyleContent());
       
        RendererCreatorImpl creator = MapTests.createRendererCreator(layer.getMapInternal());
       
        NotificationImpl notificationImpl = new ENotificationImpl((InternalEObject) layer.getContextModel(), Notification.ADD,
                ProjectPackage.CONTEXT_MODEL__LAYERS, null, layer);
        creator.changed(notificationImpl);
       
        sameRenderer(creator, SingleRenderer.class, 1);

        bb.clear();
        bb.put(MultiRendererStyleContent.ID, new MultiRendererStyleContent());
View Full Code Here

   
    @Test
    public void testBadMetrics() throws Exception {
        LayerImpl layer = MapTests.createLayer(null, BadRenderMetricsFactory.ALWAYS_EXCEPTION, null);
       
        RendererCreatorImpl creator = MapTests.createRendererCreator(layer.getMapInternal());
        creator.getLayers().add(layer);
       
        Collection<RenderContext> configuration = creator.getConfiguration();
       
        assertEquals(0, configuration.size());
       
        layer = MapTests.createLayer(null, BadRenderMetricsFactory.CAN_RENDER_NO_EXCEPTION, null);
       
        creator.getLayers().clear();
        creator.getLayers().add(layer);

        creator.reset();
        configuration = creator.getConfiguration();
       
        assertEquals(1, configuration.size());
        assertTrue( creator.getRenderer(configuration.iterator().next()) instanceof PlaceHolder );
       
        layer = MapTests.createLayer(null, BadRenderMetricsFactory.CAN_CREATE_METRICS, null);
       
        creator.getLayers().clear();
        creator.getLayers().add(layer);

        creator.reset();
        configuration = creator.getConfiguration();
       
        assertEquals(1, configuration.size());
        assertTrue( creator.getRenderer(configuration.iterator().next()) instanceof PlaceHolder );
       
        layer = MapTests.createLayer(null, BadRenderMetricsFactory.CAN_ADD_LAYER_EXCEPTION, null);
       
        creator.getLayers().clear();
        layer.setName("layer1"); //$NON-NLS-1$
        creator.getLayers().add(layer);
        layer = MapTests.createLayer(null, BadRenderMetricsFactory.CAN_ADD_LAYER_EXCEPTION, layer.getMapInternal());
        layer.setName("layer2"); //$NON-NLS-1$
        creator.getLayers().add(layer);
       
        creator.reset();
        configuration = creator.getConfiguration();
       
        assertEquals(2, configuration.size());
        Iterator<RenderContext> iter = configuration.iterator();
        assertFalse( creator.getRenderer(iter.next()) instanceof PlaceHolder );
        assertFalse( creator.getRenderer(iter.next()) instanceof PlaceHolder );
       
    }
View Full Code Here

            map.getLayersInternal().add(testLayer);
        return testLayer;
    }

    public static RendererCreatorImpl createRendererCreator( Map map ) {
        RendererCreatorImpl creator= new RendererCreatorImpl();
        RenderContextImpl renderContextImpl = new RenderContextImpl();
        renderContextImpl.setMapInternal(map);
        renderContextImpl.setRenderManagerInternal(map.getRenderManagerInternal());
        creator.setContext(renderContextImpl);
        if( !creator.getConfiguration().isEmpty() )
            throw new AssertionError("configuration should be empty on creation"); //$NON-NLS-1$
        return creator;
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.render.impl.RendererCreatorImpl$DumbRenderer

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.