Changeset 1457 for trunk/sources/HeuristicLab.Visualization/YAxis.cs
- Timestamp:
- 03/27/09 17:34:56 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/YAxis.cs
r1343 r1457 1 using System; 1 2 using System.Drawing; 2 3 using HeuristicLab.Visualization.LabelProvider; 4 using HeuristicLab.Visualization.Test; 3 5 4 6 namespace HeuristicLab.Visualization { … … 7 9 8 10 private ILabelProvider labelProvider = new ContinuousLabelProvider("e4"); 11 private AxisPosition position = AxisPosition.Left; 9 12 10 13 public ILabelProvider LabelProvider { 11 14 get { return labelProvider; } 12 15 set { labelProvider = value; } 16 } 17 18 public AxisPosition Position { 19 get { return position; } 20 set { position = value; } 13 21 } 14 22 … … 19 27 ClippingArea.Height, 20 28 ClippingArea.Y1)) { 21 TextShape label = new TextShape(ClippingArea.X2 - 3, y, 22 labelProvider.GetLabel(y)); 23 label.AnchorPositionX = AnchorPositionX.Right; 29 double x; 30 AnchorPositionX anchorPositionX; 31 32 switch (position) { 33 case AxisPosition.Left: 34 x = ClippingArea.X2 - 3; 35 anchorPositionX = AnchorPositionX.Right; 36 break; 37 case AxisPosition.Right: 38 x = ClippingArea.X1 + 3; 39 anchorPositionX = AnchorPositionX.Left; 40 break; 41 default: 42 throw new NotImplementedException(); 43 } 44 45 TextShape label = new TextShape(x, y, labelProvider.GetLabel(y)); 46 label.AnchorPositionX = anchorPositionX; 24 47 label.AnchorPositionY = AnchorPositionY.Middle; 25 48 AddShape(label);
Note: See TracChangeset
for help on using the changeset viewer.