Last change
on this file since 1236 was
1234,
checked in by mstoeger, 15 years ago
|
Added Xml comments for IShape, WorldShape and Transforms. (#406)
|
File size:
2.0 KB
|
Line | |
---|
1 | using System.Drawing;
|
---|
2 |
|
---|
3 | namespace HeuristicLab.Visualization {
|
---|
4 | public class Grid : WorldShape {
|
---|
5 | public override void Draw(Graphics graphics, Rectangle parentViewport, RectangleD parentClippingArea) {
|
---|
6 | shapes.Clear();
|
---|
7 |
|
---|
8 | foreach (double y in AxisTicks.GetTicks(YAxis.PixelsPerInterval,
|
---|
9 | parentViewport.Height,
|
---|
10 | ClippingArea.Height,
|
---|
11 | ClippingArea.Y1)) {
|
---|
12 | LineShape line = new LineShape(ClippingArea.X1, y,
|
---|
13 | ClippingArea.X2, y,
|
---|
14 | Color.LightBlue, 1,
|
---|
15 | DrawingStyle.Dashed);
|
---|
16 | shapes.Add(line);
|
---|
17 | }
|
---|
18 |
|
---|
19 | foreach (double x in AxisTicks.GetTicks(XAxis.PixelsPerInterval,
|
---|
20 | parentViewport.Width,
|
---|
21 | ClippingArea.Width,
|
---|
22 | ClippingArea.X1)) {
|
---|
23 | LineShape line = new LineShape(x, ClippingArea.Y1,
|
---|
24 | x, ClippingArea.Y2,
|
---|
25 | Color.LightBlue, 1,
|
---|
26 | DrawingStyle.Dashed);
|
---|
27 | shapes.Add(line);
|
---|
28 | }
|
---|
29 |
|
---|
30 | LineShape lineZeroX = new LineShape(0, ClippingArea.Y1,
|
---|
31 | 0, ClippingArea.Y2,
|
---|
32 | Color.LightBlue, 3,
|
---|
33 | DrawingStyle.Dashed);
|
---|
34 |
|
---|
35 | LineShape lineZeroY = new LineShape(ClippingArea.X1, 0,
|
---|
36 | ClippingArea.X2, 0,
|
---|
37 | Color.LightBlue, 3,
|
---|
38 | DrawingStyle.Dashed);
|
---|
39 |
|
---|
40 | shapes.Add(lineZeroX);
|
---|
41 | shapes.Add(lineZeroY);
|
---|
42 |
|
---|
43 | base.Draw(graphics, parentViewport, parentClippingArea);
|
---|
44 | }
|
---|
45 | }
|
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.