Changeset 2909
- Timestamp:
- 03/02/10 11:28:00 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/NetronVisualization.cs
r2868 r2909 49 49 this.Controller = new Controller(this); 50 50 this.Document = new Document(); 51 this.Document.Model.Selection = new Selection(this.Controller, this.Document.Model);51 this.Document.Model.Selection = new Selection(this.Controller, this.Document.Model); 52 52 this.View = new View(this); 53 53 this.AttachToDocument(Document); … … 59 59 60 60 this.SizeChanged += new EventHandler(NetronVisualization_SizeChanged); 61 this.AllowDrop = true; 61 this.UpdateView(); 62 } 63 } 64 65 public Size PageSize { 66 get { return this.View.PageSize; } 67 set { 68 this.View.PageSize = value; 69 this.UpdateView(); 70 } 71 } 72 73 private void UpdateView() { 74 //zoom in to show scrollbars - code taken from ControllerBase line 1082 75 SizeF s = this.View.Magnification; 76 float alpha = 1.1F; 77 View.Magnification = new SizeF( 78 s.Width * alpha, 79 s.Height * alpha); 80 81 float w = (float)this.AutoScrollPosition.X / 82 (float)this.AutoScrollMinSize.Width; 83 84 float h = (float)this.AutoScrollPosition.Y / 85 (float)this.AutoScrollMinSize.Height; 86 87 RectangleF pageBounds = this.Controller.Model.CurrentPage.Bounds; 88 pageBounds.Inflate(s); 89 SizeF deltaSize = new SizeF( 90 pageBounds.Width - this.ClientRectangle.Width, 91 pageBounds.Height - this.ClientRectangle.Height); 92 93 if ((deltaSize.Width > 0) && (deltaSize.Height > 0)) { 94 this.AutoScrollMinSize = Size.Round(deltaSize); 62 95 } 63 96 } … … 65 98 private void NetronVisualization_SizeChanged(object sender, EventArgs e) { 66 99 //if (this.oldSize == INVALID_SIZE) { 67 100 //this.View.PageSize = new Size((int)(this.Size.Width * this.Magnification.Width), (int)(this.Size.Height * this.Magnification.Height)); 68 101 // if (!this.DesignMode) 69 102 // oldSize = this.Size; -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/GraphVisualizationInfoView.Designer.cs
r2893 r2909 39 39 this.graphVisualization.FileName = ""; 40 40 this.graphVisualization.Location = new System.Drawing.Point(0, 0); 41 this.graphVisualization.Magnification = new System.Drawing.SizeF( 71F, 71F);41 this.graphVisualization.Magnification = new System.Drawing.SizeF(80F, 80F); 42 42 this.graphVisualization.Name = "graphVisualization"; 43 43 this.graphVisualization.Origin = new System.Drawing.Point(0, 0); 44 this.graphVisualization.PageSize = new System.Drawing.Size(100000, 100000); 44 45 this.graphVisualization.ShowConnectors = true; 45 46 this.graphVisualization.ShowRulers = false; -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/GraphVisualizationInfoView.cs
r2899 r2909 35 35 using HeuristicLab.MainForm.WindowsForms; 36 36 using HeuristicLab.Collections; 37 using System.Diagnostics; 38 using System.Threading; 37 39 38 40 namespace HeuristicLab.Operators.Views.GraphVisualization { … … 335 337 this.graphVisualization.Controller.RunActivity(layoutName); 336 338 this.graphVisualization.Invalidate(); 339 340 //fix to avoid negative shape positions after layouting 341 Thread.Sleep(100); 342 int minX = this.graphVisualization.Controller.Model.Shapes.Min(s => s.Location.X); 343 int shiftX = minX < 0 ? Math.Abs(minX) + 50 : 0; 344 int minY = this.graphVisualization.Controller.Model.Shapes.Min(s => s.Location.Y); 345 int shiftY = minY < 0 ? Math.Abs(minY) + 50 : 0; 346 if (minX < 0 || minY < 0) { 347 foreach (IShape s in this.Controller.Model.Shapes) 348 s.MoveBy(new Point(shiftX, shiftY)); 349 } 337 350 } 338 351 } -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.Designer.cs
r2899 r2909 40 40 this.zoomInButton = new System.Windows.Forms.Button(); 41 41 this.zoomOutButton = new System.Windows.Forms.Button(); 42 this.buttonToolTip = new System.Windows.Forms.ToolTip(); 42 43 this.shapeContextMenu.SuspendLayout(); 43 44 this.splitContainer.Panel1.SuspendLayout(); … … 54 55 this.graphVisualizationInfoView.Caption = null; 55 56 this.graphVisualizationInfoView.Content = null; 56 this.graphVisualizationInfoView.Location = new System.Drawing.Point( 0, 27);57 this.graphVisualizationInfoView.Location = new System.Drawing.Point(3, 30); 57 58 this.graphVisualizationInfoView.Name = "graphVisualizationInfoView"; 58 this.graphVisualizationInfoView.Size = new System.Drawing.Size(66 5, 251);59 this.graphVisualizationInfoView.Size = new System.Drawing.Size(662, 248); 59 60 this.graphVisualizationInfoView.TabIndex = 0; 60 61 // … … 138 139 // selectButton 139 140 // 140 this.selectButton.Image = HeuristicLab.Common.Resources. Resources.FlagGreenIcon;141 this.selectButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Pointer; 141 142 this.selectButton.Location = new System.Drawing.Point(3, 3); 142 143 this.selectButton.Name = "selectButton"; … … 145 146 this.selectButton.UseVisualStyleBackColor = true; 146 147 this.selectButton.Click += new System.EventHandler(selectButton_Click); 148 this.buttonToolTip.SetToolTip(this.selectButton, "Select Tool"); 147 149 // 148 150 // panButton 149 151 // 150 this.panButton.Image = HeuristicLab.Common.Resources. Resources.FlagRedIcon;152 this.panButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Breakpoint; 151 153 this.panButton.Location = new System.Drawing.Point(33, 3); 152 154 this.panButton.Name = "panButton"; … … 155 157 this.panButton.UseVisualStyleBackColor = true; 156 158 this.panButton.Click += new System.EventHandler(panButton_Click); 159 this.buttonToolTip.SetToolTip(this.panButton, "Pan Tool"); 157 160 // 158 161 // connectButton … … 165 168 this.connectButton.UseVisualStyleBackColor = true; 166 169 this.connectButton.Click += new System.EventHandler(connectButton_Click); 170 this.buttonToolTip.SetToolTip(this.connectButton, "Connection Tool"); 167 171 // 168 172 // relayoutButton … … 175 179 this.relayoutButton.UseVisualStyleBackColor = true; 176 180 this.relayoutButton.Click += new System.EventHandler(relayoutButton_Click); 181 this.buttonToolTip.SetToolTip(this.relayoutButton, "Relayout Graph"); 177 182 // 178 183 // zoomAreaButton … … 185 190 this.zoomAreaButton.UseVisualStyleBackColor = true; 186 191 this.zoomAreaButton.Click += new System.EventHandler(zoomAreaButton_Click); 192 this.buttonToolTip.SetToolTip(this.zoomAreaButton, "Zoom Area Tool"); 187 193 // 188 194 // zoomInButton 189 195 // 190 this.zoomInButton.Image = HeuristicLab.Common.Resources. Resources.ShowLargeIcons;196 this.zoomInButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ZoomIn; 191 197 this.zoomInButton.Location = new System.Drawing.Point(183, 3); 192 198 this.zoomInButton.Name = "zoomInButton"; … … 195 201 this.zoomInButton.UseVisualStyleBackColor = true; 196 202 this.zoomInButton.Click += new System.EventHandler(zoomInButton_Click); 203 this.buttonToolTip.SetToolTip(this.zoomInButton, "Zoom In"); 197 204 // 198 205 // zoomOutButton 199 206 // 200 this.zoomOutButton.Image = HeuristicLab.Common.Resources. Resources.ShowSmallIcons;207 this.zoomOutButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ZoomOut; 201 208 this.zoomOutButton.Location = new System.Drawing.Point(213, 3); 202 209 this.zoomOutButton.Name = "zoomOutButton"; … … 205 212 this.zoomOutButton.UseVisualStyleBackColor = true; 206 213 this.zoomOutButton.Click += new System.EventHandler(zoomOutButton_Click); 214 this.buttonToolTip.SetToolTip(this.zoomOutButton, "Zoom Out"); 207 215 // 208 216 // OperatorGraphView … … 241 249 private System.Windows.Forms.Button connectButton; 242 250 private System.Windows.Forms.Button panButton; 251 private System.Windows.Forms.ToolTip buttonToolTip; 243 252 } 244 253 }
Note: See TracChangeset
for help on using the changeset viewer.