private void Navigator_NavNewColumn(HeapCell aCell, HeapCellMetaData aMetaData, uint aAddress, Point aPixelPos, Point aBoxPos, Size aDimensions, Size aBoxSize, Size aPadding)
        {
            // Draw content
            iFactory.Renderers.Content.PaintContent(iGraphics, aMetaData, aCell, aAddress, aPixelPos, aBoxSize, aPadding);

            // Draw cell border
            iFactory.Renderers.ContentBorder.PaintContentBorder(iGraphics, aMetaData, aCell, aAddress, aPixelPos, aBoxSize, aPadding);

            // If we are handling a click & drag operation, then check whether the cell
            // needs a border.
            if (iMouseSelectionCell != null)
            {
                // Get the cell index within the cell array
                int index           = CellIndex(aCell);
                int mouseBoundLower = (int)iMouseSelectionCellBoundaryLower.Tag;
                int mouseBoundUpper = (int)iMouseSelectionCellBoundaryUpper.Tag;

                if (index >= mouseBoundLower && index <= mouseBoundUpper)
                {
                    iFactory.Renderers.SelectionBorder.PaintSelectionBorder(iGraphics, aMetaData, aCell, aAddress, aPixelPos, aBoxSize, aPadding, THeapSelectionBorderType.ESelectionMouse);
                }
            }
            else if (iFocusedCellKeyboard == aCell)
            {
                // Draw border around currently mouse over'd cell
                iFactory.Renderers.SelectionBorder.PaintSelectionBorder(iGraphics, aMetaData, aCell, aAddress, aPixelPos, aBoxSize, aPadding, THeapSelectionBorderType.ESelectionKeyboard);
            }
            else if (iFocusedCellMouse == aCell)
            {
                // Draw border around currently mouse over'd cell
                iFactory.Renderers.SelectionBorder.PaintSelectionBorder(iGraphics, aMetaData, aCell, aAddress, aPixelPos, aBoxSize, aPadding, THeapSelectionBorderType.ESelectionMouse);
            }
        }
Ejemplo n.º 2
0
 public void HeapCellRenderingComplete(Graphics aGraphics, HeapCell aCell, HeapCellMetaData aMetaData)
 {
     SelectionBorder.HeapCellRenderingComplete(aGraphics, aCell, aMetaData);
     Header.HeapCellRenderingComplete(aGraphics, aCell, aMetaData);
     Content.HeapCellRenderingComplete(aGraphics, aCell, aMetaData);
     ContentBorder.HeapCellRenderingComplete(aGraphics, aCell, aMetaData);
 }
        public void HeapCellRenderingComplete(Graphics aGraphics, HeapCell aCell, HeapCellMetaData aMetaData)
        {
            Color fillColour = RampedColourByIntensityRange(KBiggestCellColour, aCell.Length, iCellLengthSmallest, iCellLengthLongest);
            //
            string text = aCell.SymbolStringWithoutDescriptorPrefix;

            PaintBoxedTextWithLuminanceHandling(text, aGraphics, fillColour);
        }
Ejemplo n.º 4
0
        public void HeapCellRenderingComplete(Graphics aGraphics, HeapCell aCell, HeapCellMetaData aMetaData)
        {
            Color fillColour = ColourForHeapCell(aCell);
            //
            string text = aCell.SymbolStringWithoutDescriptorPrefix;

            PaintBoxedTextWithLuminanceHandling(text, aGraphics, fillColour);
        }
        public void HeapCellRenderingComplete(Graphics aGraphics, HeapCell aCell, HeapCellMetaData aMetaData)
        {
            Color fillColour = ColorForCell(aCell);
            //
            string text = "Unknown";

            if (aCell.Symbol != null)
            {
                text = aCell.Symbol.ObjectWithoutSection;
            }
            //
            PaintBoxedTextWithLuminanceHandling(text, aGraphics, fillColour);
        }
        public void PaintContent(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            // Get the cell colour that is associated with the cell symbol object type
            aMetaData.CellBoxColor = RampedColourByBoxNumber(ColorForCell(aCell), aMetaData.CellBoxCount, aCell.Address, aAddress);

            // Draw actual cell
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);
            using (SolidBrush brush = new SolidBrush(aMetaData.CellBoxColor))
            {
                aGraphics.FillRectangle(brush, boxRect.Rectangle);
            }
        }
        public void PaintContent(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            // We paint the cell a different shade of red, depending on it's length. The larger the heap cell,
            // then the more intense the colour. Shorter length cells are de-emphasised.
            aMetaData.CellBoxColor = RampedColourByIntensityRange(KBiggestCellColour, aCell.Length,
                                                                  iCellLengthSmallest, iCellLengthLongest);

            // Draw actual cell
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);

            using (SolidBrush brush = new SolidBrush(aMetaData.CellBoxColor))
            {
                aGraphics.FillRectangle(brush, boxRect.Rectangle);
            }
        }
        public void PaintContent(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            // Get the cell colour that is associated with the cell symbol object type. This
            // makes oldest cells very light and youngest cells very dark. We really want
            // it the other way around...
            aMetaData.CellBoxColor = CellColour(aCell);

            // Draw actual cell
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);

            using (SolidBrush brush = new SolidBrush(aMetaData.CellBoxColor))
            {
                aGraphics.FillRectangle(brush, boxRect.Rectangle);
            }
        }
