Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/HorizontalLineShape.cs @ 1235

Last change on this file since 1235 was 1234, checked in by mstoeger, 16 years ago

Added Xml comments for IShape, WorldShape and Transforms. (#406)

File size: 1.5 KB
Line 
1using System.Drawing;
2
3namespace HeuristicLab.Visualization {
4  public class MinMaxLineShape : WorldShape {
5    private readonly LineShape minLineShape;
6    private readonly LineShape maxLineShape;
7
8    /// <summary>
9    /// Initializes the HorizontalLineShape.
10    /// </summary>
11    /// <param name="color">color for the LineShape</param>
12    /// <param name="yMin">y value for lower line</param>
13    /// <param name="yMax">y value for upper line</param>
14    /// <param name="thickness">line thickness</param>
15    /// <param name="style">line style</param>
16    public MinMaxLineShape(double yMin, double yMax, Color color, int thickness, DrawingStyle style) {
17      minLineShape = new LineShape(0, yMin, 1, yMin, color, thickness, style);
18      maxLineShape = new LineShape(0, yMax, 1, yMax, color, thickness, style);
19      shapes.Add(minLineShape);
20      shapes.Add(maxLineShape);
21    }
22
23    public override void Draw(Graphics graphics, Rectangle parentViewport, RectangleD parentClippingArea) {
24      minLineShape.X1 = ClippingArea.X1;
25      minLineShape.X2 = ClippingArea.X2;
26      maxLineShape.X1 = ClippingArea.X1;
27      maxLineShape.X2 = ClippingArea.X2;
28      base.Draw(graphics, parentViewport, parentClippingArea);
29    }
30
31
32    public double YMin {
33      set {
34        minLineShape.Y1 = value;
35        minLineShape.Y2 = value;
36      }
37    }
38
39    public double YMax {
40      set {
41        maxLineShape.Y1 = value;
42        maxLineShape.Y2 = value;
43      }
44    }
45  }
46}
Note: See TracBrowser for help on using the repository browser.