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