Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1046


Ignore:
Timestamp:
12/21/08 19:51:05 (15 years ago)
Author:
shofstad
Message:

Legend implementation finished (#407)

Location:
trunk/sources/HeuristicLab.Visualization
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/XAxis.cs

    r1038 r1046  
    33
    44namespace HeuristicLab.Visualization {
    5   // TODO move to own file
    6   public class TextShape : IShape {
    7     private double x;
    8     private double y;
    9     private string text;
    10 
    11     private Font font;
    12     private Color color;
    13     private Brush brush;
    14 
    15     public TextShape(double x, double y, string text) : this(x, y, text, 8) {}
    16 
    17     public TextShape(double x, double y, string text, int fontSize) {
    18       this.x = x;
    19       this.y = y;
    20       this.text = text;
    21       this.font = new Font("Arial", fontSize);
    22 
    23       this.Color = Color.Blue;
    24     }
    25 
    26     public void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) {
    27       int screenX = Transform.ToScreenX(x, viewport, clippingArea);
    28       int screenY = Transform.ToScreenY(y, viewport, clippingArea);
    29 
    30       graphics.DrawString(text, font, brush, screenX, screenY);
    31     }
    32 
    33     public RectangleD BoundingBox {
    34       get { return RectangleD.Empty; }
    35     }
    36 
    37     public string Text {
    38       get { return text; }
    39       set { text = value; }
    40     }
    41 
    42     public double X {
    43       get { return x; }
    44       set { x = value; }
    45     }
    46 
    47     public double Y {
    48       get { return y; }
    49       set { y = value; }
    50     }
    51 
    52     public Color Color {
    53       get { return color; }
    54       set {
    55         this.color = value;
    56         this.brush = new SolidBrush(color);
    57       }
    58     }
    59   }
    605
    616  public class XAxis : WorldShape {
Note: See TracChangeset for help on using the changeset viewer.