Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/11/14 15:06:24 (10 years ago)
Author:
rstoll
Message:
  • removed ChartLogic and

moved logic accordingly to PreprocessingChartContent, ScatterPlotContent
modified views etc. to use IFilteredPreprocessingData instead of ChartLogic

  • reordered code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r10987 r10992  
    11using System;
    22using System.Collections.Generic;
    3 using System.ComponentModel;
    43using System.Drawing;
    54using System.Linq;
    6 using System.Text;
    75using System.Windows.Forms;
    86using HeuristicLab.Analysis;
    9 using HeuristicLab.Analysis.Views;
    10 using HeuristicLab.Collections;
    117using HeuristicLab.Common;
    12 using HeuristicLab.Core;
    138using HeuristicLab.Core.Views;
    14 using HeuristicLab.Data;
    159using HeuristicLab.DataPreprocessing.Implementations;
    1610using HeuristicLab.MainForm;
     
    4741    private void addHeaderToTableLayoutPanels() {
    4842
    49       List<string> variables = Content.GetVariableNames().ToList();
     43      List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList();
    5044
    5145      for (int i = 1; i < variables.Count + 1; i++) {
     
    6660    }
    6761
    68     private void GenerateMultiLayout()
    69     {
    70       List<string> variables = Content.GetVariableNames().ToList();
     62    private void GenerateMultiLayout() {
     63      List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList();
    7164
    7265      tableLayoutPanel.Controls.Clear();
     
    7669
    7770      //Set row and column count
    78       tableLayoutPanel.ColumnCount = variables.Count+1;
    79       tableLayoutPanel.RowCount = variables.Count+1;
     71      tableLayoutPanel.ColumnCount = variables.Count + 1;
     72      tableLayoutPanel.RowCount = variables.Count + 1;
    8073
    8174      tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, HEADER_WIDTH));
    8275      tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, HEADER_HEIGHT));
    8376      // set column and row layout
    84       for (int x = 0; x < variables.Count; x++)
    85       {
     77      for (int x = 0; x < variables.Count; x++) {
    8678        // auto size
    8779        if (variables.Count <= MAX_AUTO_SIZE_ELEMENTS) {
    8880          tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - HEADER_WIDTH) / variables.Count));
    8981          tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, (tableLayoutPanel.Height - HEADER_HEIGHT) / variables.Count));
    90         } 
    91         // fixed size
     82        }
     83          // fixed size
    9284        else {
    9385          tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, FIXED_CHART_WIDTH));
     
    9890      addHeaderToTableLayoutPanels();
    9991      addChartsToTableLayoutPanel();
    100  
     92
    10193    }
    10294
    10395    private void addChartsToTableLayoutPanel() {
    10496
    105       List<string> variables = Content.GetVariableNames().ToList();
     97      List<string> variables = Content.PreprocessingData.GetDoubleVariableNames().ToList();
    10698
    10799      //set scatter plots and histograms
     
    119111            tableLayoutPanel.Controls.Add(pcv, y, x);
    120112          }
    121           //scatter plot
     113            //scatter plot
    122114          else {
    123115            ScatterPlot scatterPlot = Content.CreateScatterPlot(variables[x - 1], variables[y - 1]);
     
    147139      // only one data row should be in scatter plot
    148140      if (scatterPlot.Rows.Count == 1) {
    149         string[] variables = scatterPlot.Rows.ElementAt(0).Name.Split(new string[]{" - "},StringSplitOptions.None); // extract variable names from string
     141        string[] variables = scatterPlot.Rows.ElementAt(0).Name.Split(new string[] { " - " }, StringSplitOptions.None); // extract variable names from string
    150142        scatterContent.SelectedXVariable = variables[0];
    151143        scatterContent.SelectedYVariable = variables[1];
     
    161153
    162154        // set only variable name checked
    163         foreach(var checkedItem in histoContent.VariableItemList)
    164         {
    165           if(checkedItem.Value == variableName)
    166             histoContent.VariableItemList.SetItemCheckedState(checkedItem,true);
     155        foreach (var checkedItem in histoContent.VariableItemList) {
     156          if (checkedItem.Value == variableName)
     157            histoContent.VariableItemList.SetItemCheckedState(checkedItem, true);
    167158          else
    168             histoContent.VariableItemList.SetItemCheckedState(checkedItem,false);
    169            
     159            histoContent.VariableItemList.SetItemCheckedState(checkedItem, false);
     160
    170161        }
    171162      }
     
    174165    //open histogram in new tab with new content when double clicked
    175166    private void HistogramDoubleClick(object sender, EventArgs e) {
    176       //PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender;
    177       //HistogramContent histoContent = new HistogramContent(Content,);  // create new content     
    178       //histoContent.VariableItemList = logic.CreateVariableItemList();
    179       //PreprocessingDataTable dataTable = pcv.Content;
    180       //setVariableItemListFromDataTable(histoContent, dataTable);
     167      PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender;
     168      HistogramContent histoContent = new HistogramContent(Content.PreprocessingData);  // create new content     
     169      histoContent.VariableItemList = Content.CreateVariableItemList();
     170      PreprocessingDataTable dataTable = pcv.Content;
     171      setVariableItemListFromDataTable(histoContent, dataTable);
    181172
    182       //MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView));  // open in new tab
     173      MainFormManager.MainForm.ShowContent(histoContent, typeof(HistogramView));  // open in new tab
    183174    }
    184    
     175
    185176
    186177  }
    187178
    188  
     179
    189180}
Note: See TracChangeset for help on using the changeset viewer.