Changeset 1341


Ignore:
Timestamp:
03/13/09 18:21:26 (12 years ago)
Author:
bspisic
Message:

#520 Renamed ViewPropertiesModel to ViewSettings and moved from LineChart to ChartDataRowsModel

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

Legend:

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

    r1285 r1341  
    66using System.Text;
    77using HeuristicLab.Visualization.LabelProvider;
     8using HeuristicLab.Visualization.Options;
    89
    910namespace HeuristicLab.Visualization{
     
    1617    //private string xAxisLabel;
    1718    private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");
     19
     20    private ViewSettings viewSettings = new ViewSettings();
    1821
    1922    public ILabelProvider XAxisLabelProvider {
     
    129132        return max;
    130133      }
     134    }
     135
     136    public ViewSettings ViewSettings {
     137      get { return viewSettings; }
     138      set { viewSettings = value; }
    131139    }
    132140
  • trunk/sources/HeuristicLab.Visualization/HeuristicLab.Visualization.csproj

    r1337 r1341  
    100100      <DependentUpon>OptionsDialog.cs</DependentUpon>
    101101    </Compile>
    102     <Compile Include="Options\ViewPropertiesModel.cs" />
     102    <Compile Include="Options\ViewSettings.cs" />
    103103    <Compile Include="PanListener.cs" />
    104104    <Compile Include="LabelProvider\StringLabelProvider.cs" />
  • trunk/sources/HeuristicLab.Visualization/IChartDataRowsModel.cs

    r1285 r1341  
    22using HeuristicLab.Core;
    33using HeuristicLab.Visualization.LabelProvider;
     4using HeuristicLab.Visualization.Options;
    45
    56namespace HeuristicLab.Visualization {
     
    2526    int MaxDataRowValues { get; }
    2627
     28    ViewSettings ViewSettings { get; set; }
     29
    2730    event ModelChangedHandler ModelChanged;
    2831    event DataRowAddedHandler DataRowAdded;
  • trunk/sources/HeuristicLab.Visualization/LineChart.cs

    r1337 r1341  
    1919    private readonly Dictionary<IDataRow, RowEntry> rowToRowEntry = new Dictionary<IDataRow, RowEntry>();
    2020
     21    private readonly ViewSettings viewSettings;
     22
    2123//    private readonly Stack<RectangleD> clippingAreaHistory = new Stack<RectangleD>();
    2224    private readonly WorldShape userInteractionShape = new WorldShape();
     
    2931    private bool zoomToFullView;
    3032
    31     private readonly ViewPropertiesModel viewPropertiesModel;
    3233
    3334    /// <summary>
     
    5051
    5152      this.model = model;
    52       viewPropertiesModel = new ViewPropertiesModel(titleShape.Font, titleShape.Color, legendShape.Font, legendShape.Color, xAxis.Font, xAxis.Color);
    53       viewPropertiesModel.OnUpdateProperties += UpdateViewProperties;
     53      viewSettings = model.ViewSettings;
     54      viewSettings.OnUpdateSettings += UpdateViewProperties;
    5455
    5556      Item = model;
     
    6263
    6364    private void UpdateViewProperties() {
    64       titleShape.Font = viewPropertiesModel.TitleFont;
    65       titleShape.Color = viewPropertiesModel.TitleColor;
    66 
    67       legendShape.Font = viewPropertiesModel.LegendFont;
    68       legendShape.Color = viewPropertiesModel.LegendColor;
    69 
    70       xAxis.Font = viewPropertiesModel.XAxisFont;
    71       xAxis.Color = viewPropertiesModel.XAxisColor;
     65      titleShape.Font = viewSettings.TitleFont;
     66      titleShape.Color = viewSettings.TitleColor;
     67
     68      legendShape.Font = viewSettings.LegendFont;
     69      legendShape.Color = viewSettings.LegendColor;
     70
     71      xAxis.Font = viewSettings.XAxisFont;
     72      xAxis.Color = viewSettings.XAxisColor;
    7273
    7374      canvasUI.Invalidate();
     
    145146
    146147    private void optionsToolStripMenuItem_Click(object sender, EventArgs e) {
    147       OptionsDialog optionsdlg = new OptionsDialog(this.model, viewPropertiesModel);
     148      OptionsDialog optionsdlg = new OptionsDialog(model);
    148149      optionsdlg.ShowDialog(this);
    149150    }
  • trunk/sources/HeuristicLab.Visualization/Options/OptionsDialog.cs

    r1337 r1341  
    66  public partial class OptionsDialog : Form {
    77    private readonly IChartDataRowsModel model;
    8     private readonly ViewPropertiesModel propertiesModel;
     8    private readonly ViewSettings viewSettings;
    99
    10     public OptionsDialog(IChartDataRowsModel model, ViewPropertiesModel propertiesModel) {
     10    public OptionsDialog(IChartDataRowsModel model) {
    1111      InitializeComponent();
    1212
    1313      this.model = model;
    14       this.propertiesModel = propertiesModel;
     14      viewSettings = model.ViewSettings;
    1515    }
    1616
     
    7575
    7676    private void btnChangeTitleFont_Click(object sender, EventArgs e) {
    77       fdFont.Font = propertiesModel.TitleFont;
    78       fdFont.Color = propertiesModel.TitleColor;
     77      fdFont.Font = viewSettings.TitleFont;
     78      fdFont.Color = viewSettings.TitleColor;
    7979
    8080      DialogResult dr = fdFont.ShowDialog();
    8181
    8282      if(dr == DialogResult.OK) {
    83         propertiesModel.TitleFont = fdFont.Font;
    84         propertiesModel.TitleColor = fdFont.Color;
     83        viewSettings.TitleFont = fdFont.Font;
     84        viewSettings.TitleColor = fdFont.Color;
    8585
    86         propertiesModel.UpdateView();
     86        viewSettings.UpdateView();
    8787      }
    8888    }
    8989
    9090    private void btnChangeLegendFont_Click(object sender, EventArgs e) {
    91       fdFont.Font = propertiesModel.LegendFont;
    92       fdFont.Color = propertiesModel.LegendColor;
     91      fdFont.Font = viewSettings.LegendFont;
     92      fdFont.Color = viewSettings.LegendColor;
    9393
    9494      DialogResult dr = fdFont.ShowDialog();
    9595
    9696      if (dr == DialogResult.OK) {
    97         propertiesModel.LegendFont = fdFont.Font;
    98         propertiesModel.LegendColor = fdFont.Color;
     97        viewSettings.LegendFont = fdFont.Font;
     98        viewSettings.LegendColor = fdFont.Color;
    9999
    100         propertiesModel.UpdateView();
     100        viewSettings.UpdateView();
    101101      }
    102102    }
    103103
    104104    private void btnChangeXAxisFont_Click(object sender, EventArgs e) {
    105       fdFont.Font = propertiesModel.XAxisFont;
    106       fdFont.Color = propertiesModel.XAxisColor;
     105      fdFont.Font = viewSettings.XAxisFont;
     106      fdFont.Color = viewSettings.XAxisColor;
    107107
    108108      DialogResult dr = fdFont.ShowDialog();
    109109
    110110      if (dr == DialogResult.OK) {
    111         propertiesModel.XAxisFont = fdFont.Font;
    112         propertiesModel.XAxisColor = fdFont.Color;
     111        viewSettings.XAxisFont = fdFont.Font;
     112        viewSettings.XAxisColor = fdFont.Color;
    113113
    114         propertiesModel.UpdateView();
     114        viewSettings.UpdateView();
    115115      }
    116116    }
Note: See TracChangeset for help on using the changeset viewer.