Ejemplo n.º 1
0
        /// <summary>
        /// Render the new highlights taking into consideration the old highlights
        /// (this means that only the differences are actually rendered)
        /// </summary>
        private void RenderHighlightDiffs(IntervalTree <AtomicHighlight> atomicHighlights)
        {
            //System.Console.WriteLine("Rendering highlight diffs");
            IList <AtomicHighlight> hl = atomicHighlights.GetValues();

            foreach (AtomicHighlight h in hl)
            {
                //System.Console.WriteLine("  Checking {0}", h);
                IList <AtomicHighlight> overlaps = prevAtomicHighlights.SearchOverlap(h);
                foreach (AtomicHighlight overlap in overlaps)
                {
                    AtomicHighlight hTmp = new AtomicHighlight(h);
                    hTmp.Intersect(overlap);
                    AtomicHighlight oTmp = new AtomicHighlight(overlap);
                    oTmp.Intersect(h);
                    //System.Console.WriteLine("    Overlaps with {0}", oTmp);

                    bool diffType = oTmp.Type != hTmp.Type;

                    Drawer.HighlightType left, right, oleft, oright;

                    hTmp.GetAbyssHighlights(out left, out right);
                    oTmp.GetAbyssHighlights(out oleft, out oright);

                    bool diffAbyss = (left != oleft) || (right != oright);

                    if (diffType || diffAbyss)
                    {
                        //System.Console.Write(diffType?"      DiffType> ":"      DiffFlags> ");
                        //System.Console.WriteLine(hTmp);
                        RenderHighlight(hTmp);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Renders a <see cref="Util.Range"/> of data using a specified <see cref="Drawer.HighlightType"/>
        /// </summary>
        private void RenderHighlight(AtomicHighlight h)
        {
            Drawer.HighlightType left;
            Drawer.HighlightType right;
            h.GetAbyssHighlights(out left, out right);

            //System.Console.WriteLine("  Rendering {0}  ({1} {2})", h, left, right);
            foreach (Area a in areas)
            {
                a.RenderHighlight(h, left, right);
            }
        }