Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10818


Ignore:
Timestamp:
05/07/14 15:15:45 (11 years ago)
Author:
psteiner
Message:

Persistence of charting congfiguration

Location:
branches/DataPreprocessing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs

    r10771 r10818  
    1616      chartType = DataRowVisualProperties.DataRowChartType.Histogram;
    1717      chartTitle = HISTOGRAM_CHART_TITLE;
    18       allInOneMode = false;
    1918    }
    2019
     
    2524
    2625    private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) {
    27       if (allInOneMode == false)
    28         allInOneMode = true;
     26      if (allInOneCheckBox.Checked)
     27        Content.AllInOneMode = true;
    2928      else
    30         allInOneMode = false;
     29        Content.AllInOneMode = false;
    3130      GenerateChart();
     31    }
     32
     33    protected override void OnContentChanged()
     34    {
     35      base.OnContentChanged();
     36      if (Content != null)
     37      {
     38        allInOneCheckBox.Checked = Content.AllInOneMode;
     39      }
    3240    }
    3341
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/LineChartView.cs

    r10736 r10818  
    4545
    4646    private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) {
    47       if (allInOneMode == false)
    48         allInOneMode = true;
     47      if (allInOneCheckBox.Checked)
     48        Content.AllInOneMode = true;
    4949      else
    50         allInOneMode = false;
     50        Content.AllInOneMode = false;
    5151      GenerateChart();
     52    }
     53
     54    protected override void OnContentChanged()
     55    {
     56      base.OnContentChanged();
     57      if (Content != null)
     58      {
     59        allInOneCheckBox.Checked = Content.AllInOneMode;
     60      }
    5261    }
    5362  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs

    r10817 r10818  
    4141    private PreprocessingDataTable dataTable;
    4242    private List<PreprocessingDataTable> dataTablePerVariable;
    43     private ICheckedItemList<StringValue> variableItemList;
    4443    private List<DataRow> dataRows;
    4544
    4645    protected DataRowVisualProperties.DataRowChartType chartType;
    4746    protected string chartTitle;
    48     protected bool allInOneMode;
    4947
    5048    private const string DEFAULT_CHART_TITLE = "Chart";
     
    5553      chartType = DataRowVisualProperties.DataRowChartType.Line;
    5654      chartTitle = DEFAULT_CHART_TITLE;
    57       allInOneMode = true;
    5855    }
    5956
     
    7370      }
    7471
    75       if (!allInOneMode)
     72      //if (!Content.AllInOneMode)
     73        if (Content != null && !Content.AllInOneMode)
    7674        GenerateChart();
    7775
     
    104102
    105103    private void InitData() {
    106       variableItemList = logic.CreateVariableItemList();
    107       checkedItemList.Content = variableItemList;
     104      if (Content.VariableItemList == null)
     105      {
     106        Content.VariableItemList = logic.CreateVariableItemList();
     107      }
     108      checkedItemList.Content = Content.VariableItemList;
    108109      dataRows = logic.CreateAllDataRows(chartType);
    109110
     
    115116      // init data table per variable
    116117      dataTablePerVariable = new List<PreprocessingDataTable>();
    117       foreach (var checkedItem in variableItemList.CheckedItems) {
    118         string variableName = variableItemList[checkedItem.Index].Value;
     118      foreach (var checkedItem in Content.VariableItemList.CheckedItems)
     119      {
     120        string variableName = Content.VariableItemList[checkedItem.Index].Value;
    119121        PreprocessingDataTable d = new PreprocessingDataTable(variableName);
    120122        DataRow row = GetDataRow(variableName);
     
    144146        logic = Content.ChartLogic;
    145147        InitData();
    146         variableItemList.CheckedItemsChanged += CheckedItemsChanged;
     148        Content.VariableItemList.CheckedItemsChanged += CheckedItemsChanged;
    147149        GenerateChart();
    148150      }
     
    190192      d.Rows.Add(row);
    191193      dataTablePerVariable.Add(d);
    192       variableItemList.Add(new StringValue(name));
    193       if (!allInOneMode)
     194      Content.VariableItemList.Add(new StringValue(name));
     195      if (!Content.AllInOneMode)
    194196        GenerateChart();
    195197    }
     
    202204      StringValue stringValue = FindVariableItemList(name);
    203205      if (stringValue != null)
    204         variableItemList.Remove(stringValue);
    205       if (!allInOneMode)
     206        Content.VariableItemList.Remove(stringValue);
     207      if (!Content.AllInOneMode)
    206208        GenerateChart();
    207209    }
    208210
    209211    private StringValue FindVariableItemList(string name) {
    210       foreach (StringValue stringValue in variableItemList) {
     212      foreach (StringValue stringValue in Content.VariableItemList)
     213      {
    211214        if (stringValue.Value == name)
    212215          return stringValue;
     
    219222      ClearTableLayout();
    220223
    221       if (allInOneMode) {
     224      if (Content.AllInOneMode)
     225      {
    222226        GenerateSingleChartLayout();
    223227      } else
     
    247251    private void GenerateMultiChartLayout() {
    248252      int checkedItemsCnt = 0;
    249       foreach (var item in variableItemList.CheckedItems)
     253      foreach (var item in Content.VariableItemList.CheckedItems)
    250254        checkedItemsCnt++;
    251255
     
    320324
    321325    private void radioButton1_CheckedChanged(object sender, EventArgs e) {
    322       if (allInOneMode == false)
    323         allInOneMode = true;
     326      if (Content.AllInOneMode == false)
     327        Content.AllInOneMode = true;
    324328      else
    325         allInOneMode = false;
     329        Content.AllInOneMode = false;
    326330      GenerateChart();
    327331    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingChartContent.cs

    r10658 r10818  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Data;
     26using System;
     27using System.Collections.Generic;
    2528
    2629namespace HeuristicLab.DataPreprocessing {
    2730  [Item("PreprocessingChart", "Represents a preprocessing chart.")]
    2831  public class PreprocessingChartContent : Item, IViewShortcut {
     32
     33    private bool allInOneMode = true;
     34
     35    private ICheckedItemList<StringValue> variableItemList = null;
     36
    2937
    3038    private readonly IChartLogic chartLogic;
     
    5563      remove { chartLogic.Changed -= value; }
    5664    }
     65
     66    public bool AllInOneMode
     67    {
     68      get { return this.allInOneMode; }
     69      set { this.allInOneMode = value; }
     70    }
     71
     72    public ICheckedItemList<StringValue> VariableItemList
     73    {
     74      get { return this.variableItemList; }
     75      set { this.variableItemList = value; }
     76    }
    5777  }
    5878}
Note: See TracChangeset for help on using the changeset viewer.