Exemple #1
0
 public override void Draw(MurphyPA.H2D.Interfaces.IGraphicsContext GC)
 {
     /*
      * if (_WhichEnd == TransitionContactEnd.To)
      * {
      * // want to draw an arrow here...
      *
      *      GraphicsPath path = new GraphicsPath ();
      *      path.AddLine ();
      *      path.AddLine ();
      *      path.AddLine ();
      *      path.CloseFigure ();
      *
      *      using (Brush brush = new System.Drawing.SolidBrush (GC.Color))
      *      {
      *              using (Pen pen = new Pen (brush, 5))
      *              {
      *                      GC.DrawPath (pen, path);
      *              }
      *      }
      * }
      * else
      */
     {
         base.Draw(GC);
     }
 }
        public override void Draw(MurphyPA.H2D.Interfaces.IGraphicsContext GC)
        {
            if (_WhichEnd == TransitionContactEnd.To)
            {
                // want to draw an arrow here...

                pointer.Draw(GC, _OtherEnd.Centre, this.Centre, _Radius, _Radius);
            }
            else
            {
                base.Draw(GC);
            }

            if (_WhichEnd == TransitionContactEnd.To)
            {
                ITransitionGlyph trans = Owner as ITransitionGlyph;
                if (trans != null && trans.TransitionType == TransitionType.DeepHistory)
                {
                    using (Brush brush = new System.Drawing.SolidBrush(GC.Color))
                    {
                        GC.DrawString("H*", brush, 12, _Centre, false);
                    }
                }
            }
        }
        public override void Draw(MurphyPA.H2D.Interfaces.IGraphicsContext GC)
        {
            if (_WhichEnd == TransitionContactEnd.To)
            {
                int height = this.Bounds.Width;
                pointer.Draw(GC, Centre(_OtherEnd.Bounds), Centre(this.Bounds), height, height);
            }
            else
            {
                base.Draw(GC);
            }

            IPortLinkGlyph portLink = Owner as IPortLinkGlyph;

            if (portLink != null)
            {
                string portName = "?NoName";
                switch (_WhichEnd)
                {
                case TransitionContactEnd.From:
                {
                    portName = portLink.FromPortName;
                    if (IsNotEmptyString(portLink.SendIndex))
                    {
                        portName = portName + "-" + portLink.SendIndex;
                    }
                } break;

                case TransitionContactEnd.To:
                {
                    portName = portLink.ToPortName;
                } break;
                }

                using (Brush brush = new System.Drawing.SolidBrush(GC.Color))
                {
                    Rectangle bounds = Bounds;
                    GC.DrawString(portName, brush, 12, new Point(bounds.Right, bounds.Bottom), false);
                }
            }
        }
Exemple #4
0
 public override void Draw(MurphyPA.H2D.Interfaces.IGraphicsContext GC)
 {
     GC.DrawCircle(_Centre, _Radius, true);
 }
Exemple #5
0
 public override void Draw(MurphyPA.H2D.Interfaces.IGraphicsContext GC)
 {
     GC.DrawRectangle(_Bounds);
 }