Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/29/11 11:23:06 (13 years ago)
Author:
abeham
Message:

#1603

  • Added a DisplayName property to the DataRowVisualProperties
  • Changed the QualityDistributionAnalyzer to change the display name instead of the row name
  • Adapted the view to configure the chart and series properties
Location:
branches/QAPAlgorithms/HeuristicLab.Analysis.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/QAPAlgorithms/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.Designer.cs

    r6342 r6610  
    7373      this.lineStyleComboBox = new System.Windows.Forms.ComboBox();
    7474      this.label8 = new System.Windows.Forms.Label();
     75      this.label9 = new System.Windows.Forms.Label();
     76      this.displayNameTextBox = new System.Windows.Forms.TextBox();
    7577      ((System.ComponentModel.ISupportInitialize)(this.binsNumericUpDown)).BeginInit();
    7678      this.commonGroupBox.SuspendLayout();
     
    8890      this.chartTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    8991      this.chartTypeComboBox.FormattingEnabled = true;
    90       this.chartTypeComboBox.Location = new System.Drawing.Point(76, 19);
     92      this.chartTypeComboBox.Location = new System.Drawing.Point(89, 45);
    9193      this.chartTypeComboBox.Name = "chartTypeComboBox";
    92       this.chartTypeComboBox.Size = new System.Drawing.Size(224, 21);
     94      this.chartTypeComboBox.Size = new System.Drawing.Size(211, 21);
    9395      this.chartTypeComboBox.TabIndex = 1;
    9496      this.chartTypeComboBox.SelectedValueChanged += new System.EventHandler(this.chartTypeComboBox_SelectedValueChanged);
     
    101103      //
    102104      this.colorButton.BackColor = System.Drawing.SystemColors.Control;
    103       this.colorButton.Location = new System.Drawing.Point(76, 46);
     105      this.colorButton.Location = new System.Drawing.Point(89, 72);
    104106      this.colorButton.Name = "colorButton";
    105107      this.colorButton.Size = new System.Drawing.Size(23, 23);
     
    140142      //
    141143      this.label1.AutoSize = true;
    142       this.label1.Location = new System.Drawing.Point(8, 22);
     144      this.label1.Location = new System.Drawing.Point(8, 48);
    143145      this.label1.Name = "label1";
    144       this.label1.Size = new System.Drawing.Size(62, 13);
     146      this.label1.Size = new System.Drawing.Size(58, 13);
    145147      this.label1.TabIndex = 0;
    146       this.label1.Text = "Chart Type:";
     148      this.label1.Text = "Chart type:";
    147149      //
    148150      // label2
    149151      //
    150152      this.label2.AutoSize = true;
    151       this.label2.Location = new System.Drawing.Point(8, 51);
     153      this.label2.Location = new System.Drawing.Point(8, 77);
    152154      this.label2.Name = "label2";
    153155      this.label2.Size = new System.Drawing.Size(34, 13);
     
    168170      this.commonGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    169171                  | System.Windows.Forms.AnchorStyles.Right)));
     172      this.commonGroupBox.Controls.Add(this.displayNameTextBox);
    170173      this.commonGroupBox.Controls.Add(this.axisGroupBox);
    171174      this.commonGroupBox.Controls.Add(this.colorButton);
     175      this.commonGroupBox.Controls.Add(this.label9);
    172176      this.commonGroupBox.Controls.Add(this.label1);
    173177      this.commonGroupBox.Controls.Add(this.label2);
     
    175179      this.commonGroupBox.Location = new System.Drawing.Point(3, 3);
    176180      this.commonGroupBox.Name = "commonGroupBox";
    177       this.commonGroupBox.Size = new System.Drawing.Size(313, 158);
     181      this.commonGroupBox.Size = new System.Drawing.Size(313, 181);
    178182      this.commonGroupBox.TabIndex = 0;
    179183      this.commonGroupBox.TabStop = false;
     
    186190      this.axisGroupBox.Controls.Add(this.panel1);
    187191      this.axisGroupBox.Controls.Add(this.panel2);
    188       this.axisGroupBox.Location = new System.Drawing.Point(6, 75);
     192      this.axisGroupBox.Location = new System.Drawing.Point(6, 101);
    189193      this.axisGroupBox.Name = "axisGroupBox";
    190194      this.axisGroupBox.Size = new System.Drawing.Size(299, 75);
    191195      this.axisGroupBox.TabIndex = 9;
    192196      this.axisGroupBox.TabStop = false;
    193       this.axisGroupBox.Text = "Display Data on";
     197      this.axisGroupBox.Text = "Display data on";
    194198      //
    195199      // label5
     
    200204      this.label5.Size = new System.Drawing.Size(39, 13);
    201205      this.label5.TabIndex = 6;
    202       this.label5.Text = "Y Axis:";
     206      this.label5.Text = "Y-Axis:";
    203207      //
    204208      // label6
     
    209213      this.label6.Size = new System.Drawing.Size(39, 13);
    210214      this.label6.TabIndex = 6;
    211       this.label6.Text = "X Axis:";
     215      this.label6.Text = "X-Axis:";
    212216      //
    213217      // panel1
     
    284288      this.histoGramGroupBox.Controls.Add(this.binsNumericUpDown);
    285289      this.histoGramGroupBox.Controls.Add(this.label3);
    286       this.histoGramGroupBox.Location = new System.Drawing.Point(3, 269);
     290      this.histoGramGroupBox.Location = new System.Drawing.Point(3, 292);
    287291      this.histoGramGroupBox.Name = "histoGramGroupBox";
    288292      this.histoGramGroupBox.Size = new System.Drawing.Size(313, 49);
     
    334338      this.lineChartGroupBox.Controls.Add(this.lineStyleComboBox);
    335339      this.lineChartGroupBox.Controls.Add(this.label8);
    336       this.lineChartGroupBox.Location = new System.Drawing.Point(3, 167);
     340      this.lineChartGroupBox.Location = new System.Drawing.Point(3, 190);
    337341      this.lineChartGroupBox.Name = "lineChartGroupBox";
    338342      this.lineChartGroupBox.Size = new System.Drawing.Size(313, 96);
    339343      this.lineChartGroupBox.TabIndex = 1;
    340344      this.lineChartGroupBox.TabStop = false;
    341       this.lineChartGroupBox.Text = "Line Chart";
     345      this.lineChartGroupBox.Text = "Line chart";
    342346      //
    343347      // lineWidthNumericUpDown
     
    364368      this.label4.Location = new System.Drawing.Point(8, 68);
    365369      this.label4.Name = "label4";
    366       this.label4.Size = new System.Drawing.Size(61, 13);
     370      this.label4.Size = new System.Drawing.Size(58, 13);
    367371      this.label4.TabIndex = 4;
    368       this.label4.Text = "Line Width:";
     372      this.label4.Text = "Line width:";
    369373      //
    370374      // label7
     
    373377      this.label7.Location = new System.Drawing.Point(8, 46);
    374378      this.label7.Name = "label7";
    375       this.label7.Size = new System.Drawing.Size(82, 13);
     379      this.label7.Size = new System.Drawing.Size(81, 13);
    376380      this.label7.TabIndex = 2;
    377       this.label7.Text = "Start Index at 0:";
     381      this.label7.Text = "Start index at 0:";
    378382      //
    379383      // lineStyleComboBox
     
    392396      this.label8.Location = new System.Drawing.Point(8, 22);
    393397      this.label8.Name = "label8";
    394       this.label8.Size = new System.Drawing.Size(56, 13);
     398      this.label8.Size = new System.Drawing.Size(54, 13);
    395399      this.label8.TabIndex = 0;
    396       this.label8.Text = "Line Style:";
     400      this.label8.Text = "Line style:";
     401      //
     402      // label9
     403      //
     404      this.label9.AutoSize = true;
     405      this.label9.Location = new System.Drawing.Point(8, 22);
     406      this.label9.Name = "label9";
     407      this.label9.Size = new System.Drawing.Size(75, 13);
     408      this.label9.TabIndex = 0;
     409      this.label9.Text = "Display Name:";
     410      //
     411      // displayNameTextBox
     412      //
     413      this.displayNameTextBox.Location = new System.Drawing.Point(89, 19);
     414      this.displayNameTextBox.Name = "displayNameTextBox";
     415      this.displayNameTextBox.Size = new System.Drawing.Size(211, 20);
     416      this.displayNameTextBox.TabIndex = 10;
     417      this.displayNameTextBox.Validated += new System.EventHandler(this.displayNameTextBox_Validated);
    397418      //
    398419      // DataRowVisualPropertiesControl
     
    404425      this.Controls.Add(this.commonGroupBox);
    405426      this.Name = "DataRowVisualPropertiesControl";
    406       this.Size = new System.Drawing.Size(319, 323);
     427      this.Size = new System.Drawing.Size(319, 347);
    407428      ((System.ComponentModel.ISupportInitialize)(this.binsNumericUpDown)).EndInit();
    408429      this.commonGroupBox.ResumeLayout(false);
     
    455476    private System.Windows.Forms.Label label5;
    456477    private System.Windows.Forms.GroupBox axisGroupBox;
     478    private System.Windows.Forms.TextBox displayNameTextBox;
     479    private System.Windows.Forms.Label label9;
    457480  }
    458481}
  • branches/QAPAlgorithms/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.cs

    r6342 r6610  
    6464          binsApproximatelyRadioButton.Checked = false;
    6565          binsExactRadioButton.Checked = false;
     66          displayNameTextBox.Text = String.Empty;
    6667        } else {
    6768          chartTypeComboBox.SelectedItem = Content.ChartType;
     
    8384          binsApproximatelyRadioButton.Checked = !Content.ExactBins;
    8485          binsExactRadioButton.Checked = Content.ExactBins;
     86          displayNameTextBox.Text = Content.DisplayName;
    8587        }
    8688      } finally { SuppressEvents = false; }
     
    168170      }
    169171    }
     172
     173    private void displayNameTextBox_Validated(object sender, EventArgs e) {
     174      if (!SuppressEvents && Content != null) {
     175        SuppressEvents = true;
     176        try {
     177          Content.DisplayName = displayNameTextBox.Text;
     178        } finally { SuppressEvents = false; }
     179      }
     180    }
    170181    #endregion
    171182  }
  • branches/QAPAlgorithms/HeuristicLab.Analysis.Views/3.3/DataTableHistoryView.cs

    r6342 r6610  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Core.Views;
     
    3839      using (DataTableVisualPropertiesDialog dialog = new DataTableVisualPropertiesDialog(current)) {
    3940        if (dialog.ShowDialog() != DialogResult.OK) return;
     41        Dictionary<string, bool> changeDisplayName = new Dictionary<string, bool>();
     42        foreach (DataRow row in current.Rows) {
     43          var answer = MessageBox.Show("Change display name for series " + row.Name + " to " + row.VisualProperties.DisplayName + " for all frames?", "Confirm change", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
     44          if (answer == DialogResult.Cancel) return;
     45          changeDisplayName[row.Name] = (answer == DialogResult.Yes);
     46        }
    4047        foreach (DataTable dt in Content) {
    41           if (current != dt) {
    42             dt.VisualProperties = (DataTableVisualProperties)current.VisualProperties.Clone();
    43             foreach (DataRow row in current.Rows)
    44               dt.Rows[row.Name].VisualProperties = (DataRowVisualProperties)row.VisualProperties.Clone();
     48          if (current == dt) continue;
     49          dt.VisualProperties = (DataTableVisualProperties)current.VisualProperties.Clone();
     50          foreach (DataRow row in current.Rows) {
     51            if (!dt.Rows.ContainsKey(row.Name)) continue;
     52            string oldDisplayName = dt.Rows[row.Name].VisualProperties.DisplayName;
     53            var props = (DataRowVisualProperties)row.VisualProperties.Clone();
     54            if (!changeDisplayName[row.Name]) props.DisplayName = oldDisplayName;
     55            dt.Rows[row.Name].VisualProperties = props;
    4556          }
    4657        }
  • branches/QAPAlgorithms/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r6342 r6610  
    159159    protected virtual void AddDataRow(DataRow row) {
    160160      Series series = new Series(row.Name);
     161      if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName;
     162      else series.LegendText = row.Name;
    161163      ConfigureSeries(series, row);
    162164      FillSeriesWithRowValues(series, row);
     
    212214      series.YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary;
    213215      series.XAxisType = row.VisualProperties.SecondXAxis ? AxisType.Secondary : AxisType.Primary;
    214       series.ToolTip = row.Name + " X = #INDEX, Y = #VAL";
     216      if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName;
     217      else series.LegendText = row.Name;
     218      series.ToolTip = series.LegendText + " X = #INDEX, Y = #VAL";
    215219    }
    216220
  • branches/QAPAlgorithms/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs

    r6342 r6610  
    6969      this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    7070      this.okButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    71       this.okButton.Location = new System.Drawing.Point(307, 357);
     71      this.okButton.Location = new System.Drawing.Point(307, 381);
    7272      this.okButton.Name = "okButton";
    7373      this.okButton.Size = new System.Drawing.Size(75, 23);
     
    8181      this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    8282      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    83       this.cancelButton.Location = new System.Drawing.Point(388, 357);
     83      this.cancelButton.Location = new System.Drawing.Point(388, 381);
    8484      this.cancelButton.Name = "cancelButton";
    8585      this.cancelButton.Size = new System.Drawing.Size(75, 23);
     
    9999      this.tabControl.Name = "tabControl";
    100100      this.tabControl.SelectedIndex = 0;
    101       this.tabControl.Size = new System.Drawing.Size(474, 350);
     101      this.tabControl.Size = new System.Drawing.Size(474, 374);
    102102      this.tabControl.TabIndex = 2;
    103103      //
     
    108108      this.seriesTabPage.Name = "seriesTabPage";
    109109      this.seriesTabPage.Padding = new System.Windows.Forms.Padding(3);
    110       this.seriesTabPage.Size = new System.Drawing.Size(466, 324);
     110      this.seriesTabPage.Size = new System.Drawing.Size(466, 348);
    111111      this.seriesTabPage.TabIndex = 0;
    112112      this.seriesTabPage.Text = "Series";
     
    131131      this.splitContainer.Panel2.Controls.Add(this.dataRowVisualPropertiesControl);
    132132      this.splitContainer.Panel2MinSize = 50;
    133       this.splitContainer.Size = new System.Drawing.Size(460, 318);
     133      this.splitContainer.Size = new System.Drawing.Size(460, 342);
    134134      this.splitContainer.SplitterDistance = 125;
    135135      this.splitContainer.TabIndex = 0;
     
    165165      this.seriesListView.Name = "seriesListView";
    166166      this.seriesListView.ShowGroups = false;
    167       this.seriesListView.Size = new System.Drawing.Size(125, 289);
     167      this.seriesListView.Size = new System.Drawing.Size(125, 313);
    168168      this.seriesListView.TabIndex = 0;
    169169      this.seriesListView.UseCompatibleStateImageBehavior = false;
     
    177177      this.dataRowVisualPropertiesControl.Location = new System.Drawing.Point(0, 0);
    178178      this.dataRowVisualPropertiesControl.Name = "dataRowVisualPropertiesControl";
    179       this.dataRowVisualPropertiesControl.Size = new System.Drawing.Size(331, 318);
     179      this.dataRowVisualPropertiesControl.Size = new System.Drawing.Size(331, 342);
    180180      this.dataRowVisualPropertiesControl.TabIndex = 0;
    181181      //
     
    206206      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    207207      this.CancelButton = this.cancelButton;
    208       this.ClientSize = new System.Drawing.Size(475, 392);
     208      this.ClientSize = new System.Drawing.Size(475, 416);
    209209      this.Controls.Add(this.tabControl);
    210210      this.Controls.Add(this.cancelButton);
Note: See TracChangeset for help on using the changeset viewer.