Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/14 10:52:55 (11 years ago)
Author:
aesterer
Message:

Created base view PreprocessingChartView for LineChartView and HistogramView. Replaced HistogramLogic and LineChartlogic with ChartLogic. Added base content ChartContent for LineChartContent and HistogramContent.

Location:
branches/DataPreprocessing
Files:
4 added
3 deleted
5 edited
3 copied
2 moved

Legend:

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

    r10636 r10658  
    5050        var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic);
    5151        var transformationLogic = new TransformationLogic(data, searchLogic, statisticsLogic);
    52         var lineChartLogic = new LineChartLogic(data);
    53         var histogramLogic = new HistogramLogic(data);
     52        var lineChartLogic = new ChartLogic(data);
     53        var histogramLogic = new ChartLogic(data);
    5454        var filterLogic = new FilterLogic(data);
    5555
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj

    r10657 r10658  
    9191      <DependentUpon>FindAndReplaceDialog.cs</DependentUpon>
    9292    </Compile>
    93     <Compile Include="HistogramView.cs">
    94       <SubType>UserControl</SubType>
    95     </Compile>
     93    <Compile Include="HistogramView.cs" />
    9694    <Compile Include="HistogramView.Designer.cs">
    9795      <DependentUpon>HistogramView.cs</DependentUpon>
    9896    </Compile>
    99     <Compile Include="LineChartView.cs">
    100       <SubType>UserControl</SubType>
    101     </Compile>
     97    <Compile Include="LineChartView.cs" />
    10298    <Compile Include="LineChartView.Designer.cs">
    10399      <DependentUpon>LineChartView.cs</DependentUpon>
    104100    </Compile>
    105101    <Compile Include="Plugin.cs" />
     102    <Compile Include="PreprocessingChartView.cs" />
     103    <Compile Include="PreprocessingChartView.Designer.cs">
     104      <DependentUpon>PreprocessingChartView.cs</DependentUpon>
     105    </Compile>
    106106    <Compile Include="PreprocessingCheckedItemListView.cs">
    107107      <SubType>UserControl</SubType>
     
    220220      <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
    221221    </ProjectReference>
    222   </ItemGroup>
    223   <ItemGroup>
    224     <EmbeddedResource Include="DataPreprocessingView.resx">
    225       <DependentUpon>DataPreprocessingView.cs</DependentUpon>
    226     </EmbeddedResource>
    227222  </ItemGroup>
    228223  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.Designer.cs

    r10657 r10658  
    2222using HeuristicLab.Data;
    2323namespace HeuristicLab.DataPreprocessing.Views {
    24   partial class LineChartView {
     24  partial class PreprocessingChartView {
    2525    /// <summary>
    2626    /// Required designer variable.
     
    4646    /// </summary>
    4747    private void InitializeComponent() {
    48       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    49       this.groupBoxOptions = new System.Windows.Forms.GroupBox();
    5048      this.checkedItemList = new HeuristicLab.DataPreprocessing.Views.PreprocessingCheckedItemListView();
     49      this.chartPanel = new System.Windows.Forms.Panel();
     50      this.dataTableView = new HeuristicLab.Analysis.Views.DataTableView();
     51      this.chartPanel.SuspendLayout();
    5152      this.SuspendLayout();
    52       //
    53       // viewHost
    54       //
    55       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    56             | System.Windows.Forms.AnchorStyles.Left)
    57             | System.Windows.Forms.AnchorStyles.Right)));
    58       this.viewHost.Caption = "View";
    59       this.viewHost.Content = null;
    60       this.viewHost.Enabled = false;
    61       this.viewHost.Location = new System.Drawing.Point(162, 4);
    62       this.viewHost.Name = "viewHost";
    63       this.viewHost.ReadOnly = false;
    64       this.viewHost.Size = new System.Drawing.Size(489, 396);
    65       this.viewHost.TabIndex = 0;
    66       this.viewHost.ViewsLabelVisible = true;
    67       this.viewHost.ViewType = null;
    68       //
    69       // groupBoxOptions
    70       //
    71       this.groupBoxOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    72       this.groupBoxOptions.Location = new System.Drawing.Point(4, 262);
    73       this.groupBoxOptions.Name = "groupBoxOptions";
    74       this.groupBoxOptions.Size = new System.Drawing.Size(152, 138);
    75       this.groupBoxOptions.TabIndex = 3;
    76       this.groupBoxOptions.TabStop = false;
    77       this.groupBoxOptions.Text = "Options";
    7853      //
    7954      // checkedItemList
     
    8964      this.checkedItemList.TabIndex = 4;
    9065      //
     66      // chartPanel
     67      //
     68      this.chartPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     69            | System.Windows.Forms.AnchorStyles.Left)
     70            | System.Windows.Forms.AnchorStyles.Right)));
     71      this.chartPanel.Controls.Add(this.dataTableView);
     72      this.chartPanel.Location = new System.Drawing.Point(163, 4);
     73      this.chartPanel.Name = "chartPanel";
     74      this.chartPanel.Size = new System.Drawing.Size(488, 396);
     75      this.chartPanel.TabIndex = 5;
     76      //
     77      // dataTableView
     78      //
     79      this.dataTableView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     80            | System.Windows.Forms.AnchorStyles.Left)
     81            | System.Windows.Forms.AnchorStyles.Right)));
     82      this.dataTableView.Caption = "DataTable View";
     83      this.dataTableView.Content = null;
     84      this.dataTableView.Location = new System.Drawing.Point(3, 3);
     85      this.dataTableView.Name = "dataTableView";
     86      this.dataTableView.ReadOnly = false;
     87      this.dataTableView.Size = new System.Drawing.Size(482, 390);
     88      this.dataTableView.TabIndex = 0;
     89      //
    9190      // LineChartView
    9291      //
    9392      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    9493      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     94      this.Controls.Add(this.chartPanel);
    9595      this.Controls.Add(this.checkedItemList);
    96       this.Controls.Add(this.groupBoxOptions);
    97       this.Controls.Add(this.viewHost);
    9896      this.Name = "LineChartView";
    9997      this.Size = new System.Drawing.Size(654, 403);
     98      this.chartPanel.ResumeLayout(false);
    10099      this.ResumeLayout(false);
    101100
     
    104103    #endregion
    105104
    106     private MainForm.WindowsForms.ViewHost viewHost;
    107     private System.Windows.Forms.GroupBox groupBoxOptions;
    108105    private PreprocessingCheckedItemListView checkedItemList;
     106    private System.Windows.Forms.Panel chartPanel;
     107    private Analysis.Views.DataTableView dataTableView;
    109108  }
    110109}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs

    r10633 r10658  
    3030namespace HeuristicLab.DataPreprocessing.Views {
    3131
    32   [View("Line Chart View")]
    33   [Content(typeof(LineChartContent), false)]
    34   public partial class LineChartView : ItemView {
     32  [View("Preprocessing Chart View")]
     33  [Content(typeof(PreprocessingChartContent), false)]
     34  public partial class PreprocessingChartView : ItemView {
    3535
    36     private ILineChartLogic logic;
     36    private IChartLogic logic;
    3737    private DataTable dataTable;
    38     private ICheckedItemList<StringValue> itemList;
    39     private const string LINE_CHART_TITLE = "LineChart";
     38    private ICheckedItemList<StringValue> variableItemList;   
     39    protected DataRowVisualProperties.DataRowChartType chartType;
     40    protected string chartTitle;
    4041
    41     public LineChartView() {
     42    private const string DEFAULT_CHART_TITLE = "Chart";
     43
     44
     45    public PreprocessingChartView() {
    4246      InitializeComponent();
     47      chartType = DataRowVisualProperties.DataRowChartType.Line;
     48      chartTitle = DEFAULT_CHART_TITLE;
    4349    }
    4450
     
    5056          dataTable.Rows.Remove(variableName);
    5157        } else {
    52           dataTable.Rows.Add(logic.CreateDataRow(variableName));
     58          dataTable.Rows.Add(logic.CreateDataRow(variableName, chartType));
    5359        }
    5460      }
     
    6571
    6672    private void InitDataTable() {
    67       dataTable = logic.CreateDataTable(LINE_CHART_TITLE);
    68       viewHost.Content = dataTable;
     73      dataTable = logic.CreateDataTable(chartTitle, chartType);
     74      dataTableView.Content = dataTable;
    6975    }
    7076
    7177    private void InitVariablesListBox() {
    72       itemList = logic.CreateVariableItemList();
    73       checkedItemList.Content = itemList;
     78      variableItemList = logic.CreateVariableItemList();
     79      checkedItemList.Content = variableItemList;
    7480    }
    7581
     
    8591
    8692    void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) {
    87       viewHost.Refresh();
     93      dataTableView.Refresh();
    8894    }
    8995
    90     public new LineChartContent Content {
    91       get { return (LineChartContent)base.Content; }
     96    public new PreprocessingChartContent Content {
     97      get { return (PreprocessingChartContent)base.Content; }
    9298      set { base.Content = value; }
    9399    }
     
    96102      base.OnContentChanged();
    97103      if (Content != null) {
    98         logic = Content.LineChartLogic;
     104        logic = Content.ChartLogic;
    99105        InitDataTable();
    100106        InitVariablesListBox();
    101         itemList.CheckedItemsChanged += CheckedItemsChanged;
     107        variableItemList.CheckedItemsChanged += CheckedItemsChanged;
    102108        logic.Changed += PreprocessingData_Changed;
    103109      }
     
    116122        case DataPreprocessingChangedEventType.ChangeItem:
    117123          dataTable.Rows.Remove(logic.GetVariableNameByIndex(e.Column));
    118           dataTable.Rows.Add(logic.CreateDataRow((logic.GetVariableNameByIndex(e.Column))));
     124          dataTable.Rows.Add(logic.CreateDataRow(logic.GetVariableNameByIndex(e.Column),chartType));
    119125          break;
    120126        case DataPreprocessingChangedEventType.DeleteRow:
     
    127133    // add variable to data table and item list
    128134    private void AddVariable(string name) {
    129       dataTable.Rows.Add(logic.CreateDataRow(name));
    130       itemList.Add(new StringValue(name));
     135      dataTable.Rows.Add(logic.CreateDataRow(name, chartType));
     136      variableItemList.Add(new StringValue(name));
    131137    }
    132138
     
    137143      StringValue stringValue = FindVariableItemList(name);
    138144      if (stringValue != null)
    139         itemList.Remove(stringValue);
     145        variableItemList.Remove(stringValue);
    140146
    141147    }
    142148
    143149    private StringValue FindVariableItemList(string name) {
    144       foreach (StringValue stringValue in itemList) {
     150      foreach (StringValue stringValue in variableItemList) {
    145151        if (stringValue.Value == name)
    146152          return stringValue;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10638 r10658  
    7272  </ItemGroup>
    7373  <ItemGroup>
     74    <Compile Include="Implementations\PreprocessingChartContent.cs" />
    7475    <Compile Include="Implementations\PreprocessingData.cs" />
    7576    <Compile Include="Implementations\DataGridLogic.cs" />
     
    8384    <Compile Include="Implementations\FilterLogic.cs" />
    8485    <Compile Include="Implementations\HistogramContent.cs" />
    85     <Compile Include="Implementations\HistogramLogic.cs" />
    8686    <Compile Include="Implementations\LineChartContent.cs" />
    87     <Compile Include="Implementations\LineChartLogic.cs" />
     87    <Compile Include="Implementations\ChartLogic.cs" />
    8888    <Compile Include="Implementations\StatisticsContent.cs" />
    8989    <Compile Include="Implementations\TransformationContent.cs" />
    9090    <Compile Include="Implementations\TransformationLogic.cs" />
    9191    <Compile Include="Interfaces\IFilterLogic.cs" />
    92     <Compile Include="Interfaces\IHistogramLogic.cs" />
    93     <Compile Include="Interfaces\ILineChartLogic.cs" />
     92    <Compile Include="Interfaces\IChartLogic.cs" />
    9493    <Compile Include="Interfaces\IManipulationLogic.cs" />
    9594    <Compile Include="Interfaces\ITransformationLogic.cs" />
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs

    r10633 r10658  
    2727
    2828namespace HeuristicLab.DataPreprocessing {
    29   public class LineChartLogic : ILineChartLogic {
     29
     30  public class ChartLogic : IChartLogic {
    3031 
    3132    private ITransactionalPreprocessingData preprocessingData;
    3233
    33     public LineChartLogic(ITransactionalPreprocessingData preprocessingData) {
     34    public ChartLogic(ITransactionalPreprocessingData preprocessingData) {
    3435      this.preprocessingData = preprocessingData;
    3536    }
    3637
    37     public DataTable CreateDataTable(String title) {
     38    public DataTable CreateDataTable(String title, DataRowVisualProperties.DataRowChartType chartType) {
    3839      DataTable dataTable = new DataTable(title);
    3940      IEnumerable<string> variableNames = GetVariableNames();
    4041
    4142      foreach (string variableName in variableNames) {
    42         DataRow row = CreateDataRow(variableName);
     43        DataRow row = CreateDataRow(variableName,chartType);
    4344        dataTable.Rows.Add(row);
    4445      }
     
    4647    }
    4748
    48     public DataRow CreateDataRow(string variableName) {
     49    public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
    4950      IList<double> values = preprocessingData.GetValues<double>(variableName);
    5051      DataRow row = new DataRow(variableName, "", values);
     52      row.VisualProperties.ChartType = chartType;
    5153      return row;
    5254    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/HistogramContent.cs

    r10614 r10658  
    2626namespace HeuristicLab.DataPreprocessing {
    2727  [Item("Histogram", "Represents the histogram grid.")]
    28   public class HistogramContent : Item, IViewShortcut {
     28  public class HistogramContent : PreprocessingChartContent {
    2929
    30     private readonly IHistogramLogic histogramLogic;
    31     public HistogramContent(IHistogramLogic theHistogramLogic) {
    32       histogramLogic = theHistogramLogic;
     30    public HistogramContent(IChartLogic chartlogic) :base(chartlogic) {
    3331    }
    3432
     
    3634      : base(content, cloner) {
    3735
    38     }
    39 
    40     public IHistogramLogic HistogramLogic {
    41       get {
    42         return histogramLogic;
    43       }
    4436    }
    4537
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/LineChartContent.cs

    r10614 r10658  
    2626namespace HeuristicLab.DataPreprocessing {
    2727  [Item("LineChart", "Represents the line chart grid.")]
    28   public class LineChartContent : Item, IViewShortcut {
     28  public class LineChartContent : PreprocessingChartContent {
    2929
    30     private readonly ILineChartLogic lineChartLogic;
    31     public LineChartContent(ILineChartLogic theLineChartLogic) {
    32       lineChartLogic = theLineChartLogic;
     30    public LineChartContent(IChartLogic chartlogic) :base(chartlogic) {
    3331    }
    3432
     
    3634      : base(content, cloner) {
    3735
    38     }
    39 
    40     public ILineChartLogic LineChartLogic {
    41       get {
    42         return lineChartLogic;
    43       }
    4436    }
    4537
     
    5244    }
    5345
    54     public event DataPreprocessingChangedEventHandler Changed {
    55       add { lineChartLogic.Changed += value; }
    56       remove { lineChartLogic.Changed -= value; }
    57     }
    5846  }
    5947}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingChartContent.cs

    r10633 r10658  
    2525
    2626namespace HeuristicLab.DataPreprocessing {
    27   [Item("LineChart", "Represents the line chart grid.")]
    28   public class LineChartContent : Item, IViewShortcut {
     27  [Item("PreprocessingChart", "Represents a preprocessing chart.")]
     28  public class PreprocessingChartContent : Item, IViewShortcut {
    2929
    30     private readonly ILineChartLogic lineChartLogic;
    31     public LineChartContent(ILineChartLogic theLineChartLogic) {
    32       lineChartLogic = theLineChartLogic;
     30    private readonly IChartLogic chartLogic;
     31    public PreprocessingChartContent(IChartLogic chartLogic) {
     32      this.chartLogic = chartLogic;
    3333    }
    3434
    35     public LineChartContent(LineChartContent content, Cloner cloner)
     35    public PreprocessingChartContent(PreprocessingChartContent content, Cloner cloner)
    3636      : base(content, cloner) {
    37 
    3837    }
    3938
    40     public ILineChartLogic LineChartLogic {
     39    public IChartLogic ChartLogic {
    4140      get {
    42         return lineChartLogic;
     41        return chartLogic;
    4342      }
    4443    }
     
    4948
    5049    public override IDeepCloneable Clone(Cloner cloner) {
    51       return new LineChartContent(this, cloner);
     50      return new PreprocessingChartContent(this, cloner);
    5251    }
    5352
    5453    public event DataPreprocessingChangedEventHandler Changed {
    55       add { lineChartLogic.Changed += value; }
    56       remove { lineChartLogic.Changed -= value; }
     54      add { chartLogic.Changed += value; }
     55      remove { chartLogic.Changed -= value; }
    5756    }
    5857  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs

    r10628 r10658  
    2626
    2727namespace HeuristicLab.DataPreprocessing {
    28   public interface ILineChartLogic {
     28  public interface IChartLogic {
    2929
    30     DataTable CreateDataTable(string title);
     30    DataTable CreateDataTable(string title, DataRowVisualProperties.DataRowChartType chartType);
    3131
    3232    event DataPreprocessingChangedEventHandler Changed;
     
    3434    ICheckedItemList<StringValue> CreateVariableItemList();
    3535
    36     DataRow CreateDataRow(string variableName);
     36    DataRow CreateDataRow(string variableName,DataRowVisualProperties.DataRowChartType chartType);
    3737
    3838    string GetVariableNameByIndex(int index);
Note: See TracChangeset for help on using the changeset viewer.