using System.Drawing;
using System.Drawing.Drawing2D;
namespace HeuristicLab.Visualization {
public class MinMaxLineShape : WorldShape {
private LineShape minLineShape;
private LineShape maxLineShape;
///
/// Initializes the HorizontalLineShape.
///
/// Z-order
/// color for the LineShape
/// y value for lower line
/// y value for upper line
/// line thickness
/// line style
public MinMaxLineShape(double yMin, double yMax, double z, Color color, int thickness, DrawingStyle style) {
minLineShape = new LineShape(0, yMin, 1, yMin, z, color, thickness, style);
maxLineShape = new LineShape(0, yMax, 1, yMax, z, color, thickness, style);
shapes.Add(minLineShape);
shapes.Add(maxLineShape);
}
///
/// Draws the HorizontalLineShape.
///
/// graphics handle to draw to
/// rectangle in value-coordinates to display
/// rectangle in screen-coordinates to draw
public override void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) {
minLineShape.X1 = ClippingArea.X1;
minLineShape.X2 = ClippingArea.X2;
maxLineShape.X1 = ClippingArea.X1;
maxLineShape.X2 = ClippingArea.X2;
base.Draw(graphics, viewport, clippingArea);
}
public double YMin {
set {
minLineShape.Y1 = value;
minLineShape.Y2 = value;
}
}
public double YMax {
set {
maxLineShape.Y1 = value;
maxLineShape.Y2 = value;
}
}
}
}