Free cookie consent management tool by TermsFeed Policy Generator

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

Persistence of charting congfiguration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.