[10914] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
| 3 | * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
| 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 | using System;
|
---|
[10736] | 22 | using System.Windows.Forms;
|
---|
[10658] | 23 | using HeuristicLab.Analysis;
|
---|
| 24 | using HeuristicLab.MainForm;
|
---|
| 25 |
|
---|
| 26 | namespace HeuristicLab.DataPreprocessing.Views {
|
---|
| 27 |
|
---|
| 28 | [View("Histogram View")]
|
---|
[10712] | 29 | [Content(typeof(HistogramContent), true)]
|
---|
[10658] | 30 | public partial class HistogramView : PreprocessingChartView {
|
---|
| 31 | private const string HISTOGRAM_CHART_TITLE = "Histogram";
|
---|
| 32 |
|
---|
| 33 | public HistogramView() {
|
---|
| 34 | InitializeComponent();
|
---|
| 35 | chartType = DataRowVisualProperties.DataRowChartType.Histogram;
|
---|
| 36 | chartTitle = HISTOGRAM_CHART_TITLE;
|
---|
| 37 | }
|
---|
| 38 |
|
---|
[10914] | 39 | protected override void OnContentChanged() {
|
---|
[10867] | 40 | base.OnContentChanged();
|
---|
[10914] | 41 | if (Content != null) {
|
---|
[10867] | 42 | logic = Content.ChartLogic;
|
---|
[10914] | 43 |
|
---|
[10867] | 44 | classifierComboBox.Items.Clear();
|
---|
| 45 | classifierComboBox.Items.Add("None");
|
---|
| 46 |
|
---|
[10914] | 47 | foreach (string var in logic.GetVariableNamesForHistogramClassification()) {
|
---|
[10867] | 48 | classifierComboBox.Items.Add(var);
|
---|
| 49 | }
|
---|
| 50 |
|
---|
[10914] | 51 |
|
---|
[10871] | 52 | if (classifierComboBox.SelectedItem == null) {
|
---|
| 53 | classifierComboBox.SelectedIndex = Content.ClassifierVariableIndex;
|
---|
[10867] | 54 | }
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
| 57 |
|
---|
[10658] | 58 | public new HistogramContent Content {
|
---|
| 59 | get { return (HistogramContent)base.Content; }
|
---|
| 60 | set { base.Content = value; }
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[10908] | 63 | private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
---|
[10867] | 64 | if (classifierComboBox.SelectedItem == null)
|
---|
| 65 | return;
|
---|
[10736] | 66 |
|
---|
[10908] | 67 | if (classifierComboBox.SelectedIndex != 0) {
|
---|
| 68 | Classification = logic.GetVariableValues(classifierComboBox.SelectedItem.ToString());
|
---|
| 69 | } else {
|
---|
| 70 | Classification = null;
|
---|
[10818] | 71 | }
|
---|
[10867] | 72 |
|
---|
[10871] | 73 | Content.ClassifierVariableIndex = classifierComboBox.SelectedIndex;
|
---|
| 74 |
|
---|
[10867] | 75 | GenerateChart();
|
---|
[10818] | 76 | }
|
---|
[10658] | 77 | }
|
---|
| 78 | }
|
---|