Examples of RenderContextImpl


Examples of org.broad.igv.track.RenderContextImpl

                Rectangle panelClip = visibleRect;

                List<ExomeBlock> blocks = exomeFrame.getBlocks();
                int idx = exomeFrame.getFirstBlockIdx();

                RenderContext exomeContext = new RenderContextImpl(null, null, frame, visibleRect);
                preloadTracks(groups, exomeContext, visibleRect);

                ExomeBlock b;
                int lastPStart = 0;
                int pStart;
                int pEnd;
                int exomeOrigin = ((ExomeReferenceFrame) frame).getExomeOrigin();
                int visibleBlockCount = 0;

                do {
                    b = blocks.get(idx);

                    pStart = (int) ((b.getExomeStart() - exomeOrigin) / frame.getScale()) + visibleBlockCount * blockGap;
                    pEnd = (int) ((b.getExomeEnd() - exomeOrigin) / frame.getScale()) + visibleBlockCount * blockGap;

                    if (pEnd > lastPStart) {

                        lastPStart = pStart;
                        // Don't draw over previously drawn region -- can happen when zoomed out.


                        if (pEnd == pStart) pEnd++;


                        b.setScreenBounds(pStart, pEnd);

                        Rectangle rect = new Rectangle(pStart, visibleRect.y, pEnd - pStart, visibleRect.height);

                        Graphics2D exomeGraphics = (Graphics2D) context.getGraphics().create();

                        //Shape clip = exomeGraphics.getClip();

//                         Color c = ColorUtilities.randomColor(idx);
//                         exomeGraphics.setColor(c);
//                         exomeGraphics.fill(rect);
//                         exomeGraphics.setColor(Color.black);
//                         GraphicUtils.drawCenteredText(String.valueOf(idx), rect, exomeGraphics);

                        exomeGraphics.setClip(rect.intersection(panelClip));
                        exomeGraphics.translate(pStart, 0);

                        ReferenceFrame tmpFrame = new ReferenceFrame(frame);
                        tmpFrame.setOrigin(b.getGenomeStart());


                        RenderContext tmpContext = new RenderContextImpl(null, exomeGraphics, tmpFrame, rect);
                        paintFrame(groups, tmpContext, rect.width, rect);

                        tmpContext.dispose();
                        exomeGraphics.dispose();
                        visibleBlockCount++;
                    }
                    idx++;

View Full Code Here

Examples of org.broad.igv.track.RenderContextImpl


        final List<Track> visibleTracks = getVisibleTracks(groups);

        for (Track track : visibleTracks) {
            RenderContextImpl newContext = new RenderContextImpl(null, null, context.getReferenceFrame(), visibleRect);
            track.load(newContext);
        }

    }
View Full Code Here

Examples of org.broad.igv.track.RenderContextImpl

        AlignmentDataManager manager = getManager171();
        ReferenceFrame frame = new ReferenceFrame(frameName);
        AlignmentTrack.RenderOptions renderOptions = new AlignmentTrack.RenderOptions();
        frame.setBounds(0, end - start);

        RenderContextImpl context = new RenderContextImpl(null, null, frame, null);

        int lastStart = genome.getChromosome(chr).getLength() - 4 * halfwidth;
        int[] starts = new int[]{500, 5000, 15000, start, 500000, lastStart};
        int[] ends = new int[]{600, 10000, 20000, end, 600000, lastStart + 2 * halfwidth};
        for (int ii = 0; ii < starts.length; ii++) {
View Full Code Here

Examples of org.broad.igv.track.RenderContextImpl

        int shift = 0;

        ReferenceFrame frame = new ReferenceFrame(frameName);
        AlignmentTrack.RenderOptions renderOptions = new AlignmentTrack.RenderOptions();
        frame.setBounds(0, end - start);
        RenderContextImpl context = new RenderContextImpl(null, null, frame, null);

        for (int pp = 0; pp < numPans; pp++) {
            shift = pp * panInterval;
            Locus locus = new Locus(chr, start + shift, end + shift);
            frame.jumpTo(locus);
View Full Code Here

Examples of org.locationtech.udig.project.internal.render.impl.RenderContextImpl

    private static final double ACCURACY = 0.1;
   
    private RenderContextImpl context;

    private void createContext( Map map ) {
        context=new RenderContextImpl();
        context.setGeoResourceInternal(map.getLayersInternal().get(0).getGeoResources().get(0));
        context.setMapInternal(map);
        context.setRenderManagerInternal(map.getRenderManagerInternal());
        context.setLayerInternal(map.getLayersInternal().get(0));
    }
View Full Code Here

Examples of org.locationtech.udig.project.internal.render.impl.RenderContextImpl

    public static RenderContext configureMapForRendering(Map map, final Dimension destinationSize, final int dpi, BoundsStrategy boundsStrategy, ReferencedEnvelope baseMapBounds) {
        RenderManager manager = RenderFactory.eINSTANCE.createRenderManagerViewer();

        map.setRenderManagerInternal(manager);

        RenderContext tools = new RenderContextImpl();
        tools.setMapInternal(map);
        tools.setRenderManagerInternal(manager);

        ProjectUIPlugin
                .trace(
                        ApplicationGIS.class,
                        "Firing size changed event. Changing to size: " + destinationSize.width + " by " + destinationSize.height, null); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of org.locationtech.udig.project.internal.render.impl.RenderContextImpl

        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
Copyright © 2018 www.massapi.com. 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.