Ejemplo n.º 9
0
        public void PaintContent(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            // Get the cell colour that is associated with the cell symbol object type
            aMetaData.CellBoxColor = ColourForHeapCell(aCell);

            // Draw actual cell
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);
            using (SolidBrush brush = new SolidBrush(aMetaData.CellBoxColor))
            {
                aGraphics.FillRectangle(brush, boxRect.Rectangle);
            }

            // If first box, we show the number of inwards links to the cell
            HeapCell.TRegion region = aMetaData.Region;
            if (region == HeapCell.TRegion.EHeader && aMetaData.CellBoxIndex == 0)
            {
                boxRect.Inflate(KShrinkSize, KShrinkSize);

                // Draw the fill
                Color lightenColor = ColourUtils.LightenMore(aMetaData.CellBoxColor);
                using (SolidBrush brush = new SolidBrush(lightenColor))
                {
                    aGraphics.FillRectangle(brush, boxRect.Rectangle);
                }
                lightenColor = ColourUtils.Lighten(lightenColor);
                using (Pen borderPen = new Pen(lightenColor, KHeaderBoxWidth))
                {
                    aGraphics.DrawRectangle(borderPen, boxRect.Rectangle);
                }

                // Draw the count
                int count = aCell.RelationshipManager.ReferencedBy.Count;
                if (count == 0)
                {
                    PaintBoxedText(count.ToString(), aGraphics, Color.Red, boxRect);
                }
                else
                {
                    PaintBoxedTextWithLuminanceHandling(count.ToString(), aGraphics, Color.Black, boxRect);
                }
            }
        }
        public void PaintContentBorder(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);
            aGraphics.DrawRectangle(Pens.Black, boxRect.Rectangle);

            // If we're drawing the header, we can decorate the header with an
            // additional line.
            HeapCell.TRegion region = aCell.RegionForAddress(aAddress);
            if (region == HeapCell.TRegion.EHeader)
            {
                Point linePosStart = boxRect.TopLeft;
                linePosStart.X += KHeaderBoxLineCornerOffset;
                Point linePosEnd = boxRect.TopLeft;
                linePosEnd.Y += KHeaderBoxLineCornerOffset;
                //
                aGraphics.DrawLine(Pens.Black, linePosStart, linePosEnd);
            }
        }
