Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/3.2/YAxisGrid.cs @ 3013

Last change on this file since 3013 was 1964, checked in by mstoeger, 16 years ago

moved the canvas and the basic types of shapes to their own namespace. #498

File size: 1.5 KB
RevLine 
[1182]1using System.Drawing;
[1964]2using HeuristicLab.Visualization.Drawing;
[1182]3
4namespace HeuristicLab.Visualization {
[1876]5  public class YAxisGrid : WorldShape {
[1458]6    private Color color = Color.LightBlue;
7
[1240]8    public override void Draw(Graphics graphics) {
9      ClearShapes();
[1182]10
[1233]11      foreach (double y in AxisTicks.GetTicks(YAxis.PixelsPerInterval,
[1240]12                                              Parent.Viewport.Height,
[1233]13                                              ClippingArea.Height,
14                                              ClippingArea.Y1)) {
[1182]15        LineShape line = new LineShape(ClippingArea.X1, y,
16                                       ClippingArea.X2, y,
[1458]17                                       color, 1,
[1233]18                                       DrawingStyle.Dashed);
[1240]19        AddShape(line);
[1182]20      }
21
22      LineShape lineZeroX = new LineShape(0, ClippingArea.Y1,
23                                          0, ClippingArea.Y2,
[1458]24                                          color, 3,
[1233]25                                          DrawingStyle.Dashed);
[1182]26
27      LineShape lineZeroY = new LineShape(ClippingArea.X1, 0,
28                                          ClippingArea.X2, 0,
[1458]29                                          color, 3,
[1233]30                                          DrawingStyle.Dashed);
[1182]31
[1240]32      AddShape(lineZeroX);
33      AddShape(lineZeroY);
[1182]34
[1240]35      base.Draw(graphics);
[1182]36    }
[1458]37
38    public Color Color {
39      get { return color; }
40      set { color = value; }
41    }
[1182]42  }
43}
Note: See TracBrowser for help on using the repository browser.