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

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


    }

    private void firstLayerR2SecondR1( RendererCreatorImpl creator ) {
        Collection<RenderContext> configuration;
        Iterator<RenderContext> iter;
        Renderer renderer;
        creator.reset();
        configuration = creator.getConfiguration();
        assertEquals(2, configuration.size());
        iter = configuration.iterator();
       
View Full Code Here


        this.latencyMetric = LATENCY_NETWORK_CACHE;
        this.resolutionMetric = RES_PIXEL;
    }

    public Renderer createRenderer() {
        Renderer renderer=new BasicWMTRenderer();
        renderer.setContext(context);
       
        return renderer;
    }
View Full Code Here

    /**
     * @see org.locationtech.udig.project.render.IRenderMetrics#createRenderer()
     */
    public Renderer createRenderer() {
        Renderer renderer = new ShapefileFeatureRenderer();
        renderer.setContext(context);
        renderer.setName(context.getLayer().getName());
        return renderer;
    }
View Full Code Here

    /**
     * @see org.locationtech.udig.project.render.IRenderMetrics#createRenderer()
     */
    public Renderer createRenderer() {
        Renderer renderer = new BasicFeatureRenderer();
        renderer.setContext(context);
        renderer.setName(context.getLayer().getName());
        return renderer;
    }
View Full Code Here

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public void setRendererGen(Renderer newRenderer) {
        Renderer oldRenderer = renderer;
        renderer = newRenderer;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    RenderPackage.RENDER_EXECUTOR__RENDERER, oldRenderer, renderer));
    }
View Full Code Here

    RenderedImage getImage() {
        if (!Platform.isRunning())
            return null;
        try {
            RenderExecutor renderExecutor = renderManager.getRenderExecutor();
            Renderer renderer = renderExecutor.getRenderer();
            if (renderer.getState() == IRenderer.DISPOSED)
                return null;
            IRenderContext context = renderer.getContext();
            return context.getImage();
        } catch (Throwable e) {
            ProjectUIPlugin.log(null, e);
            return null;
        }
View Full Code Here

     * to the renderer parameter.
     *
     * @return The closest renderexecutor for the renderer.
     */
    private RenderExecutor locateClosestFit(Renderer r) {
        Renderer ofInterest = r;
        if (r instanceof RendererDecorator) {
            ofInterest = ((RendererDecorator) r).getRenderer();
        }
        final Renderer renderer = ofInterest;
        List<IConfigurationElement> list = new ArrayList<IConfigurationElement>();
        for (Iterator<IConfigurationElement> iter = ExtensionPointList.getExtensionPointList(
                RenderExecutor.EXTENSION_ID).iterator(); iter.hasNext();) {
            IConfigurationElement elem = iter.next();
            try {
                Bundle bundle = Platform.getBundle(elem.getNamespaceIdentifier());
                Class<?> rendererClass = bundle.loadClass(elem
                        .getAttribute(RenderExecutor.RENDERER_ATTR));
                if (rendererClass.isAssignableFrom(renderer.getClass()))
                    list.add(elem);
            } catch (Exception e) {
                ProjectPlugin.log(null, e);
                // do nothing
            }
        }
        if (!list.isEmpty()) {
            Collections.sort(list, new Comparator<IConfigurationElement>() {

                public int compare(IConfigurationElement o1, IConfigurationElement o2) {
                    try {
                        Bundle bundle = Platform.getBundle(o1.getNamespaceIdentifier());
                        Class clazz1 = bundle.loadClass(o1
                                .getAttribute(RenderExecutor.RENDERER_ATTR));

                        bundle = Platform.getBundle(o2.getNamespaceIdentifier());
                        Class clazz2 = bundle.loadClass(o2
                                .getAttribute(RenderExecutor.RENDERER_ATTR));

                        int dist1 = getDistance(renderer.getClass(), clazz1);
                        int dist2 = getDistance(renderer.getClass(), clazz2);
                        if (dist1 == dist2)
                            return 0;
                        return dist1 < dist2 ? -1 : 1;
                    } catch (Exception e) {
                        ProjectPlugin.log(null, e);
View Full Code Here

     * class passed in as a parameter
     *
     * @return a renderExecutor for the renderer
     */
    private RenderExecutor locateMatch(Renderer renderer) {
        Renderer ofInterest = renderer;
        if (renderer instanceof RendererDecorator) {
            ofInterest = ((RendererDecorator) renderer).getRenderer();
        }
        List<IConfigurationElement> list = new ArrayList<IConfigurationElement>();
        for (Iterator<IConfigurationElement> iter = ExtensionPointList.getExtensionPointList(
                RenderExecutor.EXTENSION_ID).iterator(); iter.hasNext();) {
            IConfigurationElement elem = iter.next();
            if (elem.getAttribute(RenderExecutor.RENDERER_ATTR).equals(
                    ofInterest.getClass().getName()))
                list.add(elem);
        }

        if (!list.isEmpty()) {
            // TODO if list has more than one element determine which is best.
View Full Code Here

            this.timeToDrawMetric = DRAW_IMAGE_RAW;           
        }
    }

    public Renderer createRenderer() {
        Renderer r=new GridCoverageReaderRenderer();
        r.setContext(context);
        return r;
    }
View Full Code Here

    public BasicWMSMetrics2( IRenderContext context2, BasicWMSMetricsFactory2 factory) {
        super(context2, factory, listExpectedStyleIds());
    }

    public Renderer createRenderer() {
        Renderer renderer=new BasicWMSRenderer2();
        renderer.setContext(context);
        return renderer;
    }
View Full Code Here

TOP

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

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.