Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/XAxis.cs @ 1236

Last change on this file since 1236 was 1234, checked in by mstoeger, 16 years ago

Added Xml comments for IShape, WorldShape and Transforms. (#406)

File size: 1.1 KB
Line 
1using System.Drawing;
2using HeuristicLab.Visualization.LabelProvider;
3
4namespace HeuristicLab.Visualization {
5  public class XAxis : WorldShape {
6    public const int PixelsPerInterval = 100;
7   
8    private ILabelProvider labelProvider = new ContinuousLabelProvider("0.####");
9
10    public ILabelProvider LabelProvider {
11      get { return labelProvider; }
12      set { labelProvider = value; }
13    }
14
15    public override void Draw(Graphics graphics, Rectangle parentViewport, RectangleD parentClippingArea) {
16      shapes.Clear();
17
18      foreach (double x in AxisTicks.GetTicks(PixelsPerInterval, parentViewport.Width,
19                                              ClippingArea.Width,
20                                              ClippingArea.X1)) {
21        TextShape label = new TextShape(x, ClippingArea.Height - 3,
22                                        labelProvider.GetLabel(x));
23        label.AnchorPositionX = AnchorPositionX.Middle;
24        label.AnchorPositionY = AnchorPositionY.Top;
25        shapes.Add(label);
26      }
27
28      base.Draw(graphics, parentViewport, parentClippingArea);
29    }
30  }
31}
Note: See TracBrowser for help on using the repository browser.