public virtual void Draw(Graphics g, RenderingEngine e, DrawableBase parent, InputOutputBase previous) { if (UIComponent != null && (UIComponent.IsDescription || !IsConnected(e))) { UIComponent.Draw(g, e, this); } }
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); }
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); } }
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); }
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); }
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); } }
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)); }
public override void Update(RenderingEngine e, DrawableBase parent, DrawableBase previous) { base.Update(e, parent, previous); Translation = GetTranslation(parent); }
public virtual PointF GetTranslationCenter(DrawableBase parent) { return(Position); }
public virtual void Draw(Graphics g, RenderingEngine e, DrawableBase parent) { }
public virtual void UpdateMouseUp(RenderingEngine e, DrawableBase parent, DrawableBase previous) { }
public virtual void Update(RenderingEngine e, DrawableBase parent, DrawableBase previous) { Translation = new PointF(Position.X, Position.Y); }
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)); }