- Timestamp:
- 08/26/09 11:35:26 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.DataAnalysis/3.2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAnalysis/3.2/Dataset.cs
r2310 r2311 147 147 } 148 148 throw new ArgumentException("The variable name " + variableName + " was not found."); 149 } 150 151 public double[] GetVariableValues(int variableIndex, int start, int end) { 152 if (start < 0 || !(start <= end)) 153 throw new ArgumentException("Start must be between 0 and end (" + end + ")."); 154 if (end > rows || end < start) 155 throw new ArgumentException("End must be between start (" + start + ") and dataset rows (" + rows + ")."); 156 157 double[] values = new double[end - start]; 158 for (int i = 0; i < end - start; i++) 159 values[i] = GetValue(i + start, variableIndex); 160 return values; 161 } 162 163 public double[] GetVariableValues(int variableIndex) { 164 return GetVariableValues(variableIndex, 0, this.rows); 165 } 166 167 public double[] GetVariableValues(string variableName, int start, int end) { 168 return GetVariableValues(GetVariableIndex(variableName), start, end); 169 } 170 171 public double[] GetVariableValues(string variableName) { 172 return GetVariableValues(variableName, 0, this.rows); 149 173 } 150 174 -
trunk/sources/HeuristicLab.DataAnalysis/3.2/DatasetView.cs
r2223 r2311 69 69 // have been updated (and their SortMode set to 'NotSortable') we switch back to SelectionMode=ColumnHeaderSelect. 70 70 dataGridView.SelectionMode = DataGridViewSelectionMode.CellSelect; 71 dataGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;71 //dataGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing; 72 72 int rows = Dataset.Rows; 73 73 int columns = Dataset.Columns; … … 90 90 } 91 91 dataGridView.SelectionMode = DataGridViewSelectionMode.ColumnHeaderSelect; // switch back to column selection 92 dataGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;92 //dataGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; 93 93 } else { 94 94 rowsTextBox.Text = "1"; … … 97 97 dataGridView.RowCount = 1; 98 98 } 99 UpdateRowHeaders(); 100 this.dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells); 101 } 102 103 private void UpdateRowHeaders() { 104 for (int i = dataGridView.FirstDisplayedScrollingRowIndex; i < dataGridView.FirstDisplayedScrollingRowIndex + dataGridView.DisplayedRowCount(true); i++) 105 dataGridView.Rows[i].HeaderCell.Value = i.ToString(); 106 this.dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders); 107 dataGridView.Invalidate(); 108 } 109 110 private void dataGridView_Scroll(object sender, ScrollEventArgs e) { 111 UpdateRowHeaders(); 112 } 113 114 private void dataGridView_Resize(object sender, EventArgs e) { 115 UpdateRowHeaders(); 99 116 } 100 117 … … 175 192 Refresh(); 176 193 } 194 195 177 196 } 178 197 } -
trunk/sources/HeuristicLab.DataAnalysis/3.2/DatasetView.designer.cs
r1529 r2311 100 100 this.dataGridView.Size = new System.Drawing.Size(554, 485); 101 101 this.dataGridView.TabIndex = 3; 102 this.dataGridView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dataGridView_Scroll); 102 103 this.dataGridView.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView_CellValidating); 104 this.dataGridView.Resize += new System.EventHandler(this.dataGridView_Resize); 103 105 // 104 106 // contextMenuStrip … … 110 112 this.originalValuesToolStripMenuItem}); 111 113 this.contextMenuStrip.Name = "contextMenuStrip"; 112 this.contextMenuStrip.Size = new System.Drawing.Size(1 87, 92);114 this.contextMenuStrip.Size = new System.Drawing.Size(198, 92); 113 115 // 114 116 // scaleValuesToolStripMenuItem 115 117 // 116 118 this.scaleValuesToolStripMenuItem.Name = "scaleValuesToolStripMenuItem"; 117 this.scaleValuesToolStripMenuItem.Size = new System.Drawing.Size(1 86, 22);119 this.scaleValuesToolStripMenuItem.Size = new System.Drawing.Size(197, 22); 118 120 this.scaleValuesToolStripMenuItem.Text = "Scale values [0..1]"; 119 121 this.scaleValuesToolStripMenuItem.Click += new System.EventHandler(this.scaleValuesToolStripMenuItem_Click); … … 122 124 // 123 125 this.scaleValuesmanuallyToolStripMenuItem.Name = "scaleValuesmanuallyToolStripMenuItem"; 124 this.scaleValuesmanuallyToolStripMenuItem.Size = new System.Drawing.Size(1 86, 22);126 this.scaleValuesmanuallyToolStripMenuItem.Size = new System.Drawing.Size(197, 22); 125 127 this.scaleValuesmanuallyToolStripMenuItem.Text = "Scale values (manually)"; 126 128 this.scaleValuesmanuallyToolStripMenuItem.Click += new System.EventHandler(this.scaleValuesmanuallyToolStripMenuItem_Click); … … 129 131 // 130 132 this.showScalingToolStripMenuItem.Name = "showScalingToolStripMenuItem"; 131 this.showScalingToolStripMenuItem.Size = new System.Drawing.Size(1 86, 22);133 this.showScalingToolStripMenuItem.Size = new System.Drawing.Size(197, 22); 132 134 this.showScalingToolStripMenuItem.Text = "Show scaling..."; 133 135 this.showScalingToolStripMenuItem.Click += new System.EventHandler(this.showScalingToolStripMenuItem_Click); … … 136 138 // 137 139 this.originalValuesToolStripMenuItem.Name = "originalValuesToolStripMenuItem"; 138 this.originalValuesToolStripMenuItem.Size = new System.Drawing.Size(1 86, 22);140 this.originalValuesToolStripMenuItem.Size = new System.Drawing.Size(197, 22); 139 141 this.originalValuesToolStripMenuItem.Text = "Unscale values"; 140 142 this.originalValuesToolStripMenuItem.Click += new System.EventHandler(this.originalValuesToolStripMenuItem_Click);
Note: See TracChangeset
for help on using the changeset viewer.