- Timestamp:
- 06/10/09 17:14:04 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization/3.2
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/AvgAggregator.cs
r1996 r2040 3 3 4 4 namespace HeuristicLab.Visualization { 5 public class AvgAggregator : DataRowBase { 5 public interface IAggregator { 6 void AddWatch(IDataRow dataRow); 7 void RemoveWatch(IDataRow dataRow); 8 } 9 10 public class AvgAggregator : DataRowBase, IAggregator { 6 11 #region IAggregator Members 7 12 … … 58 63 curAvgValue = 0; 59 64 count = 0; 65 this.RowSettings.LineType = DataRowType.SingleValue; 60 66 } 61 67 -
trunk/sources/HeuristicLab.Visualization/3.2/AvgLineAggregator.cs
r1996 r2040 3 3 4 4 namespace HeuristicLab.Visualization { 5 public class AvgLineAggregator : DataRowBase {5 public class AvgLineAggregator : DataRowBase, IAggregator { 6 6 7 7 private readonly List<double> dataRow = new List<double>(); -
trunk/sources/HeuristicLab.Visualization/3.2/DataRow.cs
r2028 r2040 224 224 } 225 225 } 226 227 public override string ToString() {228 return RowSettings.Label;229 }230 226 } 231 227 } -
trunk/sources/HeuristicLab.Visualization/3.2/DataRowBase.cs
r1996 r2040 17 17 } 18 18 19 public string Label{ 20 get { return rowSettings.Label; } 21 } 22 19 23 protected DataRowBase() { 20 24 rowSettings = new DataRowSettings(); 25 rowSettings.LineType = DataRowType.Normal; //default value for most lines and aggregators 21 26 rowSettings.DataVisualSettingChanged += value_DataVisualSettingChanged; 22 27 } -
trunk/sources/HeuristicLab.Visualization/3.2/FloatingAvgAggregator.cs
r1996 r2040 3 3 4 4 namespace HeuristicLab.Visualization { 5 public class FloatingAvgAggregator : DataRowBase {5 public class FloatingAvgAggregator : DataRowBase, IAggregator { 6 6 7 7 private readonly List<double> dataRow = new List<double>(); -
trunk/sources/HeuristicLab.Visualization/3.2/HeuristicLab.Visualization-3.2.csproj
r1993 r2040 116 116 <Compile Include="LabelProvider\ContinuousLabelProvider.cs" /> 117 117 <Compile Include="LabelProvider\DiscreteLabelProvider.cs" /> 118 <Compile Include="Options\AddLineDialog.cs"> 119 <SubType>Form</SubType> 120 </Compile> 121 <Compile Include="Options\AddLineDialog.Designer.cs"> 122 <DependentUpon>AddLineDialog.cs</DependentUpon> 123 </Compile> 118 124 <Compile Include="Options\ColorSelection.cs"> 119 125 <SubType>UserControl</SubType> … … 205 211 <SubType>Designer</SubType> 206 212 </EmbeddedResource> 213 <EmbeddedResource Include="Options\AddLineDialog.resx"> 214 <DependentUpon>AddLineDialog.cs</DependentUpon> 215 </EmbeddedResource> 207 216 <EmbeddedResource Include="Options\ColorSelection.resx"> 208 217 <DependentUpon>ColorSelection.cs</DependentUpon> -
trunk/sources/HeuristicLab.Visualization/3.2/IDataRow.cs
r1996 r2040 23 23 void RemoveValue(int index); 24 24 void RemoveValues(int index, int count); 25 25 26 26 int Count { get; } 27 27 double this[int index] { get; set; } … … 30 30 double MaxValue { get; } 31 31 32 string Label{ get;} 33 32 34 event ValuesChangedHandler ValuesChanged; 33 35 event ValueChangedHandler ValueChanged; -
trunk/sources/HeuristicLab.Visualization/3.2/MaxAggregator.cs
r1996 r2040 3 3 4 4 namespace HeuristicLab.Visualization { 5 public class MaxAggregator : DataRowBase {5 public class MaxAggregator : DataRowBase, IAggregator { 6 6 #region IAggregator Members 7 7 … … 23 23 24 24 #endregion 25 26 public MaxAggregator() { 27 this.RowSettings.LineType = DataRowType.SingleValue; 28 } 29 25 30 26 31 List<IDataRow> dataRowWatches = new List<IDataRow>(); -
trunk/sources/HeuristicLab.Visualization/3.2/MinAggregator.cs
r1996 r2040 3 3 4 4 namespace HeuristicLab.Visualization { 5 public class MinAggregator : DataRowBase {5 public class MinAggregator : DataRowBase, IAggregator { 6 6 #region IAggregator Members 7 7 … … 23 23 24 24 #endregion 25 26 public MinAggregator() { 27 this.RowSettings.LineType=DataRowType.SingleValue; 28 } 25 29 26 30 readonly List<IDataRow> dataRowWatches = new List<IDataRow>(); -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.Designer.cs
r1885 r2040 26 26 this.Optionstabs = new System.Windows.Forms.TabControl(); 27 27 this.tabPage1 = new System.Windows.Forms.TabPage(); 28 this.btnAddLine = new System.Windows.Forms.Button(); 28 29 this.label2 = new System.Windows.Forms.Label(); 29 30 this.LinestyleCB = new System.Windows.Forms.ComboBox(); … … 31 32 this.LineSelectCB = new System.Windows.Forms.ComboBox(); 32 33 this.groupBox1 = new System.Windows.Forms.GroupBox(); 34 this.selectedLineColorSelection = new HeuristicLab.Visualization.Options.ColorSelection(); 33 35 this.MarkercheckBox = new System.Windows.Forms.CheckBox(); 34 36 this.label4 = new System.Windows.Forms.Label(); … … 44 46 this.btnChangeTitleFont = new System.Windows.Forms.Button(); 45 47 this.tpXAxis = new System.Windows.Forms.TabPage(); 48 this.groupBox2 = new System.Windows.Forms.GroupBox(); 49 this.label6 = new System.Windows.Forms.Label(); 50 this.xAxisGridColorSelection = new HeuristicLab.Visualization.Options.ColorSelection(); 46 51 this.chkShowXAxisGrid = new System.Windows.Forms.CheckBox(); 47 52 this.btnChangeXAxisFont = new System.Windows.Forms.Button(); … … 52 57 this.flpShowYAxis = new System.Windows.Forms.FlowLayoutPanel(); 53 58 this.fdFont = new System.Windows.Forms.FontDialog(); 54 this.label6 = new System.Windows.Forms.Label();55 this.groupBox2 = new System.Windows.Forms.GroupBox();56 this.selectedLineColorSelection = new HeuristicLab.Visualization.Options.ColorSelection();57 this.xAxisGridColorSelection = new HeuristicLab.Visualization.Options.ColorSelection();58 59 this.Optionstabs.SuspendLayout(); 59 60 this.tabPage1.SuspendLayout(); … … 62 63 this.tpTitle.SuspendLayout(); 63 64 this.tpXAxis.SuspendLayout(); 65 this.groupBox2.SuspendLayout(); 64 66 this.tpYAxes.SuspendLayout(); 65 67 this.gbxYAxisClipChangeable.SuspendLayout(); 66 68 this.gbxShowYAxis.SuspendLayout(); 67 this.groupBox2.SuspendLayout();68 69 this.SuspendLayout(); 69 70 // … … 84 85 // tabPage1 85 86 // 87 this.tabPage1.Controls.Add(this.btnAddLine); 86 88 this.tabPage1.Controls.Add(this.label2); 87 89 this.tabPage1.Controls.Add(this.LinestyleCB); … … 97 99 this.tabPage1.UseVisualStyleBackColor = true; 98 100 // 101 // btnAddLine 102 // 103 this.btnAddLine.Location = new System.Drawing.Point(192, 177); 104 this.btnAddLine.Name = "btnAddLine"; 105 this.btnAddLine.Size = new System.Drawing.Size(75, 23); 106 this.btnAddLine.TabIndex = 10; 107 this.btnAddLine.Text = "Add Line"; 108 this.btnAddLine.UseVisualStyleBackColor = true; 109 this.btnAddLine.Click += new System.EventHandler(this.btnAddLine_Click); 110 // 99 111 // label2 100 112 // … … 144 156 this.groupBox1.Location = new System.Drawing.Point(4, 54); 145 157 this.groupBox1.Name = "groupBox1"; 146 this.groupBox1.Size = new System.Drawing.Size(274, 12 9);158 this.groupBox1.Size = new System.Drawing.Size(274, 120); 147 159 this.groupBox1.TabIndex = 9; 148 160 this.groupBox1.TabStop = false; 149 161 this.groupBox1.Text = "Details"; 150 162 // 163 // selectedLineColorSelection 164 // 165 this.selectedLineColorSelection.Color = System.Drawing.SystemColors.Control; 166 this.selectedLineColorSelection.Location = new System.Drawing.Point(142, 73); 167 this.selectedLineColorSelection.Name = "selectedLineColorSelection"; 168 this.selectedLineColorSelection.Size = new System.Drawing.Size(121, 25); 169 this.selectedLineColorSelection.TabIndex = 10; 170 this.selectedLineColorSelection.ColorChanged += new HeuristicLab.Visualization.Options.ColorChangedHandler(this.selectedLineColorSelection_ColorChanged); 171 // 151 172 // MarkercheckBox 152 173 // 153 174 this.MarkercheckBox.AutoSize = true; 154 this.MarkercheckBox.Location = new System.Drawing.Point( 142, 106);175 this.MarkercheckBox.Location = new System.Drawing.Point(204, 103); 155 176 this.MarkercheckBox.Name = "MarkercheckBox"; 156 177 this.MarkercheckBox.Size = new System.Drawing.Size(59, 17); … … 280 301 this.tpXAxis.UseVisualStyleBackColor = true; 281 302 // 303 // groupBox2 304 // 305 this.groupBox2.Controls.Add(this.label6); 306 this.groupBox2.Controls.Add(this.xAxisGridColorSelection); 307 this.groupBox2.Controls.Add(this.chkShowXAxisGrid); 308 this.groupBox2.Location = new System.Drawing.Point(8, 42); 309 this.groupBox2.Name = "groupBox2"; 310 this.groupBox2.Size = new System.Drawing.Size(205, 94); 311 this.groupBox2.TabIndex = 6; 312 this.groupBox2.TabStop = false; 313 this.groupBox2.Text = "Grid"; 314 // 315 // label6 316 // 317 this.label6.AutoSize = true; 318 this.label6.Location = new System.Drawing.Point(20, 55); 319 this.label6.Name = "label6"; 320 this.label6.Size = new System.Drawing.Size(31, 13); 321 this.label6.TabIndex = 5; 322 this.label6.Text = "Color"; 323 // 324 // xAxisGridColorSelection 325 // 326 this.xAxisGridColorSelection.Color = System.Drawing.SystemColors.Control; 327 this.xAxisGridColorSelection.Location = new System.Drawing.Point(54, 49); 328 this.xAxisGridColorSelection.Name = "xAxisGridColorSelection"; 329 this.xAxisGridColorSelection.Size = new System.Drawing.Size(126, 25); 330 this.xAxisGridColorSelection.TabIndex = 4; 331 this.xAxisGridColorSelection.ColorChanged += new HeuristicLab.Visualization.Options.ColorChangedHandler(this.xAxisGridColorSelection_ColorChanged); 332 // 282 333 // chkShowXAxisGrid 283 334 // … … 355 406 this.flpShowYAxis.Size = new System.Drawing.Size(275, 57); 356 407 this.flpShowYAxis.TabIndex = 0; 357 //358 // label6359 //360 this.label6.AutoSize = true;361 this.label6.Location = new System.Drawing.Point(20, 55);362 this.label6.Name = "label6";363 this.label6.Size = new System.Drawing.Size(31, 13);364 this.label6.TabIndex = 5;365 this.label6.Text = "Color";366 //367 // groupBox2368 //369 this.groupBox2.Controls.Add(this.label6);370 this.groupBox2.Controls.Add(this.xAxisGridColorSelection);371 this.groupBox2.Controls.Add(this.chkShowXAxisGrid);372 this.groupBox2.Location = new System.Drawing.Point(8, 42);373 this.groupBox2.Name = "groupBox2";374 this.groupBox2.Size = new System.Drawing.Size(205, 94);375 this.groupBox2.TabIndex = 6;376 this.groupBox2.TabStop = false;377 this.groupBox2.Text = "Grid";378 //379 // selectedLineColorSelection380 //381 this.selectedLineColorSelection.Color = System.Drawing.SystemColors.Control;382 this.selectedLineColorSelection.Location = new System.Drawing.Point(142, 73);383 this.selectedLineColorSelection.Name = "selectedLineColorSelection";384 this.selectedLineColorSelection.Size = new System.Drawing.Size(121, 25);385 this.selectedLineColorSelection.TabIndex = 10;386 this.selectedLineColorSelection.ColorChanged += new HeuristicLab.Visualization.Options.ColorChangedHandler(this.selectedLineColorSelection_ColorChanged);387 //388 // xAxisGridColorSelection389 //390 this.xAxisGridColorSelection.Color = System.Drawing.SystemColors.Control;391 this.xAxisGridColorSelection.Location = new System.Drawing.Point(54, 49);392 this.xAxisGridColorSelection.Name = "xAxisGridColorSelection";393 this.xAxisGridColorSelection.Size = new System.Drawing.Size(126, 25);394 this.xAxisGridColorSelection.TabIndex = 4;395 this.xAxisGridColorSelection.ColorChanged += new HeuristicLab.Visualization.Options.ColorChangedHandler(this.xAxisGridColorSelection_ColorChanged);396 408 // 397 409 // Options … … 413 425 this.tpTitle.PerformLayout(); 414 426 this.tpXAxis.ResumeLayout(false); 427 this.groupBox2.ResumeLayout(false); 428 this.groupBox2.PerformLayout(); 415 429 this.tpYAxes.ResumeLayout(false); 416 430 this.tpYAxes.PerformLayout(); … … 419 433 this.gbxShowYAxis.ResumeLayout(false); 420 434 this.gbxShowYAxis.PerformLayout(); 421 this.groupBox2.ResumeLayout(false);422 this.groupBox2.PerformLayout();423 435 this.ResumeLayout(false); 424 436 … … 459 471 private System.Windows.Forms.Label label6; 460 472 private ColorSelection xAxisGridColorSelection; 473 private System.Windows.Forms.Button btnAddLine; 474 private AddLineDialog addLineDialog; 461 475 } 462 476 } -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.cs
r2028 r2040 10 10 private ViewSettings viewSettings; 11 11 private ViewSettings oldViewSettings; 12 private Li neParams[]oldLineParams;12 private List<LineParams> oldLineParams; 13 13 private string oldTitle; 14 14 private Dictionary<CheckBox, bool> ShowYAxisBoxes; … … 154 154 155 155 private void Options_Load(object sender, EventArgs e) { 156 model.DataRowAdded += model_DataRowAdded; 156 157 oldShowXAxisGrid = model.XAxis.ShowGrid; 157 158 chkShowXAxisGrid.Checked = model.XAxis.ShowGrid; … … 165 166 InitTabPageLines(); 166 167 InitTabPageYAxes(); 168 } 169 170 void model_DataRowAdded(IDataRow row) 171 { 172 LineSelectCB.Items.Add(row); 173 oldLineParams.Add(new LineParams(row)); 167 174 } 168 175 … … 170 177 if (model.Rows.Count != 0) { 171 178 int index = 0; 172 oldLineParams = new Li neParams[model.Rows.Count];179 oldLineParams = new List<LineParams>(); 173 180 foreach (var row in model.Rows) { 174 oldLineParams[index++] = new LineParams(row); 181 oldLineParams.Add(new LineParams(row)); 182 LineSelectCB.Items.Add(row); 175 183 } 176 184 LineThicknessCB.DataSource = GetThicknesses(); … … 180 188 MarkercheckBox.Checked = model.Rows[0].RowSettings.ShowMarkers; 181 189 182 LineSelectCB.DataSource = model.Rows; 190 // LineSelectCB.DataSource = model.Rows; 191 LineSelectCB.DisplayMember = "RowSettings.Label"; 192 183 193 184 194 LineSelectCB.SelectedIndex = 0; … … 213 223 214 224 private void LineSelectCB_SelectedIndexChanged(object sender, EventArgs e) { 215 if (LineSelectCB.Selected Value!= null) {225 if (LineSelectCB.SelectedItem != null) { 216 226 /* int index = 217 227 LineThicknessCB.FindStringExact(((IDataRow)LineSelectCB.SelectedValue).Thickness.ToString()); … … 219 229 index = LinestyleCB.FindStringExact(((IDataRow)LineSelectCB.SelectedValue).Style.ToString()); 220 230 LinestyleCB.SelectedIndex = index; */ 221 LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.Selected Value).RowSettings.Thickness;222 LinestyleCB.SelectedItem = ((IDataRow)LineSelectCB.Selected Value).RowSettings.Style;223 selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.Selected Value).RowSettings.Color;224 MarkercheckBox.Checked = ((IDataRow)LineSelectCB.Selected Value).RowSettings.ShowMarkers;231 LineThicknessCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedItem).RowSettings.Thickness; 232 LinestyleCB.SelectedItem = ((IDataRow)LineSelectCB.SelectedItem).RowSettings.Style; 233 selectedLineColorSelection.Color = ((IDataRow)LineSelectCB.SelectedItem).RowSettings.Color; 234 MarkercheckBox.Checked = ((IDataRow)LineSelectCB.SelectedItem).RowSettings.ShowMarkers; 225 235 } 226 236 } … … 232 242 233 243 private void LinestyleCB_SelectedIndexChanged(object sender, EventArgs e) { 234 if (LineSelectCB.Selected Value!= null) {235 ((IDataRow)LineSelectCB.Selected Value).RowSettings.Style = (DrawingStyle)LinestyleCB.SelectedItem;244 if (LineSelectCB.SelectedItem != null) { 245 ((IDataRow)LineSelectCB.SelectedItem).RowSettings.Style = (DrawingStyle)LinestyleCB.SelectedItem; 236 246 } 237 247 } 238 248 239 249 private void LineThicknessCB_SelectedIndexChanged(object sender, EventArgs e) { 240 if (LineSelectCB.Selected Value!= null) {241 ((IDataRow)LineSelectCB.Selected Value).RowSettings.Thickness = (int)LineThicknessCB.SelectedItem;250 if (LineSelectCB.SelectedItem != null) { 251 ((IDataRow)LineSelectCB.SelectedItem).RowSettings.Thickness = (int)LineThicknessCB.SelectedItem; 242 252 } 243 253 } 244 254 245 255 private void MarkercheckBox_CheckedChanged(object sender, EventArgs e) { 246 if (LineSelectCB.Selected Value!= null) {247 ((IDataRow)LineSelectCB.Selected Value).RowSettings.ShowMarkers = MarkercheckBox.Checked;256 if (LineSelectCB.SelectedItem != null) { 257 ((IDataRow)LineSelectCB.SelectedItem).RowSettings.ShowMarkers = MarkercheckBox.Checked; 248 258 } 249 259 } … … 259 269 260 270 private void selectedLineColorSelection_ColorChanged(ColorSelection sender) { 261 ((IDataRow)LineSelectCB.SelectedValue).RowSettings.Color = selectedLineColorSelection.Color; 271 if(LineSelectCB.SelectedItem!=null) 272 ((IDataRow)LineSelectCB.SelectedItem).RowSettings.Color = selectedLineColorSelection.Color; 262 273 } 263 274 … … 265 276 model.XAxis.GridColor = xAxisGridColorSelection.Color; 266 277 } 278 279 private void btnAddLine_Click(object sender, EventArgs e) { 280 addLineDialog = new AddLineDialog(model); 281 addLineDialog.Show(); 282 } 267 283 } 268 284 }
Note: See TracChangeset
for help on using the changeset viewer.