//void container_CalculatorChanged() //{ // InsideRadius = Container.Calculator.radius; // OutsideRadius = InsideRadius + DefaultLoopWidthInPoints / Container.UnitSize; // Clear(); // Initialize(); //} //void Container_UnitSizeChanged(float oldSize, float newSize) //{ // OutsideRadius = InsideRadius + DefaultLoopWidthInPoints / newSize; // Clear(); // Initialize(); //} //void Container_MaxCycleChanged(int oldMax, int newMax) //{ // InsideRadius = Container.Calculator.radius; // OutsideRadius = InsideRadius + DefaultLoopWidthInPoints / Container.UnitSize; // Clear(); // Initialize(); //} public void Draw(Graphics g) { if (IsVisible) { Circles.Draw(g); TicksAndLables.Draw(g); } }
public void Initialize() { Circles.Mapper = this.ToPhysicalAngle; TicksAndLables.Mapper = this.ToPhysicalAngle; Circles.Add(new PointF(), OutsideRadius, false, new SolidBrush(LoopColor), new Pen(BorderColor, BorderWidth)); Circles.Add(new PointF(), InsideRadius, false, IsTransparent ? new SolidBrush(Color.Transparent) : new SolidBrush(FaceColor), new Pen(BorderColor, BorderWidth)); #region Add Ticks if (MajorTickStep > 0) { Pen majorPen = new Pen(ScaleColor, 3); TicksAndLables.AddLines(InsideRadius, 0, -0.4f, MajorTickStep, majorPen, null, false); TicksAndLables.AddLines(OutsideRadius - 0.2f, 0, -0.4f, MajorTickStep, majorPen, null, false); } if (MiddleTickStep > 0) { Pen middlePen = new Pen(ScaleColor, 2); AngleFilterDelegate filter = new AngleFilterDelegate(x => x % MajorTickStep == 0); TicksAndLables.AddLines(InsideRadius, 0, -0.2f, MiddleTickStep, middlePen, filter, false); TicksAndLables.AddLines(OutsideRadius - 0.1f, 0, -0.2f, MiddleTickStep, middlePen, filter, false); } if (MinorTickStep > 0) { Pen minorPen = new Pen(ScaleColor, 1); //AngleFilterDelegate filter = new AngleFilterDelegate(x => x % MiddleTickStep == 0); TicksAndLables.AddLines(InsideRadius, 0, -0.2f, MinorTickStep, minorPen, (x => x % MiddleTickStep == 0), true); TicksAndLables.AddLines(OutsideRadius - 0.1f, 0, -0.2f, MinorTickStep, minorPen, (x => x % MiddleTickStep == 0), true); } #endregion float middle = (InsideRadius + OutsideRadius) / 2f; if (LabelStep > 0) { TicksAndLables.AddLables(new Font("AstroGadget", 9f, FontStyle.Regular), new SolidBrush(LabelColor), middle, 0, 0, 12, null, null); } if (SignOffset > 0) { List <string> signs = new List <string>(); for (char c = 'a'; c < 'm'; c++) { signs.Add(c.ToString()); } TicksAndLables.AddLables(signs, new Font("AstroGadget", 24f, FontStyle.Bold), new SolidBrush(IsTransparent ? Color.FromArgb(127, Color.Crimson) : Color.Crimson), middle, SignOffset, -90f, null, null); } }
public void Dispose() { Circles.Dispose(); TicksAndLables.Dispose(); }
public void Clear() { Circles.Clear(); TicksAndLables.Clear(); }