Changeset 7780
- Timestamp:
- 05/04/12 13:35:59 (13 years ago)
- Location:
- branches/HeuristicLab.Visualization
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Visualization
- Property svn:ignore
-
old new 1 1 *.suo 2 2 CustomPostBuild.cmd 3 _ReSharper.HeuristicLab.Visualization
-
- Property svn:ignore
-
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Chart.cs
r4776 r7780 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Text;25 24 using System.Drawing; 25 using System.Linq; 26 26 using System.Windows.Forms; 27 27 … … 242 242 } else if (Mode == ChartMode.Select) { 243 243 if (button == MouseButtons.Left) { 244 IList<IPrimitive> selected = Group.SelectedPrimitives ;244 IList<IPrimitive> selected = Group.SelectedPrimitives.Where(p => p.ContainsPoint(p1)).ToList(); 245 245 UpdateEnabled = false; 246 246 foreach (IPrimitive primitive in selected) -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartControl.cs
r7617 r7780 81 81 mouseClickCount = e.Clicks; 82 82 } 83 pr ivatevoid pictureBox_MouseUp(object sender, MouseEventArgs e) {83 protected virtual void pictureBox_MouseUp(object sender, MouseEventArgs e) { 84 84 if (e.Button == MouseButtons.Left) { 85 85 if (Chart.Mode == ChartMode.Zoom) { 86 86 pictureBox.Refresh(); 87 Point lowerLeft = new Point(Math.Min(e.X, buttonDownPoint.X), 88 Math.Max(e.Y, buttonDownPoint.Y)); 89 Point upperRight = new Point(Math.Max(e.X, buttonDownPoint.X), 90 Math.Min(e.Y, buttonDownPoint.Y)); 87 // some code to preserve the aspect ratio when zooming 88 // +---------------------+ (Width,Height) 89 // | (x1,y1) | 90 // | +-------+ | 91 // | | | | 92 // | | | | 93 // | +-------+ | 94 // | (x2,y2) | 95 // (0,0) +---------------------+ 96 // 97 double aspectRatio = (double)Width / Height; 98 double x1 = Math.Min(e.X, buttonDownPoint.X); 99 double y1 = Math.Max(e.Y, buttonDownPoint.Y); 100 double x2 = Math.Max(e.X, buttonDownPoint.X); 101 double y2 = Math.Min(e.Y, buttonDownPoint.Y); 102 // consider the relative ratios between the X and Y dimensions of the selection 103 // area and the Width and Height, respectively. The "dominant" dimension is the 104 // one with a ratio closer to 1, and it stays fixed while the other is adjusted 105 // in order to preserve the aspect ratio 106 if ((x2 - x1) / Width > (y1 - y2) / Height) { 107 y1 = y2 + (x2 - x1) / aspectRatio; 108 } else { 109 x2 = aspectRatio * (y1 - y2) + x1; 110 } 111 var lowerLeft = new Point((int)x1, (int)y1); 112 var upperRight = new Point((int)x2, (int)y2); 91 113 if ((lowerLeft.X != upperRight.X) && (lowerLeft.Y != upperRight.Y)) { 92 114 Chart.ZoomIn(lowerLeft, upperRight); … … 112 134 } 113 135 } 136 114 137 private void pictureBox_MouseMove(object sender, MouseEventArgs e) { 115 toolTip.SetToolTip(pictureBox, Chart.GetToolTipText(e.Location)); 138 var text = Chart.GetToolTipText(e.Location); 139 if (toolTip.GetToolTip(pictureBox) != text) 140 toolTip.SetToolTip(pictureBox, text); 116 141 Cursor cursor = Chart.GetCursor(e.Location); 117 142 if (cursor != null) pictureBox.Cursor = cursor; -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/HeuristicLab.Visualization-3.3.csproj
r5170 r7780 40 40 <DebugType>full</DebugType> 41 41 <Optimize>false</Optimize> 42 <OutputPath> bin\Debug\</OutputPath>42 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 43 43 <DefineConstants>DEBUG;TRACE</DefineConstants> 44 44 <ErrorReport>prompt</ErrorReport> … … 50 50 <DebugType>pdbonly</DebugType> 51 51 <Optimize>true</Optimize> 52 <OutputPath> bin\Release\</OutputPath>52 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 53 53 <DefineConstants>TRACE</DefineConstants> 54 54 <ErrorReport>prompt</ErrorReport> 55 55 <WarningLevel>4</WarningLevel> 56 56 <TreatWarningsAsErrors>false</TreatWarningsAsErrors> 57 <DocumentationFile>bin\Release\HeuristicLab.Visualization-3.3.xml</DocumentationFile> 57 <DocumentationFile> 58 </DocumentationFile> 58 59 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 59 60 </PropertyGroup> -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/HeuristicLab.Visualization-3.3.csproj.user
r4776 r7780 12 12 <ProjectView>ProjectFiles</ProjectView> 13 13 </PropertyGroup> 14 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> 15 <StartAction>Program</StartAction> 16 <StartProgram>C:\Users\bburlacu\Desktop\HL-Core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram> 17 </PropertyGroup> 18 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> 19 <StartAction>Program</StartAction> 20 <StartProgram>C:\Users\bburlacu\Desktop\HL-Core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram> 21 </PropertyGroup> 14 22 </Project> -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/Ellipse.cs
r4776 r7780 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using System.Drawing; 26 24 -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/FixedSizeCircle.cs
r4776 r7780 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using System.Drawing; 26 23 … … 61 58 double yDistance = x.Y - center.Y; 62 59 63 return Size.Height *Size.Height/4.0 >= (xDistance * xDistance + yDistance * yDistance);60 return Size.Height * Size.Height / 4.0 >= (xDistance * xDistance + yDistance * yDistance); 64 61 } 65 62 } -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/PrimitiveBase.cs
r4776 r7780 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using System.Drawing; 26 24 using System.Windows.Forms; -
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/RectangularPrimitiveBase.cs
r4776 r7780 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using System.Drawing; 26 24 using System.Drawing.Drawing2D;
Note: See TracChangeset
for help on using the changeset viewer.