Changeset 5976 for trunk/sources
- Timestamp:
- 04/07/11 14:06:18 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs
r5824 r5976 204 204 this.chart.Text = "chart"; 205 205 this.chart.AxisViewChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.ViewEventArgs>(this.chart_AxisViewChanged); 206 this.chart.MouseDo wn += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);206 this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.chart_DoubleClick); 207 207 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 208 208 this.chart.MouseUp += new System.Windows.Forms.MouseEventHandler(this.chart_MouseUp); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r5837 r5976 432 432 433 433 #region Drag & drop and tooltip 434 private IRun draggedRun; 435 private void chart_MouseDown(object sender, MouseEventArgs e) { 434 private void chart_DoubleClick(object sender, MouseEventArgs e) { 436 435 HitTestResult h = this.chart.HitTest(e.X, e.Y); 437 436 if (h.ChartElementType == ChartElementType.DataPoint) { 438 437 IRun run = (IRun)((DataPoint)h.Object).Tag; 439 if (e.Clicks >= 2) { 440 IContentView view = MainFormManager.MainForm.ShowContent(run); 441 if (view != null) { 442 view.ReadOnly = this.ReadOnly; 443 view.Locked = this.Locked; 444 } 445 } else 446 this.draggedRun = run; 438 IContentView view = MainFormManager.MainForm.ShowContent(run); 439 if (view != null) { 440 view.ReadOnly = this.ReadOnly; 441 view.Locked = this.Locked; 442 } 447 443 this.chart.ChartAreas[0].CursorX.SetSelectionPosition(double.NaN, double.NaN); 448 444 this.chart.ChartAreas[0].CursorY.SetSelectionPosition(double.NaN, double.NaN); … … 452 448 private void chart_MouseUp(object sender, MouseEventArgs e) { 453 449 if (isSelecting) { 454 Content.UpdateOfRunsInProgress = true;455 450 System.Windows.Forms.DataVisualization.Charting.Cursor xCursor = chart.ChartAreas[0].CursorX; 456 451 System.Windows.Forms.DataVisualization.Charting.Cursor yCursor = chart.ChartAreas[0].CursorY; … … 484 479 this.chart.ChartAreas[0].CursorX.SelectionStart = this.chart.ChartAreas[0].CursorX.SelectionEnd; 485 480 this.chart.ChartAreas[0].CursorY.SelectionStart = this.chart.ChartAreas[0].CursorY.SelectionEnd; 486 Content.UpdateOfRunsInProgress = false;487 481 } 488 482 } … … 490 484 private void chart_MouseMove(object sender, MouseEventArgs e) { 491 485 HitTestResult h = this.chart.HitTest(e.X, e.Y); 492 if (!Locked) {493 if (this.draggedRun != null && h.ChartElementType != ChartElementType.DataPoint) {494 DataObject data = new DataObject();495 data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, draggedRun);496 if (ReadOnly)497 DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);498 else {499 DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);500 if ((result & DragDropEffects.Move) == DragDropEffects.Move)501 Content.Remove(draggedRun);502 }503 this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !isSelecting;504 this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !isSelecting;505 this.draggedRun = null;506 }507 }508 509 486 string newTooltipText = string.Empty; 510 487 string oldTooltipText; … … 670 647 671 648 private void ColorRuns(string axisValue) { 672 Content.UpdateOfRunsInProgress = true;673 649 var runs = Content.Select(r => new { Run = r, Value = GetValue(r, axisValue) }).Where(r => r.Value.HasValue); 674 650 double minValue = runs.Min(r => r.Value.Value); … … 678 654 foreach (var r in runs) { 679 655 int colorIndex = 0; 680 if (!range.IsAlmost(0)) colorIndex = (int)((ColorGradient.Colors.Count - 1) * (r.Value.Value - minValue) / ( maxValue - minValue));656 if (!range.IsAlmost(0)) colorIndex = (int)((ColorGradient.Colors.Count - 1) * (r.Value.Value - minValue) / (range)); 681 657 r.Run.Color = ColorGradient.Colors[colorIndex]; 682 658 } 683 Content.UpdateOfRunsInProgress = false;684 659 } 685 660 #endregion
Note: See TracChangeset
for help on using the changeset viewer.