Пример #1
0
        public override void Paint(Graphics g, DiagramView view)
        {
            RectangleF ef1 = this.Bounds;

            switch (this.Style)
            {
            case ShapeStyle.None:
            {
                return;
            }

            case ShapeStyle.Ellipse:
            {
                DiagramGraph.DrawEllipse(g, view, this.Pen, this.Brush, ef1.X, ef1.Y, ef1.Width, ef1.Height);
                return;
            }

            case ShapeStyle.Diamond:
            {
                PointF[] tfArray1 = view.AllocTempPointArray(4);
                tfArray1[0].X = ef1.X + (ef1.Width / 2f);
                tfArray1[0].Y = ef1.Y;
                tfArray1[1].X = ef1.X + ef1.Width;
                tfArray1[1].Y = ef1.Y + (ef1.Height / 2f);
                tfArray1[2].X = tfArray1[0].X;
                tfArray1[2].Y = ef1.Y + ef1.Height;
                tfArray1[3].X = ef1.X;
                tfArray1[3].Y = tfArray1[1].Y;
                DiagramGraph.DrawPolygon(g, view, this.Pen, this.Brush, tfArray1);
                view.FreeTempPointArray(tfArray1);
                return;
            }

            case ShapeStyle.TriangleTopLeft:
            case ShapeStyle.TriangleTopRight:
            case ShapeStyle.TriangleBottomRight:
            case ShapeStyle.TriangleBottomLeft:
            case ShapeStyle.TriangleMiddleTop:
            case ShapeStyle.TriangleMiddleRight:
            case ShapeStyle.TriangleMiddleBottom:
            case ShapeStyle.TriangleMiddleLeft:
            {
                PointF[] tfArray2 = view.AllocTempPointArray(3);
                this.ComputeTrianglePoints(tfArray2);
                DiagramGraph.DrawPolygon(g, view, this.Pen, this.Brush, tfArray2);
                view.FreeTempPointArray(tfArray2);
                return;
            }
            }
            DiagramGraph.DrawRectangle(g, view, this.Pen, this.Brush, ef1.X, ef1.Y, ef1.Width, ef1.Height);
        }
Пример #2
0
 public override void Paint(Graphics g, DiagramView view)
 {
     if (((this.Style != DiagramPortStyle.None) && (base.Parent != null)) && base.Parent.Shadowed)
     {
         RectangleF ef1 = this.Bounds;
         SizeF      ef2 = base.Parent.GetShadowOffset(view);
         if (this.Brush != null)
         {
             Brush brush1 = base.Parent.GetShadowBrush(view);
             DiagramGraph.DrawRectangle(g, view, null, brush1, ef1.X + ef2.Width, ef1.Y + ef2.Height, ef1.Width, ef1.Height);
         }
         else if (this.Pen != null)
         {
             Pen pen1 = base.Parent.GetShadowPen(view, DiagramGraph.GetPenWidth(this.Pen));
             DiagramGraph.DrawRectangle(g, view, pen1, null, ef1.X + ef2.Width, ef1.Y + ef2.Height, ef1.Width, ef1.Height);
         }
     }
     base.Paint(g, view);
 }
Пример #3
0
        public override void Paint(Graphics g, DiagramView view)
        {
            RectangleF ef1 = this.Bounds;

            if (this.Shadowed)
            {
                SizeF ef2 = this.GetShadowOffset(view);
                if (this.Brush != null)
                {
                    Brush brush1 = this.GetShadowBrush(view);
                    DiagramGraph.DrawRectangle(g, view, null, brush1, ef1.X + ef2.Width, ef1.Y + ef2.Height, ef1.Width, ef1.Height);
                }
                else if (this.Pen != null)
                {
                    Pen pen1 = this.GetShadowPen(view, base.InternalPenWidth);
                    DiagramGraph.DrawRectangle(g, view, pen1, null, ef1.X + ef2.Width, ef1.Y + ef2.Height, ef1.Width, ef1.Height);
                }
            }
            DiagramGraph.DrawRectangle(g, view, this.Pen, this.Brush, ef1.X, ef1.Y, ef1.Width, ef1.Height);
        }