Package org.broad.igv.feature.exome

Examples of org.broad.igv.feature.exome.ExomeBlock


    private void drawExomeBlocks(Graphics g, ExomeReferenceFrame frame) {

        String chr = frame.getChrName();
        List<ExomeBlock> blocks = frame.getBlocks(chr);
        int idx = frame.getFirstBlockIdx();
        ExomeBlock b;

        Rectangle visibleRect = this.getVisibleRect();


        int lastPStart = -1;
        int pStart;
        int pEnd;
        int exomeOrigin = frame.getExomeOrigin();
        int visibleBlockCount = 0;
        int blockGap = 0; // TODO --
        int top = visibleRect.y + visibleRect.height - 10;
        do {
            b = blocks.get(idx);

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

            // Don't draw over previously drawn region -- can happen when zoomed out.
            if (pEnd > lastPStart) {

                lastPStart = pStart;
                if (pEnd == pStart) pEnd++;


                b.setScreenBounds(pStart, pEnd);

                Rectangle rect = new Rectangle(pStart, top, pEnd - pStart, 10);


                Graphics2D exomeGraphics = (Graphics2D) g.create();
View Full Code Here


                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);

View Full Code Here

TOP

Related Classes of org.broad.igv.feature.exome.ExomeBlock

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.