AIMS/DrawGraph/BoardPack/LinePackObj.cs
2022-12-29 21:57:18 +08:00

67 lines
1.1 KiB
C#

using DrawGraph;
using Newtonsoft.Json;
using System;
using System.Drawing;
namespace DrawGraph
{
[JsonObject(MemberSerialization.OptOut)]
[Serializable]
public class LinePackObj : PackObjBase
{
private int lineWidth = 1;
private Color lineColor = Color.Black;
public Color LineColor
{
get
{
return this.lineColor;
}
set
{
this.lineColor = value;
}
}
[ClassAttributs(Description = "线粗细")]
public int LineWidth
{
get
{
return this.lineWidth;
}
set
{
this.lineWidth = value;
}
}
public LinePackObj(ZedGraphControl zgc, PackObjManager poManager) : base(zgc, poManager)
{
this.baseZed = zgc;
base.PackText = "直线" + this.index.ToString();
}
public override void Draw()
{
bool flag = this.baseZed == null;
if (!flag)
{
this.Clear();
Color red = this.lineColor;
bool isSelect = base.IsSelect;
if (isSelect)
{
red = Color.Red;
}
ZUtil.DrawLineWidth((double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY, this.baseZed, base.PackTag, red, this.LineWidth);
base.Refresh();
}
}
}
}