Last change
on this file since 1109 was
1038,
checked in by mstoeger, 16 years ago
|
Modified the XAxis labels so they are always visible at the bottom. (#433)
Added simple layout management to the line chart's root shape containing a title-, lines- and xaxis-area. (#345)
|
File size:
1.2 KB
|
Rev | Line | |
---|
[635] | 1 | using System.Drawing;
|
---|
| 2 |
|
---|
| 3 | namespace HeuristicLab.Visualization {
|
---|
| 4 | public class RectangleShape : IShape {
|
---|
[984] | 5 | private RectangleD rectangle;
|
---|
[635] | 6 | private Color color;
|
---|
[996] | 7 | private int opacity = 255;
|
---|
[635] | 8 |
|
---|
[1038] | 9 | public RectangleShape(double x1, double y1, double x2, double y2, Color color) {
|
---|
[984] | 10 | rectangle = new RectangleD(x1, y1, x2, y2);
|
---|
[635] | 11 | this.color = color;
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | public RectangleD BoundingBox {
|
---|
[984] | 15 | get { return rectangle; }
|
---|
[635] | 16 | }
|
---|
| 17 |
|
---|
| 18 | public void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) {
|
---|
[996] | 19 | Color brushColor = Color.FromArgb(opacity, color);
|
---|
[984] | 20 |
|
---|
[635] | 21 | using (Pen pen = new Pen(color, 1))
|
---|
[984] | 22 | using (Brush brush = new SolidBrush(brushColor)) {
|
---|
| 23 | Rectangle screenRect = Transform.ToScreen(rectangle, viewport, clippingArea);
|
---|
[635] | 24 |
|
---|
| 25 | graphics.DrawRectangle(pen, screenRect);
|
---|
| 26 | graphics.FillRectangle(brush, screenRect);
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
[996] | 30 | public int Opacity {
|
---|
| 31 | get { return opacity; }
|
---|
| 32 | set { opacity = value; }
|
---|
| 33 | }
|
---|
| 34 |
|
---|
[984] | 35 | public RectangleD Rectangle {
|
---|
| 36 | get { return rectangle; }
|
---|
| 37 | set { rectangle = value; }
|
---|
| 38 | }
|
---|
[1038] | 39 |
|
---|
| 40 | public Color Color {
|
---|
| 41 | get { return color; }
|
---|
| 42 | set { color = value; }
|
---|
| 43 | }
|
---|
[635] | 44 | }
|
---|
[984] | 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.