Changeset 168
- Timestamp:
- 04/23/08 00:35:19 (17 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs
r2 r168 33 33 set { 34 34 Item = value; 35 Item.Changed += new EventHandler(Item_Changed);35 Refresh(); 36 36 } 37 37 } 38 38 39 void Item_Changed(object sender, EventArgs e) { 40 Refresh(); 41 } 42 43 public DatasetView() : base() { 39 public DatasetView() 40 : base() { 44 41 InitializeComponent(); 45 42 openFileDialog = new OpenFileDialog(); 46 43 } 47 44 48 public DatasetView(Dataset dataset) :this() { 45 public DatasetView(Dataset dataset) 46 : this() { 49 47 this.Dataset = dataset; 50 48 } … … 52 50 protected override void UpdateControls() { 53 51 base.UpdateControls(); 54 if (Dataset != null) {52 if (Dataset != null) { 55 53 int rows = Dataset.Rows; 56 54 int columns = Dataset.Columns; 57 58 55 nameTextBox.Text = Dataset.Name; 59 56 rowsTextBox.Text = rows + ""; … … 61 58 dataGridView.ColumnCount = columns; 62 59 dataGridView.RowCount = rows; 63 for (int i = 0; i < rows; i++) {64 for (int j = 0; j < columns; j++) {60 for (int i = 0; i < rows; i++) { 61 for (int j = 0; j < columns; j++) { 65 62 dataGridView.Rows[i].Cells[j].Value = Dataset.GetValue(i, j); 66 63 } … … 85 82 86 83 private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { 87 if (ValidateData((string)e.FormattedValue)) {84 if (ValidateData((string)e.FormattedValue)) { 88 85 SetArrayElement(e.RowIndex, e.ColumnIndex, (string)e.FormattedValue); 89 86 e.Cancel = false; … … 97 94 double result; 98 95 double.TryParse(element, out result); 99 if (result != Dataset.GetValue(row, column)) {96 if (result != Dataset.GetValue(row, column)) { 100 97 Dataset.SetValue(row, column, result); 101 98 Dataset.FireChanged(); -
trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.Designer.cs
r154 r168 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.nameLabel = new System.Windows.Forms.Label();48 this.nameTextBox = new System.Windows.Forms.TextBox();49 47 this.importInstanceButton = new System.Windows.Forms.Button(); 50 48 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 51 49 this.tabControl = new System.Windows.Forms.TabControl(); 52 50 this.dataTabPage = new System.Windows.Forms.TabPage(); 53 this.variablesLabel = new System.Windows.Forms.Label();54 this.variablesTextBox = new System.Windows.Forms.TextBox();55 this.samplesLabel = new System.Windows.Forms.Label();56 this.samplesTextBox = new System.Windows.Forms.TextBox();57 51 this.variableInfosTabPage = new System.Windows.Forms.TabPage(); 58 52 this.operatorBaseVariableInfosView = new HeuristicLab.Core.OperatorBaseVariableInfosView(); 59 53 this.descriptionTabPage = new System.Windows.Forms.TabPage(); 60 54 this.operatorBaseDescriptionView = new HeuristicLab.Core.OperatorBaseDescriptionView(); 55 this.datasetView = new HeuristicLab.DataAnalysis.DatasetView(); 61 56 this.tabControl.SuspendLayout(); 62 57 this.dataTabPage.SuspendLayout(); … … 65 60 this.SuspendLayout(); 66 61 // 67 // nameLabel68 //69 this.nameLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;70 this.nameLabel.AutoSize = true;71 this.nameLabel.Location = new System.Drawing.Point(6, 9);72 this.nameLabel.Name = "nameLabel";73 this.nameLabel.Size = new System.Drawing.Size(38, 13);74 this.nameLabel.TabIndex = 0;75 this.nameLabel.Text = "Name:";76 //77 // nameTextBox78 //79 this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));80 this.nameTextBox.Location = new System.Drawing.Point(62, 6);81 this.nameTextBox.Name = "nameTextBox";82 this.nameTextBox.ReadOnly = true;83 this.nameTextBox.Size = new System.Drawing.Size(166, 20);84 this.nameTextBox.TabIndex = 1;85 //86 62 // importInstanceButton 87 63 // 88 this.importInstanceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); 89 this.importInstanceButton.Location = new System.Drawing.Point(6, 105); 64 this.importInstanceButton.Location = new System.Drawing.Point(6, 6); 90 65 this.importInstanceButton.Name = "importInstanceButton"; 91 this.importInstanceButton.Size = new System.Drawing.Size( 256, 21);66 this.importInstanceButton.Size = new System.Drawing.Size(129, 21); 92 67 this.importInstanceButton.TabIndex = 6; 93 68 this.importInstanceButton.Text = "&Import..."; … … 111 86 this.tabControl.Name = "tabControl"; 112 87 this.tabControl.SelectedIndex = 0; 113 this.tabControl.Size = new System.Drawing.Size( 276, 184);88 this.tabControl.Size = new System.Drawing.Size(507, 451); 114 89 this.tabControl.TabIndex = 0; 115 90 // 116 91 // dataTabPage 117 92 // 118 this.dataTabPage.Controls.Add(this.variablesLabel); 119 this.dataTabPage.Controls.Add(this.variablesTextBox); 120 this.dataTabPage.Controls.Add(this.samplesLabel); 121 this.dataTabPage.Controls.Add(this.samplesTextBox); 122 this.dataTabPage.Controls.Add(this.nameLabel); 93 this.dataTabPage.Controls.Add(this.datasetView); 123 94 this.dataTabPage.Controls.Add(this.importInstanceButton); 124 this.dataTabPage.Controls.Add(this.nameTextBox);125 95 this.dataTabPage.Location = new System.Drawing.Point(4, 22); 126 96 this.dataTabPage.Name = "dataTabPage"; 127 97 this.dataTabPage.Padding = new System.Windows.Forms.Padding(3); 128 this.dataTabPage.Size = new System.Drawing.Size( 268, 158);98 this.dataTabPage.Size = new System.Drawing.Size(499, 425); 129 99 this.dataTabPage.TabIndex = 0; 130 100 this.dataTabPage.Text = "Data"; 131 101 this.dataTabPage.UseVisualStyleBackColor = true; 132 //133 // variablesLabel134 //135 this.variablesLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;136 this.variablesLabel.AutoSize = true;137 this.variablesLabel.Location = new System.Drawing.Point(6, 61);138 this.variablesLabel.Name = "variablesLabel";139 this.variablesLabel.Size = new System.Drawing.Size(53, 13);140 this.variablesLabel.TabIndex = 9;141 this.variablesLabel.Text = "Variables:";142 //143 // variablesTextBox144 //145 this.variablesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));146 this.variablesTextBox.Location = new System.Drawing.Point(62, 58);147 this.variablesTextBox.Name = "variablesTextBox";148 this.variablesTextBox.ReadOnly = true;149 this.variablesTextBox.Size = new System.Drawing.Size(81, 20);150 this.variablesTextBox.TabIndex = 10;151 //152 // samplesLabel153 //154 this.samplesLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;155 this.samplesLabel.AutoSize = true;156 this.samplesLabel.Location = new System.Drawing.Point(6, 35);157 this.samplesLabel.Name = "samplesLabel";158 this.samplesLabel.Size = new System.Drawing.Size(50, 13);159 this.samplesLabel.TabIndex = 7;160 this.samplesLabel.Text = "Samples:";161 //162 // samplesTextBox163 //164 this.samplesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));165 this.samplesTextBox.Location = new System.Drawing.Point(62, 32);166 this.samplesTextBox.Name = "samplesTextBox";167 this.samplesTextBox.ReadOnly = true;168 this.samplesTextBox.Size = new System.Drawing.Size(81, 20);169 this.samplesTextBox.TabIndex = 8;170 102 // 171 103 // variableInfosTabPage … … 175 107 this.variableInfosTabPage.Name = "variableInfosTabPage"; 176 108 this.variableInfosTabPage.Padding = new System.Windows.Forms.Padding(3); 177 this.variableInfosTabPage.Size = new System.Drawing.Size( 268, 158);109 this.variableInfosTabPage.Size = new System.Drawing.Size(499, 425); 178 110 this.variableInfosTabPage.TabIndex = 1; 179 111 this.variableInfosTabPage.Text = "Variable Infos"; … … 187 119 this.operatorBaseVariableInfosView.Name = "operatorBaseVariableInfosView"; 188 120 this.operatorBaseVariableInfosView.Operator = null; 189 this.operatorBaseVariableInfosView.Size = new System.Drawing.Size( 262, 152);121 this.operatorBaseVariableInfosView.Size = new System.Drawing.Size(493, 419); 190 122 this.operatorBaseVariableInfosView.TabIndex = 0; 191 123 // … … 196 128 this.descriptionTabPage.Name = "descriptionTabPage"; 197 129 this.descriptionTabPage.Padding = new System.Windows.Forms.Padding(3); 198 this.descriptionTabPage.Size = new System.Drawing.Size( 268, 158);130 this.descriptionTabPage.Size = new System.Drawing.Size(499, 425); 199 131 this.descriptionTabPage.TabIndex = 2; 200 132 this.descriptionTabPage.Text = "Description"; … … 208 140 this.operatorBaseDescriptionView.Name = "operatorBaseDescriptionView"; 209 141 this.operatorBaseDescriptionView.Operator = null; 210 this.operatorBaseDescriptionView.Size = new System.Drawing.Size( 262, 152);142 this.operatorBaseDescriptionView.Size = new System.Drawing.Size(493, 419); 211 143 this.operatorBaseDescriptionView.TabIndex = 0; 144 // 145 // datasetView 146 // 147 this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 148 | System.Windows.Forms.AnchorStyles.Left) 149 | System.Windows.Forms.AnchorStyles.Right))); 150 this.datasetView.Caption = "View"; 151 this.datasetView.Location = new System.Drawing.Point(6, 33); 152 this.datasetView.Name = "datasetView"; 153 this.datasetView.Size = new System.Drawing.Size(487, 386); 154 this.datasetView.TabIndex = 7; 212 155 // 213 156 // StructIdProblemInjectorView … … 217 160 this.Controls.Add(this.tabControl); 218 161 this.Name = "StructIdProblemInjectorView"; 219 this.Size = new System.Drawing.Size( 276, 184);162 this.Size = new System.Drawing.Size(507, 451); 220 163 this.tabControl.ResumeLayout(false); 221 164 this.dataTabPage.ResumeLayout(false); 222 this.dataTabPage.PerformLayout();223 165 this.variableInfosTabPage.ResumeLayout(false); 224 166 this.descriptionTabPage.ResumeLayout(false); … … 229 171 #endregion 230 172 231 private System.Windows.Forms.Label nameLabel;232 private System.Windows.Forms.TextBox nameTextBox;233 173 private System.Windows.Forms.Button importInstanceButton; 234 174 private System.Windows.Forms.OpenFileDialog openFileDialog; … … 239 179 private System.Windows.Forms.TabPage descriptionTabPage; 240 180 private HeuristicLab.Core.OperatorBaseDescriptionView operatorBaseDescriptionView; 241 private System.Windows.Forms.Label variablesLabel; 242 private System.Windows.Forms.TextBox variablesTextBox; 243 private System.Windows.Forms.Label samplesLabel; 244 private System.Windows.Forms.TextBox samplesTextBox; 181 private HeuristicLab.DataAnalysis.DatasetView datasetView; 245 182 } 246 183 } -
trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.cs
r131 r168 61 61 base.UpdateControls(); 62 62 if (StructIdProblemInjector == null) { 63 nameTextBox.Text = "-";64 variablesTextBox.Text = "-";65 samplesTextBox.Text = "-";66 63 importInstanceButton.Enabled = false; 67 64 } else { 68 65 Dataset dataset = (Dataset)StructIdProblemInjector.GetVariable("Dataset").Value; 69 nameTextBox.Text = dataset.Name; 70 samplesTextBox.Text = dataset.Rows+""; 71 variablesTextBox.Text = dataset.Columns+""; 66 datasetView.Dataset = dataset; 72 67 importInstanceButton.Enabled = true; 73 68 }
Note: See TracChangeset
for help on using the changeset viewer.