- Timestamp:
- 03/08/12 20:44:53 (13 years ago)
- Location:
- branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.Designer.cs
r7331 r7589 50 50 this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView(); 51 51 this.splitContainer = new System.Windows.Forms.SplitContainer(); 52 this.filterTabControl = new System.Windows.Forms.TabControl(); 53 this.filterTabPage = new System.Windows.Forms.TabPage(); 52 54 this.filtersGroupBox = new System.Windows.Forms.GroupBox(); 53 55 this.filterPanel = new System.Windows.Forms.Panel(); 54 56 this.refreshFiltersButton = new System.Windows.Forms.Button(); 57 this.constraintsTabPage = new System.Windows.Forms.TabPage(); 55 58 this.resultsGroupBox = new System.Windows.Forms.GroupBox(); 56 59 this.includeBinaryValuesCheckBox = new System.Windows.Forms.CheckBox(); … … 61 64 this.filtersInfoPanel = new System.Windows.Forms.Panel(); 62 65 this.filtersInfoLabel = new System.Windows.Forms.Label(); 66 this.constraintsCheckedListBox = new System.Windows.Forms.CheckedListBox(); 67 this.selectAllButton = new System.Windows.Forms.Button(); 68 this.deselectAllButton = new System.Windows.Forms.Button(); 63 69 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 64 70 this.splitContainer.Panel1.SuspendLayout(); 65 71 this.splitContainer.Panel2.SuspendLayout(); 66 72 this.splitContainer.SuspendLayout(); 73 this.filterTabControl.SuspendLayout(); 74 this.filterTabPage.SuspendLayout(); 67 75 this.filtersGroupBox.SuspendLayout(); 76 this.constraintsTabPage.SuspendLayout(); 68 77 this.resultsGroupBox.SuspendLayout(); 69 78 this.resultsInfoPanel.SuspendLayout(); … … 106 115 // splitContainer.Panel1 107 116 // 108 this.splitContainer.Panel1.Controls.Add(this.filter sGroupBox);117 this.splitContainer.Panel1.Controls.Add(this.filterTabControl); 109 118 // 110 119 // splitContainer.Panel2 … … 115 124 this.splitContainer.TabIndex = 0; 116 125 // 126 // filterTabControl 127 // 128 this.filterTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 129 | System.Windows.Forms.AnchorStyles.Left) 130 | System.Windows.Forms.AnchorStyles.Right))); 131 this.filterTabControl.Controls.Add(this.filterTabPage); 132 this.filterTabControl.Controls.Add(this.constraintsTabPage); 133 this.filterTabControl.Location = new System.Drawing.Point(3, 3); 134 this.filterTabControl.Name = "filterTabControl"; 135 this.filterTabControl.SelectedIndex = 0; 136 this.filterTabControl.Size = new System.Drawing.Size(832, 276); 137 this.filterTabControl.TabIndex = 1; 138 // 139 // filterTabPage 140 // 141 this.filterTabPage.Controls.Add(this.filtersGroupBox); 142 this.filterTabPage.Location = new System.Drawing.Point(4, 22); 143 this.filterTabPage.Name = "filterTabPage"; 144 this.filterTabPage.Padding = new System.Windows.Forms.Padding(3); 145 this.filterTabPage.Size = new System.Drawing.Size(824, 250); 146 this.filterTabPage.TabIndex = 0; 147 this.filterTabPage.Text = "Filter"; 148 this.filterTabPage.UseVisualStyleBackColor = true; 149 // 117 150 // filtersGroupBox 118 151 // … … 122 155 this.filtersGroupBox.Controls.Add(this.filterPanel); 123 156 this.filtersGroupBox.Controls.Add(this.refreshFiltersButton); 124 this.filtersGroupBox.Location = new System.Drawing.Point( 0, 0);157 this.filtersGroupBox.Location = new System.Drawing.Point(6, 6); 125 158 this.filtersGroupBox.Name = "filtersGroupBox"; 126 this.filtersGroupBox.Size = new System.Drawing.Size(8 38, 279);159 this.filtersGroupBox.Size = new System.Drawing.Size(812, 238); 127 160 this.filtersGroupBox.TabIndex = 0; 128 161 this.filtersGroupBox.TabStop = false; … … 136 169 this.filterPanel.Location = new System.Drawing.Point(6, 19); 137 170 this.filterPanel.Name = "filterPanel"; 138 this.filterPanel.Size = new System.Drawing.Size(7 96, 254);171 this.filterPanel.Size = new System.Drawing.Size(770, 213); 139 172 this.filterPanel.TabIndex = 1; 140 173 // … … 143 176 this.refreshFiltersButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 144 177 this.refreshFiltersButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh; 145 this.refreshFiltersButton.Location = new System.Drawing.Point( 808, 21);178 this.refreshFiltersButton.Location = new System.Drawing.Point(782, 21); 146 179 this.refreshFiltersButton.Name = "refreshFiltersButton"; 147 180 this.refreshFiltersButton.Size = new System.Drawing.Size(24, 24); … … 149 182 this.refreshFiltersButton.UseVisualStyleBackColor = true; 150 183 this.refreshFiltersButton.Click += new System.EventHandler(this.refreshFiltersButton_Click); 184 // 185 // constraintsTabPage 186 // 187 this.constraintsTabPage.Controls.Add(this.deselectAllButton); 188 this.constraintsTabPage.Controls.Add(this.selectAllButton); 189 this.constraintsTabPage.Controls.Add(this.constraintsCheckedListBox); 190 this.constraintsTabPage.Location = new System.Drawing.Point(4, 22); 191 this.constraintsTabPage.Name = "constraintsTabPage"; 192 this.constraintsTabPage.Padding = new System.Windows.Forms.Padding(3); 193 this.constraintsTabPage.Size = new System.Drawing.Size(824, 250); 194 this.constraintsTabPage.TabIndex = 1; 195 this.constraintsTabPage.Text = "Downloaded Values"; 196 this.constraintsTabPage.UseVisualStyleBackColor = true; 151 197 // 152 198 // resultsGroupBox … … 245 291 this.filtersInfoLabel.Text = "Loading Filters ..."; 246 292 this.filtersInfoLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 293 // 294 // constraintsCheckedListBox 295 // 296 this.constraintsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 297 | System.Windows.Forms.AnchorStyles.Left) 298 | System.Windows.Forms.AnchorStyles.Right))); 299 this.constraintsCheckedListBox.CheckOnClick = true; 300 this.constraintsCheckedListBox.FormattingEnabled = true; 301 this.constraintsCheckedListBox.Location = new System.Drawing.Point(6, 6); 302 this.constraintsCheckedListBox.Name = "constraintsCheckedListBox"; 303 this.constraintsCheckedListBox.Size = new System.Drawing.Size(812, 214); 304 this.constraintsCheckedListBox.Sorted = true; 305 this.constraintsCheckedListBox.TabIndex = 0; 306 // 307 // selectAllButton 308 // 309 this.selectAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 310 this.selectAllButton.Location = new System.Drawing.Point(6, 221); 311 this.selectAllButton.Name = "selectAllButton"; 312 this.selectAllButton.Size = new System.Drawing.Size(75, 23); 313 this.selectAllButton.TabIndex = 1; 314 this.selectAllButton.Text = "Select all"; 315 this.selectAllButton.UseVisualStyleBackColor = true; 316 this.selectAllButton.Click += new System.EventHandler(this.selectAllButton_Click); 317 // 318 // deselectAllButton 319 // 320 this.deselectAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 321 this.deselectAllButton.Location = new System.Drawing.Point(88, 221); 322 this.deselectAllButton.Name = "deselectAllButton"; 323 this.deselectAllButton.Size = new System.Drawing.Size(75, 23); 324 this.deselectAllButton.TabIndex = 2; 325 this.deselectAllButton.Text = "Deselect all"; 326 this.deselectAllButton.UseVisualStyleBackColor = true; 327 this.deselectAllButton.Click += new System.EventHandler(this.deselectAllButton_Click); 247 328 // 248 329 // QueryView … … 259 340 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 260 341 this.splitContainer.ResumeLayout(false); 342 this.filterTabControl.ResumeLayout(false); 343 this.filterTabPage.ResumeLayout(false); 261 344 this.filtersGroupBox.ResumeLayout(false); 345 this.constraintsTabPage.ResumeLayout(false); 262 346 this.resultsGroupBox.ResumeLayout(false); 263 347 this.resultsGroupBox.PerformLayout(); … … 285 369 private System.Windows.Forms.Button refreshFiltersButton; 286 370 private System.Windows.Forms.CheckBox includeBinaryValuesCheckBox; 371 private System.Windows.Forms.TabControl filterTabControl; 372 private System.Windows.Forms.TabPage filterTabPage; 373 private System.Windows.Forms.TabPage constraintsTabPage; 374 private System.Windows.Forms.Button deselectAllButton; 375 private System.Windows.Forms.Button selectAllButton; 376 private System.Windows.Forms.CheckedListBox constraintsCheckedListBox; 287 377 288 378 } -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Query/Views/QueryView.cs
r7573 r7589 21 21 22 22 using System; 23 using System.Collections; 24 using System.Collections.Generic; 23 25 using System.IO; 24 26 using System.Linq; … … 75 77 private void LoadResultsAsync(int batchSize) { 76 78 bool includeBinaryValues = includeBinaryValuesCheckBox.Checked; 79 IEnumerable<ValueName> valueNames = constraintsCheckedListBox.CheckedItems.Cast<ValueName>(); 77 80 78 81 Cursor = Cursors.AppStarting; … … 99 102 while (ids.Count() > 0) { 100 103 cancellationToken.ThrowIfCancellationRequested(); 101 runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x))); 104 if (AllValueNamesChecked()) { 105 runs.AddRange(QueryClient.Instance.GetRuns(ids.Take(batchSize), includeBinaryValues).Select(x => ConvertToOptimizationRun(x))); 106 } else { 107 runs.AddRange(QueryClient.Instance.GetRunsWithValues(ids.Take(batchSize), includeBinaryValues, valueNames).Select(x => ConvertToOptimizationRun(x))); 108 } 102 109 ids = ids.Skip(batchSize); 103 110 Invoke(new Action(() => { … … 146 153 } else { 147 154 CreateFilterView(); 155 CreateConstraintsView(); 148 156 filtersInfoPanel.Visible = false; 149 157 splitContainer.Enabled = true; … … 179 187 } 180 188 } 189 } 190 191 private void CreateConstraintsView() { 192 constraintsCheckedListBox.Items.Clear(); 193 constraintsCheckedListBox.Items.AddRange(QueryClient.Instance.ValueNames.ToArray()); 194 SetCheckedState(true); 181 195 } 182 196 … … 221 235 return null; 222 236 } 237 238 private void SetCheckedState(bool val) { 239 for (int i = 0; i < constraintsCheckedListBox.Items.Count; i++) { 240 constraintsCheckedListBox.SetItemChecked(i, val); 241 } 242 } 243 244 private bool AllValueNamesChecked() { 245 return constraintsCheckedListBox.Items.Count == constraintsCheckedListBox.CheckedItems.Count; 246 } 247 248 private void selectAllButton_Click(object sender, EventArgs e) { 249 SetCheckedState(true); 250 } 251 252 private void deselectAllButton_Click(object sender, EventArgs e) { 253 SetCheckedState(false); 254 } 223 255 } 224 256 }
Note: See TracChangeset
for help on using the changeset viewer.