Ejemplo n.º 11
0
        public void PaintContent(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            // Get the cell colour to use and also the region associated with
            // the cell address.
            HeapCell.TRegion region;
            aMetaData.CellBoxColor = RampedCellFillColourByRegion(aCell, aMetaData.CellBoxCount, aAddress, out region);

            // Draw actual cell
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);

            using (SolidBrush brush = new SolidBrush(aMetaData.CellBoxColor))
            {
                aGraphics.FillRectangle(brush, boxRect.Rectangle);
            }
            using (Pen borderPen = new Pen(Color.Black))
            {
                aGraphics.DrawRectangle(borderPen, boxRect.Rectangle);
            }
        }
        public void PaintContentBorder(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            SymRect rect = new SymRect(aPosition, aBoxSize + aPaddingSize);

            if (aMetaData.Borders[THeapCellBorderType.ELeft])     // Draw left-hand outline
            {
                aGraphics.DrawLine(Pens.Black, rect.TopLeft, rect.BottomLeft);
            }
            if (aMetaData.Borders[THeapCellBorderType.ERight])       // Draw right-hand outline
            {
                aGraphics.DrawLine(Pens.Black, rect.TopRight, rect.BottomRight);
            }
            if (aMetaData.Borders[THeapCellBorderType.ETop])       // Draw top-side outline
            {
                aGraphics.DrawLine(Pens.Black, rect.TopLeft, rect.TopRight);
            }
            if (aMetaData.Borders[THeapCellBorderType.EBottom])       // Draw bottom-side outline
            {
                aGraphics.DrawLine(Pens.Black, rect.BottomLeft, rect.BottomRight);
            }
        }
        public void PaintSelectionBorder(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize, THeapSelectionBorderType aType)
        {
            float   width;
            Color   color = GetBorderProperties(aType, out width);
            SymRect rect  = new SymRect(aPosition, aBoxSize + aPaddingSize);

            if (aMetaData.Borders[THeapCellBorderType.ELeft])     // Draw left-hand outline
            {
                PaintCellBorder(aGraphics, aMetaData, rect.TopLeft, rect.BottomLeft, aAddress, aCell, width, color, THeapCellBorderType.ELeft);
            }
            if (aMetaData.Borders[THeapCellBorderType.ETop])       // Draw top-side outline
            {
                PaintCellBorder(aGraphics, aMetaData, rect.TopLeft, rect.TopRight, aAddress, aCell, width, color, THeapCellBorderType.ETop);
            }
            if (aMetaData.Borders[THeapCellBorderType.ERight])       // Draw right-hand outline
            {
                PaintCellBorder(aGraphics, aMetaData, rect.TopRight, rect.BottomRight, aAddress, aCell, width, color, THeapCellBorderType.ERight);
            }
            if (aMetaData.Borders[THeapCellBorderType.EBottom])       // Draw bottom-side outline
            {
                PaintCellBorder(aGraphics, aMetaData, rect.BottomLeft, rect.BottomRight, aAddress, aCell, width, color, THeapCellBorderType.EBottom);
            }
        }
Ejemplo n.º 14
0
        public void PaintContent(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            // Get the cell colour that is associated with the cell symbol object type
            aMetaData.CellBoxColor = ColourForHeapCell(aCell);
            SymRect boxRect = new SymRect(aPosition, aBoxSize);

            boxRect.HalfOffset(aPaddingSize);

            // Draw actual cell
            using (SolidBrush brush = new SolidBrush(aMetaData.CellBoxColor))
            {
                aGraphics.FillRectangle(brush, boxRect.Rectangle);
            }

            HeapCell.TRegion region = aMetaData.Region;
            if (region == HeapCell.TRegion.EHeader && aMetaData.CellBoxIndex == 0)
            {
                // If first box, we show the number of inwards links to the cell
                boxRect.Inflate(KShrinkSize, KShrinkSize);

                // Draw the fill
                Color lightenColor = ColourUtils.Lighten(aMetaData.CellBoxColor);
                using (SolidBrush brush = new SolidBrush(lightenColor))
                {
                    aGraphics.FillRectangle(brush, boxRect.Rectangle);
                }
                lightenColor = ColourUtils.Lighten(lightenColor);
                using (Pen borderPen = new Pen(lightenColor, KHeaderBoxWidth))
                {
                    aGraphics.DrawRectangle(borderPen, boxRect.Rectangle);
                }

                // Draw the count
                PaintBoxedTextWithLuminanceHandling(aCell.RelationshipManager.EmbeddedReferencesTo.Count.ToString(), aGraphics, Color.Black, boxRect);
            }
            else
            {
                // If we're in the payload section, then get the raw item corresponding to the address we are drawing
                RawItem rawItem = aMetaData.RawItem;
                if (rawItem != null && rawItem.Tag != null && rawItem.Tag is HeapLib.Relationships.RelationshipInfo)
                {
                    RelationshipInfo relInfo = (RelationshipInfo)rawItem.Tag;

                    // Make the box a bit smaller
                    boxRect.Inflate(KShrinkSize, KShrinkSize);

                    // Draw the fill
                    Color lightenColor = ColourUtils.Lighten(aMetaData.CellBoxColor);
                    using (SolidBrush brush = new SolidBrush(lightenColor))
                    {
                        aGraphics.FillRectangle(brush, boxRect.Rectangle);
                    }
                    lightenColor = ColourUtils.Lighten(lightenColor);
                    using (Pen borderPen = new Pen(lightenColor, KHeaderBoxWidth))
                    {
                        aGraphics.DrawRectangle(borderPen, boxRect.Rectangle);

                        // If it's a clean reference, then draw a diagonal line to decorate the box reference
                        if (relInfo.IsCleanLink)
                        {
                            Point linePosStart = boxRect.TopLeft;
                            linePosStart.X += KHeaderBoxLineCornerOffset;
                            Point linePosEnd = boxRect.TopLeft;
                            linePosEnd.Y += KHeaderBoxLineCornerOffset;
                            //
                            aGraphics.DrawLine(borderPen, linePosStart, linePosEnd);
                        }
                    }
                }
            }
        }
