コード例 #1
0
 public virtual void Draw(Graphics g, RenderingEngine e, DrawableBase parent, InputOutputBase previous)
 {
     if (UIComponent != null && (UIComponent.IsDescription || !IsConnected(e)))
     {
         UIComponent.Draw(g, e, this);
     }
 }
コード例 #2
0
        protected void DrawAction(Graphics g, Engine e, DrawableBase parent, InputOutputBase previous, RectangleF r)
        {
            float marginOffset = 0.20f;

            // Arrow Polygon
            float marginHeight = r.Height * marginOffset;
            var   poly         = new PointF[]
            {
                new PointF(r.Left, r.Top + marginHeight),
                new PointF(r.Left + 4, r.Top + marginHeight),
                new PointF(r.Right - r.Width * 0.25f, r.Y + r.Height * 0.5f),
                new PointF(r.Left + 4, r.Bottom - marginHeight),
                new PointF(r.Left, r.Bottom - marginHeight),
            };


            if (SignatureCheckFailed)
            {
                g.FillPolygon(SignatureCheckBrush, poly);
            }
            else if (IsMouseOver)
            {
                g.FillPolygon(MouseOverBrush, poly);
            }
            else
            {
                g.FillPolygon(Signature.Brush, poly);
            }

            Pen.LineJoin      = LineJoin.Round;
            PenWhite.LineJoin = LineJoin.Round;

            g.DrawPolygon(PenWhite, poly);
            g.DrawPolygon(Pen, poly);
        }
コード例 #3
0
 public override void UpdateMouseUp(RenderingEngine e, DrawableBase parent, DrawableBase previous)
 {
     base.UpdateMouseUp(e, parent, previous);
     if (UIComponent != null && !IsConnected(e))
     {
         UIComponent.UpdateMouseUp(e, this, previous);
     }
 }
コード例 #4
0
        public void DrawData(Graphics g, RenderingEngine e, DrawableBase parent, InputOutputBase previous, RectangleF r)
        {
            //if (e.PerformanceMode == PerformanceMode.HighQuality)
            //{
            float leftOffset   = 5.5f;
            var   marginHeight = r.Height * 0.35f;

            // Small Arrow Polygon
            var poly = new PointF[]
            {
                new PointF(r.Left + r.Width - leftOffset, r.Top + marginHeight),
                new PointF(r.Right + r.Width * 0.24f - leftOffset, r.Y + r.Height * 0.5f),
                new PointF(r.Left + r.Width - leftOffset, r.Bottom - marginHeight),
            };

            if (SignatureCheckFailed)
            {
                g.FillPolygon(SignatureCheckBrush, poly);
            }
            else if (IsMouseOver)
            {
                g.FillPolygon(MouseOverBrush, poly);
            }
            else
            {
                g.FillPolygon(Signature.Brush, poly);
            }

            PenSmall.LineJoin      = LineJoin.Round;
            PenWhiteSmall.LineJoin = LineJoin.Round;

            g.DrawPolygon(PenWhiteSmall, poly);
            g.DrawPolygon(PenSmall, poly);
            //}

            // Small Circle
            var radius             = r.Height * 0.40f;
            var marginHeightCircle = r.Height * 0.5f - radius * 0.5f;

            var circle = new RectangleF(r.X, r.Y + marginHeightCircle, radius, radius);

            if (SignatureCheckFailed)
            {
                g.FillEllipse(SignatureCheckBrush, circle);
            }
            else if (IsMouseOver)
            {
                g.FillEllipse(MouseOverBrush, circle);
            }
            else
            {
                g.FillEllipse(Signature.Brush, circle);
            }

            g.DrawEllipse(PenWhite, circle);
            g.DrawEllipse(Pen, circle);
        }
コード例 #5
0
ファイル: OutputBase.cs プロジェクト: Zicore/BlueSwitch
        public override void Draw(Graphics g, RenderingEngine e, DrawableBase parent, InputOutputBase previous)
        {
            var transform = g.Transform;

            g.TranslateTransform(Translation.X, Translation.Y);

            DrawInputOutput(g, e, parent, previous);

            g.Transform = transform;

            base.Draw(g, e, parent, previous);
        }
コード例 #6
0
        protected virtual void DrawInputOutput(Graphics g, RenderingEngine e, DrawableBase parent, InputOutputBase previous)
        {
            var r = Rectangle;

            if (Signature is ActionSignature)
            {
                DrawAction(g, e, parent, previous, r);
            }
            else
            {
                DrawData(g, e, parent, previous, r);
            }
        }
コード例 #7
0
ファイル: OutputBase.cs プロジェクト: Zicore/BlueSwitch
        public override PointF GetTranslationCenter(DrawableBase parent)
        {
            var descHeight = parent.InputOutputDescriptionHeight;

            return(new PointF((parent.Position.X + parent.Size.Width - Size.Width) + Size.Width * 0.5f, (descHeight + parent.Position.Y + Size.Height * Index) + Size.Height * 0.5f));
        }
コード例 #8
0
ファイル: OutputBase.cs プロジェクト: Zicore/BlueSwitch
 public override void Update(RenderingEngine e, DrawableBase parent, DrawableBase previous)
 {
     base.Update(e, parent, previous);
     Translation = GetTranslation(parent);
 }
コード例 #9
0
 public virtual PointF GetTranslationCenter(DrawableBase parent)
 {
     return(Position);
 }
コード例 #10
0
ファイル: DrawableBase.cs プロジェクト: Zicore/BlueSwitch
 public virtual void Draw(Graphics g, RenderingEngine e, DrawableBase parent)
 {
 }
コード例 #11
0
ファイル: DrawableBase.cs プロジェクト: Zicore/BlueSwitch
 public virtual void UpdateMouseUp(RenderingEngine e, DrawableBase parent, DrawableBase previous)
 {
 }
コード例 #12
0
ファイル: DrawableBase.cs プロジェクト: Zicore/BlueSwitch
 public virtual void Update(RenderingEngine e, DrawableBase parent, DrawableBase previous)
 {
     Translation = new PointF(Position.X, Position.Y);
 }
コード例 #13
0
        public override PointF GetTranslation(DrawableBase parent)
        {
            var descHeight = parent.InputOutputDescriptionHeight;

            return(new PointF(parent.Position.X + Size.Width * 0.25f, descHeight + parent.Position.Y + Size.Height * Index));
        }