Changeset 13061 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4
- Timestamp:
- 10/23/15 16:22:22 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
r12208 r13061 80 80 } 81 81 82 public bool UpdateEnabled {83 get { return Chart.UpdateEnabled; }84 set { Chart.UpdateEnabled = value; }85 }86 87 public void EnforceUpdate() {88 Chart.EnforceUpdate();89 }82 // public bool UpdateEnabled { 83 // get { return Chart.UpdateEnabled; } 84 // set { Chart.UpdateEnabled = value; } 85 // } 86 87 // public void EnforceUpdate() { 88 // Chart.EnforceUpdate(); 89 // } 90 90 91 91 private Visualization.Rectangle TargetRectangle { get; set; } … … 118 118 119 119 protected virtual void DrawGraph(double xIncrement, double yIncrement, double diameter) { 120 Chart.UpdateEnabled = false;120 this.SuspendRendering(); 121 121 DrawInProgress = true; 122 122 … … 160 160 var pen = Pens.Transparent; 161 161 var visualArc = AddArc(Chart, visualParent, visualNode, pen); 162 visualArc.OneLayerDown(); // send it behind the visual nodes162 Chart.OneLayerDown(visualArc); // send it behind the visual nodes 163 163 if (!arcMap.ContainsKey(Tuple.Create(visualParent, visualNode))) { 164 164 arcMap.Add(Tuple.Create(visualParent, visualNode), visualArc); … … 167 167 } 168 168 169 Chart.UpdateEnabled = true; 170 Chart.EnforceUpdate(); 171 169 ResumeRendering(); 172 170 DrawInProgress = false; 173 171 } … … 187 185 #region event handlers 188 186 189 protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) {187 protected override void PictureBoxOnMouseMove(object sender, MouseEventArgs e) { 190 188 if (!DrawInProgress) { 191 189 switch (e.Button) { 192 190 case MouseButtons.Left: 193 Chart.Mode = ChartMode.Select;191 Mode = ChartMode.Select; 194 192 Cursor = Cursors.Default; 195 193 break; 196 194 case MouseButtons.Middle: 197 Chart.Mode = ChartMode.Move;195 Mode = ChartMode.Move; 198 196 Cursor = Cursors.Hand; 199 197 break; 200 198 } 201 199 } 202 base. pictureBox_MouseMove(sender, e);203 } 204 205 protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {200 base.PictureBoxOnMouseMove(sender, e); 201 } 202 203 protected override void PictureBoxOnMouseUp(object sender, MouseEventArgs e) { 206 204 Cursor = Cursors.Default; 207 if ( Chart.Mode == ChartMode.Move) {208 Chart.Mode = ChartMode.Select;205 if (Mode == ChartMode.Move) { 206 Mode = ChartMode.Select; 209 207 return; 210 208 } 211 if ( Chart.Mode != ChartMode.Select) {212 base. pictureBox_MouseUp(sender, e);209 if (Mode != ChartMode.Select) { 210 base.PictureBoxOnMouseUp(sender, e); 213 211 return; 214 212 } … … 224 222 UpdateSelectedVisualNode(); // redraw ancestries, mark node etc. 225 223 226 base. pictureBox_MouseUp(sender, e);224 base.PictureBoxOnMouseUp(sender, e); 227 225 } 228 226 … … 230 228 if (!LockGenealogy) { 231 229 // new node has been selected, clean up 232 Chart.UpdateEnabled = false;230 SuspendRendering(); 233 231 if (ModifierKeys != Keys.Shift) { 234 232 // clear colors … … 247 245 248 246 // update 249 UpdateEnabled = true; 250 EnforceUpdate(); 247 ResumeRendering(); 251 248 252 249 if (SelectedVisualNode != null) … … 281 278 double y2 = y1 + size.Height; 282 279 if (TargetRectangle == null) { 283 TargetRectangle = new Visualization.Rectangle(Chart, x1, y1, x2, y2, new Pen(Color.Black), null); 280 var lowerLeft = new PointD(x1, y1); 281 var upperRight = new PointD(x2, y2); 282 TargetRectangle = new Visualization.Rectangle(Chart, lowerLeft, upperRight, new Pen(Color.Black), null); 284 283 Chart.Group.Add(TargetRectangle); 285 284 } else { 286 TargetRectangle.SetPosition(x1, y1, x2, y2); 285 var lowerLeft = new PointD(x1, y1); 286 var upperRight = new PointD(x2, y2); 287 TargetRectangle.SetPosition(lowerLeft, upperRight); 287 288 } 288 289 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs
r12208 r13061 42 42 // splitContainer 43 43 // 44 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 45 | System.Windows.Forms.AnchorStyles.Left) 44 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 45 | System.Windows.Forms.AnchorStyles.Left) 46 46 | System.Windows.Forms.AnchorStyles.Right))); 47 47 this.splitContainer.Location = new System.Drawing.Point(3, 55); … … 61 61 // viewHost 62 62 // 63 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 64 | System.Windows.Forms.AnchorStyles.Left) 63 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 64 | System.Windows.Forms.AnchorStyles.Left) 65 65 | System.Windows.Forms.AnchorStyles.Right))); 66 66 this.viewHost.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; … … 137 137 // genealogyGraphChart 138 138 // 139 this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 140 | System.Windows.Forms.AnchorStyles.Left) 139 this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 140 | System.Windows.Forms.AnchorStyles.Left) 141 141 | System.Windows.Forms.AnchorStyles.Right))); 142 142 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control; … … 151 151 this.genealogyGraphChart.TabIndex = 0; 152 152 this.genealogyGraphChart.TraceFragments = false; 153 this.genealogyGraphChart.UpdateEnabled = true;154 153 // 155 154 // GenealogyGraphView
Note: See TracChangeset
for help on using the changeset viewer.