83 lines
1.6 KiB
C#
83 lines
1.6 KiB
C#
|
|
using DrawGraph;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Drawing;
|
|
|
|
|
|
namespace DrawGraph
|
|
{
|
|
[JsonObject(MemberSerialization.OptOut)]
|
|
[Serializable]
|
|
public class RectangleFramePackObj : PackObjBase
|
|
{
|
|
private Color frameColor = Color.Black;
|
|
|
|
private int lineWidth = 1;
|
|
|
|
public Color FrameColor
|
|
{
|
|
get
|
|
{
|
|
return this.frameColor;
|
|
}
|
|
set
|
|
{
|
|
this.frameColor = value;
|
|
}
|
|
}
|
|
|
|
[ClassAttributs(Description = "线粗细")]
|
|
public int LineWidth
|
|
{
|
|
get
|
|
{
|
|
return this.lineWidth;
|
|
}
|
|
set
|
|
{
|
|
this.lineWidth = value;
|
|
}
|
|
}
|
|
|
|
public RectangleFramePackObj(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();
|
|
bool flag2 = base.RealEndX <= base.RealX || base.RealEndY <= base.RealY;
|
|
if (!flag2)
|
|
{
|
|
float num = base.RealEndX - base.RealX;
|
|
float num2 = base.RealEndY - base.RealY;
|
|
BoxObj boxObj = new BoxObj((double)base.RealX, (double)base.RealY, (double)num, (double)num2);
|
|
boxObj.Tag = base.PackTag;
|
|
boxObj.Location.CoordinateFrame = CoordType.PaneFraction;
|
|
boxObj.Border.IsVisible = true;
|
|
bool isSelect = base.IsSelect;
|
|
if (isSelect)
|
|
{
|
|
boxObj.Border.Width = (float)this.LineWidth;
|
|
boxObj.Border.Color = Color.Red;
|
|
}
|
|
else
|
|
{
|
|
boxObj.Border.Color = this.frameColor;
|
|
}
|
|
boxObj.Fill.IsVisible = false;
|
|
boxObj.ZOrder = ZOrder.B_BehindLegend;
|
|
ZUtil.DrawBox(boxObj, this.baseZed);
|
|
base.Refresh();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|