Last change
on this file since 1373 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
|
Rev | Line | |
---|
[1182] | 1 | using System.Drawing;
|
---|
| 2 |
|
---|
| 3 | namespace HeuristicLab.Visualization {
|
---|
| 4 | public class Grid : WorldShape {
|
---|
[1240] | 5 | public override void Draw(Graphics graphics) {
|
---|
| 6 | ClearShapes();
|
---|
[1182] | 7 |
|
---|
[1233] | 8 | foreach (double y in AxisTicks.GetTicks(YAxis.PixelsPerInterval,
|
---|
[1240] | 9 | Parent.Viewport.Height,
|
---|
[1233] | 10 | ClippingArea.Height,
|
---|
| 11 | ClippingArea.Y1)) {
|
---|
[1182] | 12 | LineShape line = new LineShape(ClippingArea.X1, y,
|
---|
| 13 | ClippingArea.X2, y,
|
---|
[1233] | 14 | Color.LightBlue, 1,
|
---|
| 15 | DrawingStyle.Dashed);
|
---|
[1240] | 16 | AddShape(line);
|
---|
[1182] | 17 | }
|
---|
| 18 |
|
---|
[1233] | 19 | foreach (double x in AxisTicks.GetTicks(XAxis.PixelsPerInterval,
|
---|
[1240] | 20 | Parent.Viewport.Width,
|
---|
[1233] | 21 | ClippingArea.Width,
|
---|
| 22 | ClippingArea.X1)) {
|
---|
[1182] | 23 | LineShape line = new LineShape(x, ClippingArea.Y1,
|
---|
| 24 | x, ClippingArea.Y2,
|
---|
[1233] | 25 | Color.LightBlue, 1,
|
---|
| 26 | DrawingStyle.Dashed);
|
---|
[1240] | 27 | AddShape(line);
|
---|
[1182] | 28 | }
|
---|
| 29 |
|
---|
| 30 | LineShape lineZeroX = new LineShape(0, ClippingArea.Y1,
|
---|
| 31 | 0, ClippingArea.Y2,
|
---|
[1233] | 32 | Color.LightBlue, 3,
|
---|
| 33 | DrawingStyle.Dashed);
|
---|
[1182] | 34 |
|
---|
| 35 | LineShape lineZeroY = new LineShape(ClippingArea.X1, 0,
|
---|
| 36 | ClippingArea.X2, 0,
|
---|
[1233] | 37 | Color.LightBlue, 3,
|
---|
| 38 | DrawingStyle.Dashed);
|
---|
[1182] | 39 |
|
---|
[1240] | 40 | AddShape(lineZeroX);
|
---|
| 41 | AddShape(lineZeroY);
|
---|
[1182] | 42 |
|
---|
[1240] | 43 | base.Draw(graphics);
|
---|
[1182] | 44 | }
|
---|
| 45 | }
|
---|
| 46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.