Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/03/09 01:42:55 (15 years ago)
Author:
mstoeger
Message:

added many new persisted properties.
removed useless comments.
added XmlSupport class since the code for setting xml attributes is always the same.
#639

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs

    r1987 r1993  
    2424    private readonly Dictionary<IDataRow, RowEntry> rowToRowEntry = new Dictionary<IDataRow, RowEntry>();
    2525
    26     private readonly ViewSettings viewSettings;
    27 
    2826    private readonly WorldShape userInteractionShape = new WorldShape();
    2927    private readonly RectangleShape rectangleShape = new RectangleShape(0, 0, 0, 0, Color.FromArgb(50, 0, 0, 255));
     
    5553
    5654      this.model = model;
    57       viewSettings = model.ViewSettings;
    58       viewSettings.OnUpdateSettings += UpdateViewSettings;
     55      this.model.ViewSettings.OnUpdateSettings += UpdateViewSettings;
    5956
    6057      Item = model;
     
    8784    /// </summary>
    8885    private void UpdateViewSettings() {
    89       titleShape.Font = viewSettings.TitleFont;
    90       titleShape.Color = viewSettings.TitleColor;
     86      titleShape.Font = model.ViewSettings.TitleFont;
     87      titleShape.Color = model.ViewSettings.TitleColor;
    9188      titleShape.Text = model.Title;
    9289
    93       legendShape.Font = viewSettings.LegendFont;
    94       legendShape.Color = viewSettings.LegendColor;
    95 
    96       xAxis.Font = viewSettings.XAxisFont;
    97       xAxis.Color = viewSettings.XAxisColor;
     90      legendShape.Font = model.ViewSettings.LegendFont;
     91      legendShape.Color = model.ViewSettings.LegendColor;
     92
     93      xAxis.Font = model.XAxis.Font;
     94      xAxis.Color = model.XAxis.Color;
    9895
    9996      SetLegendPosition();
     
    242239    /// </summary>
    243240    private void SetLegendPosition() {
    244       switch (viewSettings.LegendPosition) {
     241      switch (model.ViewSettings.LegendPosition) {
    245242        case LegendPosition.Bottom:
    246           setLegendBottom();
     243          SetLegendBottom();
    247244          break;
    248245
    249246        case LegendPosition.Top:
    250           setLegendTop();
     247          SetLegendTop();
    251248          break;
    252249
    253250        case LegendPosition.Left:
    254           setLegendLeft();
     251          SetLegendLeft();
    255252          break;
    256253
    257254        case LegendPosition.Right:
    258           setLegendRight();
     255          SetLegendRight();
    259256          break;
    260257      }
    261258    }
    262259
    263     public void setLegendRight() {
    264       // legend right
    265       legendShape.BoundingBox = new RectangleD(canvasUI.Width - legendShape.GetMaxLabelLength(), 10, canvasUI.Width,
    266                                                canvasUI.Height - 50);
     260    public void SetLegendRight() {
     261      legendShape.BoundingBox = new RectangleD(canvasUI.Width - legendShape.GetMaxLabelLength(), 10, canvasUI.Width, canvasUI.Height - 50);
    267262      legendShape.ClippingArea = new RectangleD(0, 0, legendShape.BoundingBox.Width, legendShape.BoundingBox.Height);
    268263      legendShape.Row = false;
     
    270265    }
    271266
    272     public void setLegendLeft() {
    273       // legend left
     267    public void SetLegendLeft() {
    274268      legendShape.BoundingBox = new RectangleD(10, 10, canvasUI.Width, canvasUI.Height - 50);
    275269      legendShape.ClippingArea = new RectangleD(0, 0, legendShape.BoundingBox.Width, legendShape.BoundingBox.Height);
    276270      legendShape.Row = false;
    277271      legendShape.CreateLegend();
    278 
    279       canvasUI.Invalidate();
    280     }
    281 
    282     public void setLegendTop() {
    283       // legend top
    284       legendShape.BoundingBox = new RectangleD(100, canvasUI.Height - canvasUI.Height, canvasUI.Width,
    285                                                canvasUI.Height - 10);
     272    }
     273
     274    public void SetLegendTop() {
     275      legendShape.BoundingBox = new RectangleD(100, canvasUI.Height - canvasUI.Height, canvasUI.Width, canvasUI.Height - 10);
    286276      legendShape.ClippingArea = new RectangleD(0, 0, legendShape.BoundingBox.Width, legendShape.BoundingBox.Height);
    287277      legendShape.Row = true;
     
    290280    }
    291281
    292     public void setLegendBottom() {
    293       // legend bottom
     282    public void SetLegendBottom() {
    294283      legendShape.BoundingBox = new RectangleD(100, 2, canvasUI.Width, canvasUI.Height);
    295284      legendShape.ClippingArea = new RectangleD(0, 0, legendShape.BoundingBox.Width, legendShape.BoundingBox.Height);
Note: See TracChangeset for help on using the changeset viewer.