Changeset 13045 for branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/AxisPrimitiveBase.cs
- Timestamp:
- 10/21/15 14:18:31 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/AxisPrimitiveBase.cs
r12535 r13045 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using System.Drawing; 26 23 … … 41 38 if (value != myShowGrid) { 42 39 myShowGrid = value; 43 On Update();40 OnRedrawRequired(); 44 41 } 45 42 } … … 51 48 if (value != myHorizontalLabel) { 52 49 myHorizontalLabel = value; 53 On Update();50 OnRedrawRequired(); 54 51 } 55 52 } … … 61 58 if (value != myVerticalLabel) { 62 59 myVerticalLabel = value; 63 On Update();60 OnRedrawRequired(); 64 61 } 65 62 } … … 67 64 68 65 protected AxisPrimitiveBase(IChart chart, PointD point, AxisType axisType) 69 : base(chart) { 70 Brush = Brushes.Black; 71 myPoint = point; 72 myAxisType = axisType; 73 myShowGrid = true; 74 } 75 protected AxisPrimitiveBase(IChart chart, double x, double y, AxisType axisType) 76 : this(chart, new PointD(x, y), axisType) { 77 } 66 : this(chart, point, axisType, Pens.Black, Brushes.Black) { } 78 67 protected AxisPrimitiveBase(IChart chart, PointD point, AxisType axisType, Pen pen, Brush brush) 79 68 : base(chart, pen, brush) { … … 82 71 myShowGrid = true; 83 72 } 84 protected AxisPrimitiveBase(IChart chart, double x, double y, AxisType axisType, Pen pen, Brush brush)85 : this(chart, new PointD(x, y), axisType, pen, brush) {86 }87 73 88 74 public virtual void SetPosition(PointD point) { 89 75 myPoint = point; 90 On Update();76 OnRedrawRequired(); 91 77 } 92 public void SetPosition(double x, double y) { 93 SetPosition(new PointD(x, y)); 94 } 78 95 79 public override void Move(Offset delta) { 96 80 SetPosition(Point + delta); 97 81 } 98 82 83 public override void Move(PointD point, Offset delta) { 84 Move(delta); 85 } 86 87 public override void SnapToGrid(IGrid grid) { 88 Move(grid.GetBottomLeftGridPoint(myPoint) - myPoint); 89 } 90 91 public override void SnapToGrid(PointD point, IGrid grid) { 92 SnapToGrid(grid); 93 } 94 99 95 public override bool ContainsPoint(PointD point) { 100 SizeDsize = Chart.TransformPixelToWorld(new Size(5, 5));96 var size = Chart.TransformPixelToWorld(new Size(5, 5)); 101 97 bool result = false; 102 98 if ((AxisType & AxisType.Horizontal) == AxisType.Horizontal)
Note: See TracChangeset
for help on using the changeset viewer.