Changeset 13061
- Timestamp:
- 10/23/15 16:22:22 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs
r10884 r13061 109 109 110 110 new private void Clear() { 111 Group.Clear();111 base.Clear(); 112 112 primitivesToNodes.Clear(); 113 113 nodesToPrimitives.Clear(); … … 129 129 PreferredNodeWidth = 80; 130 130 PreferredNodeHeight = 40; 131 Group = new Group(chart);131 // Group = new Group(chart); 132 132 133 133 defaultBrush = new SolidBrush(Color.Transparent); … … 160 160 if (node.SubtreeCount == 0) { 161 161 rectangularPrimitive = new Rectangle(Chart, lowerLeft, upperRight) { 162 Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f162 // Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f 163 163 }; 164 164 } else { 165 165 rectangularPrimitive = new Ellipse(Chart, lowerLeft, upperRight) { 166 Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f166 // Font = defaultFont, Text = shortenedLabel, Brush = defaultBrush, Pen = defaultPen, MaximumFontSize = 12f 167 167 }; 168 168 } … … 200 200 Pen = defaultPen, 201 201 Brush = defaultBrush, 202 Text = Label,203 Font = defaultFont202 // Text = Label, 203 // Font = defaultFont 204 204 }; 205 205 this.Add(labelRect); … … 218 218 var rpb = primitive as RectangularPrimitiveBase; 219 219 if (rpb != null) { 220 rpb.SetPosition(rpb.LowerLeft.X, Size.Height - rpb.UpperRight.Y, rpb.UpperRight.X, Size.Height - rpb.LowerLeft.Y); 220 var lowerLeft = new PointD(rpb.LowerLeft.X, Size.Height - rpb.UpperRight.Y); 221 var upperRight = new PointD(rpb.UpperRight.X, Size.Height - rpb.LowerLeft.Y); 222 rpb.SetPosition(lowerLeft, upperRight); 221 223 222 224 } else { 223 225 var line = primitive as LinearPrimitiveBase; 224 226 if (line != null) { 225 line.SetPosition(line.Start.X, Size.Height - line.Start.Y, line.End.X, Size.Height - line.End.Y); 227 var lowerLeft = new PointD(line.Start.X, Size.Height - line.Start.Y); 228 var upperRight = new PointD(line.End.X, Size.Height - line.End.Y); 229 line.SetPosition(lowerLeft, upperRight); 226 230 } 227 231 } -
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 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs
r12406 r13061 139 139 var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(node); 140 140 var traceGraph = TraceCalculator.TraceSubtree(graphNode, subtreeIndex, updateVertexWeights: false, updateSubtreeWeights: false, cacheTraceNodes: true); 141 genealogyGraphChart. UpdateEnabled = false;141 genealogyGraphChart.SuspendRendering(); 142 142 genealogyGraphChart.ClearPrimitives(); // clear everything 143 143 var rankMaximums = new Dictionary<double, double>(); … … 177 177 } 178 178 } 179 genealogyGraphChart.UpdateEnabled = true; 180 genealogyGraphChart.EnforceUpdate(); 179 genealogyGraphChart.ResumeRendering(); 181 180 } else { 182 181 // perform matching like it was done before … … 218 217 219 218 switch (args.Button) { 220 case MouseButtons.Left: { 219 case MouseButtons.Left: 220 { 221 221 OnTreeNodeLeftClicked(subtree); 222 222 break; 223 223 } 224 case MouseButtons.Middle: { 224 case MouseButtons.Middle: 225 { 225 226 OnTreeNodeMiddleClicked(subtree); 226 227 break; … … 243 244 244 245 private void graphChart_HighlightMatchingVertices(IEnumerable<IGenealogyGraphNode> vertices) { 245 genealogyGraphChart. Chart.UpdateEnabled = false;246 genealogyGraphChart.SuspendRendering(); 246 247 genealogyGraphChart.ClearPrimitives(); 247 248 genealogyGraphChart.HighlightNodes(vertices); 248 genealogyGraphChart.Chart.UpdateEnabled = true; 249 genealogyGraphChart.Chart.EnforceUpdate(); 249 genealogyGraphChart.ResumeRendering(); 250 250 } 251 251
Note: See TracChangeset
for help on using the changeset viewer.