Last change
on this file since 1342 was
1240,
checked in by mstoeger, 16 years ago
|
Transformations on shapes are possible outside of the Draw method. (#424)
|
File size:
1.9 KB
|
Line | |
---|
1 | using System.Drawing;
|
---|
2 |
|
---|
3 | namespace HeuristicLab.Visualization {
|
---|
4 | public class Grid : WorldShape {
|
---|
5 | public override void Draw(Graphics graphics) {
|
---|
6 | ClearShapes();
|
---|
7 |
|
---|
8 | foreach (double y in AxisTicks.GetTicks(YAxis.PixelsPerInterval,
|
---|
9 | Parent.Viewport.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 | AddShape(line);
|
---|
17 | }
|
---|
18 |
|
---|
19 | foreach (double x in AxisTicks.GetTicks(XAxis.PixelsPerInterval,
|
---|
20 | Parent.Viewport.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 | AddShape(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 | AddShape(lineZeroX);
|
---|
41 | AddShape(lineZeroY);
|
---|
42 |
|
---|
43 | base.Draw(graphics);
|
---|
44 | }
|
---|
45 | }
|
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.