Changeset 1351 for trunk/sources/HeuristicLab.Visualization
- Timestamp:
- 03/16/09 20:51:48 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/LineChart.cs
r1350 r1351 21 21 private readonly ViewSettings viewSettings; 22 22 23 // private readonly Stack<RectangleD> clippingAreaHistory = new Stack<RectangleD>();24 23 private readonly WorldShape userInteractionShape = new WorldShape(); 25 24 private readonly RectangleShape rectangleShape = new RectangleShape(0, 0, 0, 0, Color.FromArgb(50, 0, 0, 255)); … … 162 161 } 163 162 164 private void UpdateYAxisInfo(YAxisDescriptor yAxisDescriptor) {165 // if (yAxisInfos.ContainsKey(yAxisDescriptor)) {166 // yAxisInfos.Remove(yAxisDescriptor);167 // }168 }169 170 163 /// <summary> 171 164 /// sets the legend position … … 234 227 235 228 public void OnDataRowChanged(IDataRow row) { 236 UpdateYAxisInfo(row.YAxis);237 238 229 RowEntry rowEntry = rowToRowEntry[row]; 239 230 … … 447 438 448 439 private void Pan(Point startPoint, Point endPoint) { 440 RectangleD clippingArea = Translate.ClippingArea(startPoint, endPoint, xAxis.ClippingArea, xAxis.Viewport); 441 442 SetClipX(clippingArea.X1, clippingArea.X2); 443 449 444 foreach (RowEntry rowEntry in rowEntries) { 450 RectangleD clippingArea = CalcPanClippingArea(startPoint, endPoint, rowEntry.LinesShape); 451 452 SetClipX(clippingArea.X1, clippingArea.X1); 445 clippingArea = Translate.ClippingArea(startPoint, endPoint, rowEntry.LinesShape.ClippingArea, rowEntry.LinesShape.Viewport); 453 446 SetClipY(rowEntry, clippingArea.Y1, clippingArea.Y2); 454 447 } … … 458 451 459 452 private void PanEnd(Point startPoint, Point endPoint) { 453 Pan(startPoint, endPoint); 454 } 455 456 private void SetClippingArea(Rectangle rectangle) { 457 RectangleD clippingArea = Transform.ToWorld(rectangle, xAxis.Viewport, xAxis.ClippingArea); 458 459 SetClipX(clippingArea.X1, clippingArea.X2); 460 460 461 foreach (RowEntry rowEntry in rowEntries) { 461 RectangleD clippingArea = CalcPanClippingArea(startPoint, endPoint, rowEntry.LinesShape); 462 463 SetClipX(clippingArea.X1, clippingArea.X1); 464 SetClipY(rowEntry, clippingArea.Y1, clippingArea.Y2); 465 } 466 467 canvasUI.Invalidate(); 468 } 469 470 private static RectangleD CalcPanClippingArea(Point startPoint, Point endPoint, LinesShape linesShape) { 471 return Translate.ClippingArea(startPoint, endPoint, linesShape.ClippingArea, linesShape.Viewport); 472 } 473 474 private void SetClippingArea(Rectangle rectangle) { 475 foreach (RowEntry rowEntry in rowEntries) { 476 RectangleD clippingArea = Transform.ToWorld(rectangle, rowEntry.LinesShape.Viewport, rowEntry.LinesShape.ClippingArea); 477 478 SetClipX(clippingArea.X1, clippingArea.X1); 462 clippingArea = Transform.ToWorld(rectangle, rowEntry.LinesShape.Viewport, rowEntry.LinesShape.ClippingArea); 463 479 464 SetClipY(rowEntry, clippingArea.Y1, clippingArea.Y2); 480 465 } … … 490 475 491 476 private void canvasUI1_KeyDown(object sender, KeyEventArgs e) { 492 // if (e.KeyCode == Keys.Back && clippingAreaHistory.Count > 1) {493 // clippingAreaHistory.Pop();494 //495 // RectangleD clippingArea = clippingAreaHistory.Peek();496 //497 // SetLineClippingArea(clippingArea, false);498 // }499 477 } 500 478 … … 540 518 private void canvasUI1_MouseWheel(object sender, MouseEventArgs e) { 541 519 if (ModifierKeys == Keys.Control) { 542 double zoomFactor = (e.Delta > 0) ? 0.9 : 1.1; 520 double zoomFactor = (e.Delta > 0) ? 0.7 : 1.3; 521 522 PointD world; 523 524 world = Transform.ToWorld(e.Location, xAxis.Viewport, xAxis.ClippingArea); 525 526 double x1 = world.X - (world.X - xAxis.ClippingArea.X1)*zoomFactor; 527 double x2 = world.X + (xAxis.ClippingArea.X2 - world.X)*zoomFactor; 528 529 SetClipX(x1, x2); 543 530 544 531 foreach (RowEntry rowEntry in rowEntries) { 545 RectangleD clippingArea = ZoomListener.ZoomClippingArea(rowEntry.LinesShape.ClippingArea, zoomFactor); 546 547 SetClipX(clippingArea.X1, clippingArea.X1); 548 SetClipY(rowEntry, clippingArea.Y1, clippingArea.Y2); 549 } 532 world = Transform.ToWorld(e.Location, rowEntry.LinesShape.Viewport, rowEntry.LinesShape.ClippingArea); 533 534 double y1 = world.Y - (world.Y - rowEntry.LinesShape.ClippingArea.Y1) * zoomFactor; 535 double y2 = world.Y + (rowEntry.LinesShape.ClippingArea.Y2 - world.Y)*zoomFactor; 536 537 SetClipY(rowEntry, y1, y2); 538 } 539 540 canvasUI.Invalidate(); 550 541 } 551 542 } -
trunk/sources/HeuristicLab.Visualization/RectangleShape.cs
r1240 r1351 7 7 8 8 private Color color; 9 private int opacity = 255;10 9 11 10 private Pen pen; … … 54 53 private Brush GetBrush() { 55 54 if (brush == null) 56 brush = new SolidBrush( Color.FromArgb(opacity, color));55 brush = new SolidBrush(color); 57 56 return brush; 58 }59 60 public int Opacity {61 get { return opacity; }62 set {63 opacity = value;64 DisposeDrawingTools();65 }66 57 } 67 58
Note: See TracChangeset
for help on using the changeset viewer.