Ejemplo n.º 15
0
        public void PaintContentBorder(Graphics aGraphics, HeapCellMetaData aMetaData, HeapCell aCell, uint aAddress, Point aPosition, Size aBoxSize, Size aPaddingSize)
        {
            SymRect rect = new SymRect(aPosition, aBoxSize + aPaddingSize);

            // Right and bottom get darker borders
            Color rightAndBottomColour = ColourUtils.Darken(aMetaData.CellBoxColor, 0.15f);

            using (Pen rightAndBottomPen = new Pen(rightAndBottomColour))
            {
                if (aMetaData.Borders[THeapCellBorderType.ERight])     // Draw right-hand outline
                {
                    Point start = rect.TopRight;
                    Point end   = rect.BottomRight;
                    start.Offset(-1, 0);
                    end.Offset(-1, 0);
                    //
                    aGraphics.DrawLine(rightAndBottomPen, start, end);
                }
                if (aMetaData.Borders[THeapCellBorderType.EBottom])     // Draw bottom-side outline
                {
                    Point start = rect.BottomLeft;
                    Point end   = rect.BottomRight;
                    start.Offset(0, -1);
                    end.Offset(0, -1);
                    //
                    aGraphics.DrawLine(rightAndBottomPen, start, end);
                }
            }

            // Left and Top get lighter borders
            Color leftAndTopColour = ColourUtils.Lighten(aMetaData.CellBoxColor, 0.15f);

            using (Pen leftAndTopPen = new Pen(leftAndTopColour))
            {
                if (aMetaData.Borders[THeapCellBorderType.ELeft])     // Draw left-hand outline
                {
                    Point start = rect.TopLeft;
                    Point end   = rect.BottomLeft;
                    start.Offset(1, 0);
                    end.Offset(1, 0);
                    //
                    aGraphics.DrawLine(leftAndTopPen, start, end);
                }
                if (aMetaData.Borders[THeapCellBorderType.ETop])     // Draw top-side outline
                {
                    Point start = rect.TopLeft;
                    Point end   = rect.TopRight;
                    start.Offset(0, 1);
                    end.Offset(0, 1);
                    //
                    aGraphics.DrawLine(leftAndTopPen, start, end);
                }
            }

            // Now draw black border which will cover any over-spill from above.
            if (aMetaData.Borders[THeapCellBorderType.ELeft])     // Draw left-hand outline
            {
                aGraphics.DrawLine(Pens.Black, rect.TopLeft, rect.BottomLeft);
            }
            if (aMetaData.Borders[THeapCellBorderType.ERight])     // Draw right-hand outline
            {
                aGraphics.DrawLine(Pens.Black, rect.TopRight, rect.BottomRight);
            }
            if (aMetaData.Borders[THeapCellBorderType.ETop])     // Draw top-side outline
            {
                aGraphics.DrawLine(Pens.Black, rect.TopLeft, rect.TopRight);
            }
            if (aMetaData.Borders[THeapCellBorderType.EBottom])     // Draw bottom-side outline
            {
                aGraphics.DrawLine(Pens.Black, rect.BottomLeft, rect.BottomRight);
            }
        }
Ejemplo n.º 16
0
 public void HeapCellRenderingComplete(Graphics aGraphics, HeapCell aCell, HeapCellMetaData aMetaData)
 {
 }
 private void Navigator_NavHeapCellEnd(HeapCell aCell, HeapCellMetaData aMetaData, uint aAddress, Point aPosition, Size aDimensions, Size aBoxSize, Size aPadding)
 {
     iFactory.Renderers.HeapCellRenderingComplete(iGraphics, aCell, aMetaData);
 }
        private void PaintCellBorder(Graphics aGraphics, HeapCellMetaData aMetaData, Point aStart, Point aEnd, uint aAddress, HeapCell aCell, float aWidth, Color aColour, THeapCellBorderType aType)
        {
            HeapCellRendererSelectionBorderItem spec = new HeapCellRendererSelectionBorderItem(aStart, aEnd, aWidth, aColour, aType);

            iLines.Add(spec);
        }