示例#1
0
        /**
         * render leader area
         *
         * @param area area to render
         */

        public void RenderLeaderArea(LeaderArea area)
        {
            int       rx = this.currentXPosition;
            int       ry = this.currentYPosition;
            int       w  = area.getContentWidth();
            int       h  = area.GetHeight();
            int       th = area.getRuleThickness();
            RuleStyle st = area.getRuleStyle();

            // checks whether thickness is = 0, because of bug in pdf (or where?),
            // a line with thickness 0 is still displayed
            if (th != 0)
            {
                switch (st)
                {
                case RuleStyle.DOUBLE:
                    AddLine(rx, ry, rx + w, ry, th / 3, st,
                            new PdfColor(area.getRed(), area.getGreen(),
                                         area.getBlue()));
                    AddLine(rx, ry + (2 * th / 3), rx + w, ry + (2 * th / 3),
                            th / 3, st,
                            new PdfColor(area.getRed(), area.getGreen(),
                                         area.getBlue()));
                    break;

                case RuleStyle.GROOVE:
                    AddLine(rx, ry, rx + w, ry, th / 2, st,
                            new PdfColor(area.getRed(), area.getGreen(),
                                         area.getBlue()));
                    AddLine(rx, ry + (th / 2), rx + w, ry + (th / 2), th / 2, st,
                            new PdfColor(255, 255, 255));
                    break;

                case RuleStyle.RIDGE:
                    AddLine(rx, ry, rx + w, ry, th / 2, st,
                            new PdfColor(255, 255, 255));
                    AddLine(rx, ry + (th / 2), rx + w, ry + (th / 2), th / 2, st,
                            new PdfColor(area.getRed(), area.getGreen(),
                                         area.getBlue()));
                    break;

                default:
                    AddLine(rx, ry, rx + w, ry, th, st,
                            new PdfColor(area.getRed(), area.getGreen(),
                                         area.getBlue()));
                    break;
                }
                this.currentXPosition += area.getContentWidth();
                this.currentYPosition += th;
            }
        }