Changeset 8213 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4
- Timestamp:
- 07/04/12 16:12:15 (12 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking
- Property svn:ignore
-
old new 1 *.suo 1 2 _ReSharper.HeuristicLab.Tracking 2 3 bin
-
- Property svn:ignore
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views
-
Property
svn:ignore
set to
*.user
bin
obj
-
Property
svn:ignore
set to
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.Designer.cs
r7779 r8213 59 59 60 60 #endregion 61 62 //private System.Windows.Forms.ToolTip toolTip;63 61 } 64 62 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
r7817 r8213 26 26 using System.Linq; 27 27 using System.Windows.Forms; 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 29 30 using HeuristicLab.Visualization; … … 33 34 private Dictionary<GenealogyGraphNode, List<VisualGenealogyGraphNode>> _visualNodeMap; 34 35 private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> _visualArcMap; 35 private const int Diameter = 20; 36 private int x, y; 37 private const int Cx = 30, Cy = 30; 38 36 private const int Diameter = 20; // node diameter 37 private int x, y; // coordinates for positioning each node 38 private const int Cx = 30, Cy = 30; // position increments 39 39 private VisualGenealogyGraphNode _selectedGenealogyGraphNode; 40 40 public VisualGenealogyGraphNode SelectedGenealogyGraphNode { get { return _selectedGenealogyGraphNode; } } … … 74 74 for (int i = 0; i != count; ++i) { 75 75 // propagate elites from successive layers 76 if (currRank == (int)currRank) prevLayer = currLayer; 76 bool f = currRank % 1 == 0; 77 if (f) // if the rank is an integer, then we need to propagate elites 78 prevLayer = currLayer; 77 79 currRank = layers.ElementAt(i).Key; 78 80 currLayer = layers.ElementAt(i).ToList(); 79 if (i > 0 && currRank == (int)currRank) { 80 // this code injects elites that propagate from the previous generation into the current graph layer, so that they can be represented as visual nodes 81 int prevCount = prevLayer.Count(node => node.IsElite); 82 int currCount = currLayer.Count(node => node.IsElite); 83 for (int j = currCount; j < prevCount; ++j) currLayer.Add(prevLayer.ElementAt(j)); 81 if (i > 0 && f) { 82 // this following code injects elites that propagate from the previous generation into the current graph layer, 83 // so that they can be represented as visual nodes 84 int prevEliteCount = prevLayer.Count(node => node.IsElite); 85 int currEliteCount = currLayer.Count(node => node.IsElite); 86 for (int j = currEliteCount; j < prevEliteCount; ++j) 87 currLayer.Add(prevLayer.ElementAt(j)); 84 88 } 85 89 currLayer.Sort(); // uses the CompareTo() method inside the GenealogyGraphNode class 86 87 90 foreach (var node in currLayer) { 88 91 var pen = new Pen(Color.LightGray); 89 92 var nl = Environment.NewLine; 90 93 var visualNode = new VisualGenealogyGraphNode(Chart, x, y, x + Diameter, y + Diameter, pen, null) { 91 Data = node, ToolTipText = "Id: " + node.Label + nl + "Rank: " + node.Rank + nl + "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl + "IsElite: " + node.IsElite 94 Data = node, 95 ToolTipText = "Id: " + node.Label + nl + 96 "Rank: " + node.Rank + nl + 97 "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl + 98 "IsElite: " + node.IsElite 92 99 }; 93 100 Chart.Group.Add(visualNode); 94 if (!_visualNodeMap.ContainsKey(node)) _visualNodeMap[node] = new List<VisualGenealogyGraphNode>(); 101 if (!_visualNodeMap.ContainsKey(node)) 102 _visualNodeMap[node] = new List<VisualGenealogyGraphNode>(); 95 103 _visualNodeMap[node].Add(visualNode); 96 // connect visual nodes that actually represent the same individual in the genealogy graph (this applies for elites) with a dashed line 104 // connect visual nodes that actually represent the same individual 105 // in the genealogy graph (this applies for elites) with a dashed line 97 106 if (_visualNodeMap[node].Count > 1) { 98 107 for (int c = _visualNodeMap[node].Count; c >= 2; --c) { … … 104 113 } 105 114 x += Cx; // increment horizontal coordinate 106 if (node.InEdges == null ) continue;115 if (node.InEdges == null && _visualNodeMap.ContainsKey(node)) continue; 107 116 // add visual edges 108 117 foreach (var arc in node.InEdges) { 109 118 var parent = arc.Target; 110 119 // find the visual parent node that is closest to the current node in terms of vertical distance 111 var visualParent = _visualNodeMap[parent].Where(p => p.Center.Y > visualNode.Center.Y).OrderByDescending(p => p.Center.Y).Last();120 var visualParent = _visualNodeMap[parent].Where(p => p.Center.Y >= visualNode.Center.Y).OrderByDescending(p => p.Center.Y).Last(); 112 121 DashStyle style; 113 if (visualParent.Data == visualNode.Data) { 122 if (visualParent.Data == visualNode.Data) { // if the graph nodes represent the same elite individual 114 123 style = DashStyle.Dash; 115 124 } else { … … 143 152 base.pictureBox_MouseUp(sender, e); 144 153 else { // select mode 145 Chart.UpdateEnabled = false;146 // clear colors147 foreach (var primitive in Chart.Group.Primitives) {148 if (primitive is VisualGenealogyGraphNode) {149 var visualNode = primitive as VisualGenealogyGraphNode;150 visualNode.Brush = null;151 } else if (primitive is VisualGenealogyGraphArc) {152 var visualArc = primitive as VisualGenealogyGraphArc;153 if (visualArc.Source.Data != visualArc.Target.Data) visualArc.Pen.Brush = new SolidBrush(Color.Transparent);154 }155 }156 154 // get selected node 157 155 var visualNodes = Chart.GetAllPrimitives(e.Location).Where(p => p is VisualGenealogyGraphNode).ToList(); 158 156 if (visualNodes.Count > 0) { 157 if (_selectedGenealogyGraphNode == visualNodes[0]) return; 159 158 _selectedGenealogyGraphNode = visualNodes[0] as VisualGenealogyGraphNode; 160 // color selected node and its genealogy161 159 if (_selectedGenealogyGraphNode == null) return; 162 // use special highlighting for the currently selected genealogy graph node 160 // new node has been selected, clean up 161 Chart.UpdateEnabled = false; 162 // clear colors 163 ClearAllNodes(); 164 // use a rectangle to highlight the currently selected genealogy graph node 163 165 var center = _selectedGenealogyGraphNode.Center; 164 166 var size = _selectedGenealogyGraphNode.Size; 165 double x1 = center.X - size.Width / 2, x2 = x1 + size.Width; 166 double y1 = center.Y - size.Height / 2, y2 = y1 + size.Height; 167 if (_targetRectangle != null) _targetRectangle.SetPosition(x1, y1, x2, y2); 168 else { 167 double x1 = center.X - size.Width / 2; 168 double x2 = x1 + size.Width; 169 double y1 = center.Y - size.Height / 2; 170 double y2 = y1 + size.Height; 171 if (_targetRectangle == null) { 169 172 _targetRectangle = new Visualization.Rectangle(Chart, x1, y1, x2, y2, new Pen(Color.Black), null); 170 173 Chart.Group.Add(_targetRectangle); 174 } else { 175 _targetRectangle.SetPosition(x1, y1, x2, y2); 171 176 } 172 177 var gNode = _selectedGenealogyGraphNode.Data; // genealogy graph node (representing an individual in the population) 173 178 double rank = gNode.Rank; 179 // ancestors 174 180 var ancestors = gNode.Ancestors().Where(a => a.Rank < rank).ToList(); 175 181 ancestors.Add(gNode); 176 // highlight selected node and its ancestry 177 foreach (var node in ancestors.SelectMany(n => _visualNodeMap[n])) { 178 node.Brush = new SolidBrush(node.ToColor()); 179 if (node.IncomingArcs != null && node == _visualNodeMap[node.Data].First()) { 180 foreach (var arc in node.IncomingArcs) { 181 if (arc.Source.Data == node.Data) continue; 182 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 183 var end = new Point((int)arc.End.X, (int)arc.End.Y); 184 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor()); 185 } 186 } 187 } 188 // highlight the descendants 182 // descendants 189 183 var descendants = gNode.Descendants().Where(a => a.Rank > rank).ToList(); 190 184 descendants.Add(gNode); 191 foreach (var node in descendants.SelectMany(n => _visualNodeMap[n])) { 185 // highlight ancestors 186 foreach (var node in ancestors.Select(n => _visualNodeMap[n][0])) { 192 187 node.Brush = new SolidBrush(node.ToColor()); 193 foreach (var arc in node.IncomingArcs.Where(a => descendants.Contains(a.Source.Data))) { 194 if (arc.Source.Data == node.Data) continue; 195 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 196 var end = new Point((int)arc.End.X, (int)arc.End.Y); 197 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor()); 198 } 188 if (node.IncomingArcs != null) 189 foreach (var arc in node.IncomingArcs) 190 if (arc.Source.Data != arc.Target.Data && arc.Source == _visualNodeMap[arc.Source.Data][0]) { 191 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 192 var end = new Point((int)arc.End.X, (int)arc.End.Y); 193 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor()); 194 } 195 } 196 // highlight descendants 197 foreach (var node in descendants.Select(n => _visualNodeMap[n][0])) { 198 node.Brush = new SolidBrush(node.ToColor()); 199 if (node.OutgoingArcs != null) 200 foreach (var arc in node.OutgoingArcs) 201 if (arc.Source.Data != arc.Target.Data && arc.Target == _visualNodeMap[arc.Target.Data][0]) { 202 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 203 var end = new Point((int)arc.End.X, (int)arc.End.Y); 204 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor()); 205 } 199 206 } 200 207 } else { … … 206 213 if (_selectedGenealogyGraphNode != null) 207 214 /* emit clicked event */ 208 GenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e);215 OnGenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e); 209 216 } 210 217 } 211 218 212 219 public void ClearAllNodes() { 220 foreach (var primitive in Chart.Group.Primitives) { 221 if (primitive.Brush != null) 222 primitive.Brush = null; 223 if (primitive is VisualGenealogyGraphArc) { 224 var arc = primitive as VisualGenealogyGraphArc; 225 if (arc.Source.Data != arc.Target.Data && primitive.Pen.Brush != null) 226 primitive.Pen.Brush = new SolidBrush(Color.Transparent); 227 } 228 } 229 } 230 231 public void HighlightLineage(IEnumerable<GenealogyGraphNode> nodes) { 232 foreach (var node in nodes.SelectMany(n => _visualNodeMap[n])) { 233 node.Brush = new SolidBrush(node.ToColor()); 234 if (node.IncomingArcs != null && node == _visualNodeMap[node.Data][0]) { 235 foreach (var arc in node.IncomingArcs) { 236 if (arc.Source.Data == node.Data) continue; 237 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 238 var end = new Point((int)arc.End.X, (int)arc.End.Y); 239 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor()); 240 } 241 } 242 } 243 } 244 245 public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees, Color color) { 246 foreach (var visualNode in trees.Select(tree => _visualNodeMap[Graph.GetNode(tree)]).SelectMany(vList => vList)) 247 visualNode.Brush = new SolidBrush(color); 248 } 249 250 public void HighlightInDegree() { 213 251 Chart.UpdateEnabled = false; 214 foreach (var node in Chart.Group.Primitives.Where(p => p is VisualGenealogyGraphNode).Cast<VisualGenealogyGraphNode>()) { 215 node.Brush = null; 216 if (node.IncomingArcs != null) 217 foreach (var arc in node.IncomingArcs) 218 if (arc.Source.Data != node.Data) arc.Pen = new Pen(Color.Transparent); 252 ClearAllNodes(); 253 var graphNodes = Graph.Values.ToList(); 254 double min = graphNodes.Min(x => x.InEdges == null ? 0 : x.InEdges.Count); 255 double max = graphNodes.Max(x => x.InEdges == null ? 0 : x.InEdges.Count); 256 foreach (var graphNode in graphNodes) { 257 var visualNode = _visualNodeMap[graphNode][0]; 258 double deg = graphNode.InEdges == null ? 0 : graphNode.InEdges.Count; 259 var color = Color.FromArgb((int)(1 - deg / max) * 255, (int)(deg / max * 255), 100); 260 visualNode.Brush = new SolidBrush(color); 219 261 } 220 262 Chart.UpdateEnabled = true; … … 222 264 } 223 265 224 public void Highlight Nodes(IEnumerable<ISymbolicExpressionTree> trees, Color color) {266 public void HighlightOutDegree() { 225 267 Chart.UpdateEnabled = false; 226 foreach (var visualNode in trees.Select(tree => _visualNodeMap[Graph.GetNode(tree)]).SelectMany(vList => vList)) 227 visualNode.Brush = new SolidBrush(color); 228 268 ClearAllNodes(); 269 var graphNodes = Graph.Values.ToList(); 270 double min = graphNodes.Min(x => x.OutEdges == null ? 0 : x.OutEdges.Count); 271 double max = graphNodes.Max(x => x.OutEdges == null ? 0 : x.OutEdges.Count); 272 foreach (var graphNode in graphNodes) { 273 var visualNode = _visualNodeMap[graphNode][0]; 274 double deg = graphNode.OutEdges == null ? 0 : graphNode.OutEdges.Count; 275 int index = (int)(deg / max * ColorGradient.Colors.Count) - 1; 276 if (index < 0) index = 0; 277 visualNode.Brush = new SolidBrush(ColorGradient.Colors[index]); 278 } 229 279 Chart.UpdateEnabled = true; 230 280 Chart.EnforceUpdate(); -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.Designer.cs
r7779 r8213 27 27 this.mainTableLayout = new System.Windows.Forms.TableLayoutPanel(); 28 28 this.splitContainer = new System.Windows.Forms.SplitContainer(); 29 this.topControlBox = new System.Windows.Forms.GroupBox();30 this.similarityModeLabel = new System.Windows.Forms.Label();31 this.similarityModeSelector = new System.Windows.Forms.ComboBox();32 this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();33 29 this.genealogyTableLayout = new System.Windows.Forms.TableLayoutPanel(); 34 30 this.graphControlsPanel = new System.Windows.Forms.Panel(); … … 36 32 this.moveModeButton = new System.Windows.Forms.RadioButton(); 37 33 this.zoomModeButton = new System.Windows.Forms.RadioButton(); 34 this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart(); 35 this.topControlBox = new System.Windows.Forms.GroupBox(); 36 this.similarityModeLabel = new System.Windows.Forms.Label(); 37 this.similarityModeSelector = new System.Windows.Forms.ComboBox(); 38 38 this.genealogyGraphChart = new HeuristicLab.EvolutionaryTracking.Views.GenealogyGraphChart(); 39 this.inDegreeButton = new System.Windows.Forms.Button(); 40 this.outDegreeButton = new System.Windows.Forms.Button(); 39 41 this.mainTableLayout.SuspendLayout(); 40 42 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); … … 42 44 this.splitContainer.Panel2.SuspendLayout(); 43 45 this.splitContainer.SuspendLayout(); 44 this.topControlBox.SuspendLayout();45 46 this.genealogyTableLayout.SuspendLayout(); 46 47 this.graphControlsPanel.SuspendLayout(); 48 this.topControlBox.SuspendLayout(); 47 49 this.SuspendLayout(); 48 50 // … … 83 85 this.splitContainer.TabIndex = 7; 84 86 // 85 // topControlBox86 //87 this.topControlBox.Controls.Add(this.similarityModeLabel);88 this.topControlBox.Controls.Add(this.similarityModeSelector);89 this.topControlBox.Dock = System.Windows.Forms.DockStyle.Fill;90 this.topControlBox.Location = new System.Drawing.Point(3, 3);91 this.topControlBox.Name = "topControlBox";92 this.topControlBox.Size = new System.Drawing.Size(522, 44);93 this.topControlBox.TabIndex = 6;94 this.topControlBox.TabStop = false;95 this.topControlBox.Text = "Controls";96 //97 // similarityModeLabel98 //99 this.similarityModeLabel.AutoSize = true;100 this.similarityModeLabel.Location = new System.Drawing.Point(6, 20);101 this.similarityModeLabel.Name = "similarityModeLabel";102 this.similarityModeLabel.Size = new System.Drawing.Size(80, 13);103 this.similarityModeLabel.TabIndex = 1;104 this.similarityModeLabel.Text = "Similarity Mode:";105 //106 // similarityModeSelector107 //108 this.similarityModeSelector.FormattingEnabled = true;109 this.similarityModeSelector.Items.AddRange(new object[] {110 "Exact",111 "High",112 "Relaxed"});113 this.similarityModeSelector.Location = new System.Drawing.Point(92, 17);114 this.similarityModeSelector.Name = "similarityModeSelector";115 this.similarityModeSelector.Size = new System.Drawing.Size(148, 21);116 this.similarityModeSelector.TabIndex = 0;117 this.similarityModeSelector.SelectedIndexChanged += new System.EventHandler(this.similarityModeSelector_SelectedIndexChanged);118 //119 // symbolicExpressionTreeChart120 //121 this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;122 this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;123 this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;124 this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);125 this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart";126 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(275, 385);127 this.symbolicExpressionTreeChart.Spacing = 5;128 this.symbolicExpressionTreeChart.SuspendRepaint = false;129 this.symbolicExpressionTreeChart.TabIndex = 2;130 this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);131 this.symbolicExpressionTreeChart.Tree = null;132 //133 87 // genealogyTableLayout 134 88 // … … 148 102 // graphControlsPanel 149 103 // 104 this.graphControlsPanel.Controls.Add(this.outDegreeButton); 105 this.graphControlsPanel.Controls.Add(this.inDegreeButton); 150 106 this.graphControlsPanel.Controls.Add(this.selectModeButton); 151 107 this.graphControlsPanel.Controls.Add(this.moveModeButton); … … 160 116 this.selectModeButton.Appearance = System.Windows.Forms.Appearance.Button; 161 117 this.selectModeButton.AutoSize = true; 162 this.selectModeButton.Location = new System.Drawing.Point( 103, 3);118 this.selectModeButton.Location = new System.Drawing.Point(65, 3); 163 119 this.selectModeButton.Name = "selectModeButton"; 164 this.selectModeButton.Size = new System.Drawing.Size( 47, 23);120 this.selectModeButton.Size = new System.Drawing.Size(24, 23); 165 121 this.selectModeButton.TabIndex = 5; 166 122 this.selectModeButton.TabStop = true; 167 this.selectModeButton.Text = "S elect";123 this.selectModeButton.Text = "S"; 168 124 this.selectModeButton.UseVisualStyleBackColor = true; 169 125 this.selectModeButton.CheckedChanged += new System.EventHandler(this.selectModeButton_CheckedChanged); … … 175 131 this.moveModeButton.Location = new System.Drawing.Point(3, 3); 176 132 this.moveModeButton.Name = "moveModeButton"; 177 this.moveModeButton.Size = new System.Drawing.Size( 44, 23);133 this.moveModeButton.Size = new System.Drawing.Size(26, 23); 178 134 this.moveModeButton.TabIndex = 3; 179 135 this.moveModeButton.TabStop = true; 180 this.moveModeButton.Text = "M ove";136 this.moveModeButton.Text = "M"; 181 137 this.moveModeButton.UseVisualStyleBackColor = true; 182 138 this.moveModeButton.CheckedChanged += new System.EventHandler(this.moveModeButton_CheckedChanged); … … 186 142 this.zoomModeButton.Appearance = System.Windows.Forms.Appearance.Button; 187 143 this.zoomModeButton.AutoSize = true; 188 this.zoomModeButton.Location = new System.Drawing.Point( 53, 3);144 this.zoomModeButton.Location = new System.Drawing.Point(35, 3); 189 145 this.zoomModeButton.Name = "zoomModeButton"; 190 this.zoomModeButton.Size = new System.Drawing.Size( 44, 23);146 this.zoomModeButton.Size = new System.Drawing.Size(24, 23); 191 147 this.zoomModeButton.TabIndex = 4; 192 148 this.zoomModeButton.TabStop = true; 193 this.zoomModeButton.Text = "Z oom";149 this.zoomModeButton.Text = "Z"; 194 150 this.zoomModeButton.UseVisualStyleBackColor = true; 195 151 this.zoomModeButton.CheckedChanged += new System.EventHandler(this.zoomModeButton_CheckedChanged); 152 // 153 // symbolicExpressionTreeChart 154 // 155 this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White; 156 this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill; 157 this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black; 158 this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0); 159 this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart"; 160 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(275, 385); 161 this.symbolicExpressionTreeChart.Spacing = 5; 162 this.symbolicExpressionTreeChart.SuspendRepaint = false; 163 this.symbolicExpressionTreeChart.TabIndex = 2; 164 this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F); 165 this.symbolicExpressionTreeChart.Tree = null; 166 // 167 // topControlBox 168 // 169 this.topControlBox.Controls.Add(this.similarityModeLabel); 170 this.topControlBox.Controls.Add(this.similarityModeSelector); 171 this.topControlBox.Dock = System.Windows.Forms.DockStyle.Fill; 172 this.topControlBox.Location = new System.Drawing.Point(3, 3); 173 this.topControlBox.Name = "topControlBox"; 174 this.topControlBox.Size = new System.Drawing.Size(522, 44); 175 this.topControlBox.TabIndex = 6; 176 this.topControlBox.TabStop = false; 177 this.topControlBox.Text = "Controls"; 178 // 179 // similarityModeLabel 180 // 181 this.similarityModeLabel.AutoSize = true; 182 this.similarityModeLabel.Location = new System.Drawing.Point(6, 20); 183 this.similarityModeLabel.Name = "similarityModeLabel"; 184 this.similarityModeLabel.Size = new System.Drawing.Size(80, 13); 185 this.similarityModeLabel.TabIndex = 1; 186 this.similarityModeLabel.Text = "Similarity Mode:"; 187 // 188 // similarityModeSelector 189 // 190 this.similarityModeSelector.FormattingEnabled = true; 191 this.similarityModeSelector.Items.AddRange(new object[] { 192 "Exact", 193 "High", 194 "Relaxed"}); 195 this.similarityModeSelector.Location = new System.Drawing.Point(92, 17); 196 this.similarityModeSelector.Name = "similarityModeSelector"; 197 this.similarityModeSelector.Size = new System.Drawing.Size(148, 21); 198 this.similarityModeSelector.TabIndex = 0; 199 this.similarityModeSelector.SelectedIndexChanged += new System.EventHandler(this.similarityModeSelector_SelectedIndexChanged); 196 200 // 197 201 // genealogyGraphChart … … 204 208 this.genealogyGraphChart.Size = new System.Drawing.Size(233, 343); 205 209 this.genealogyGraphChart.TabIndex = 2; 210 // 211 // inDegreeButton 212 // 213 this.inDegreeButton.AutoSize = true; 214 this.inDegreeButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 215 this.inDegreeButton.Location = new System.Drawing.Point(95, 3); 216 this.inDegreeButton.Name = "inDegreeButton"; 217 this.inDegreeButton.Size = new System.Drawing.Size(28, 23); 218 this.inDegreeButton.TabIndex = 6; 219 this.inDegreeButton.Text = "IN"; 220 this.inDegreeButton.UseVisualStyleBackColor = true; 221 this.inDegreeButton.Click += new System.EventHandler(this.inDegreeButton_Click); 222 // 223 // outDegreeButton 224 // 225 this.outDegreeButton.AutoSize = true; 226 this.outDegreeButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 227 this.outDegreeButton.Location = new System.Drawing.Point(129, 3); 228 this.outDegreeButton.Name = "outDegreeButton"; 229 this.outDegreeButton.Size = new System.Drawing.Size(40, 23); 230 this.outDegreeButton.TabIndex = 7; 231 this.outDegreeButton.Text = "OUT"; 232 this.outDegreeButton.UseVisualStyleBackColor = true; 233 this.outDegreeButton.Click += new System.EventHandler(this.outDegreeButton_Click); 206 234 // 207 235 // GenealogyGraphView … … 217 245 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 218 246 this.splitContainer.ResumeLayout(false); 219 this.topControlBox.ResumeLayout(false);220 this.topControlBox.PerformLayout();221 247 this.genealogyTableLayout.ResumeLayout(false); 222 248 this.graphControlsPanel.ResumeLayout(false); 223 249 this.graphControlsPanel.PerformLayout(); 250 this.topControlBox.ResumeLayout(false); 251 this.topControlBox.PerformLayout(); 224 252 this.ResumeLayout(false); 225 253 … … 240 268 private System.Windows.Forms.RadioButton moveModeButton; 241 269 private System.Windows.Forms.RadioButton zoomModeButton; 270 private System.Windows.Forms.Button inDegreeButton; 271 private System.Windows.Forms.Button outDegreeButton; 242 272 243 273 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
r7997 r8213 29 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; 30 30 using HeuristicLab.MainForm; 31 using HeuristicLab.Problems.DataAnalysis.Symbolic; 31 32 using HeuristicLab.Visualization; 32 33 … … 92 93 var genealogyGraphNode = (GenealogyGraphNode)visualGenealogyGraphNode.Data; 93 94 symbolicExpressionTreeChart.Tree = (ISymbolicExpressionTree)genealogyGraphNode.Data; 95 // highlight the relevant fragment in the symbolic expression tree 94 96 if (_selectedVisualSymbolicExpressionTreeNode != null) { 95 97 var nodes = symbolicExpressionTreeChart.Tree.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>; … … 140 142 var treeNode = _selectedVisualSymbolicExpressionTreeNode.SymbolicExpressionTreeNode; 141 143 Color[] colors = { Color.LightSkyBlue, Color.PaleGreen, Color.Tan }; 142 144 // update visual graph nodes 145 genealogyGraphChart.Chart.UpdateEnabled = false; 143 146 genealogyGraphChart.ClearAllNodes(); // clear node colors 144 147 // color each graph node according to the degree to which it matches the selected tree fragment … … 147 150 if (owners.Any()) genealogyGraphChart.HighlightNodes(owners, colors[i]); // highlight matching individuals from the genealogy 148 151 } 152 genealogyGraphChart.Chart.UpdateEnabled = true; 153 genealogyGraphChart.Chart.EnforceUpdate(); 149 154 150 155 // highlight subtree nodes in the tree chart … … 164 169 var owners = genealogyGraphChart.Graph.TraceFragment(treeNode, similarityModeSelector.SelectedIndex).ToList(); 165 170 if (owners.Any()) { 171 genealogyGraphChart.Chart.UpdateEnabled = false; 166 172 genealogyGraphChart.ClearAllNodes(); // clear the fill color of all nodes 167 173 genealogyGraphChart.HighlightNodes(owners, Color.LightSkyBlue); // highlight matching individuals from the genealogy 174 genealogyGraphChart.Chart.UpdateEnabled = true; 168 175 } 176 genealogyGraphChart.Chart.EnforceUpdate(); 169 177 // highlight subtree nodes in the tree chart 170 178 foreach (var visualNode in symbolicExpressionTreeChart.Tree.IterateNodesPostfix().Select(node => symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node))) … … 174 182 } 175 183 #endregion 184 185 private void inDegreeButton_Click(object sender, EventArgs e) { 186 genealogyGraphChart.HighlightInDegree(); 187 } 188 189 private void outDegreeButton_Click(object sender, EventArgs e) { 190 genealogyGraphChart.HighlightOutDegree(); 191 } 176 192 } 177 193 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj
r7779 r8213 18 18 <DebugType>full</DebugType> 19 19 <Optimize>false</Optimize> 20 <OutputPath>..\..\..\..\ trunk\sources\bin\</OutputPath>20 <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath> 21 21 <DefineConstants>DEBUG;TRACE</DefineConstants> 22 22 <ErrorReport>prompt</ErrorReport> … … 26 26 <DebugType>pdbonly</DebugType> 27 27 <Optimize>true</Optimize> 28 <OutputPath>..\..\..\..\ trunk\sources\bin\</OutputPath>28 <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath> 29 29 <DefineConstants>TRACE</DefineConstants> 30 30 <ErrorReport>prompt</ErrorReport> … … 67 67 <SpecificVersion>False</SpecificVersion> 68 68 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 69 </Reference>70 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">71 <SpecificVersion>False</SpecificVersion>72 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>73 69 </Reference> 74 70 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> … … 118 114 <Name>HeuristicLab.EvolutionaryTracking-3.4</Name> 119 115 </ProjectReference> 116 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 117 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> 118 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name> 119 </ProjectReference> 120 120 </ItemGroup> 121 121 <ItemGroup> … … 123 123 </ItemGroup> 124 124 <ItemGroup> 125 <EmbeddedResource Include="GenealogyGraphView.resx"> 126 <DependentUpon>GenealogyGraphView.cs</DependentUpon> 127 </EmbeddedResource> 125 128 <EmbeddedResource Include="Properties\Resources.resx"> 126 129 <Generator>ResXFileCodeGenerator</Generator> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/Plugin.cs
r7779 r8213 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 22 using HeuristicLab.PluginInfrastructure; 26 23 … … 28 25 [Plugin("HeuristicLab.EvolutionaryTracking.Views", "Provides controls and views for the evolution graph and related structures.", "3.4.2.7439")] 29 26 [PluginFile("HeuristicLab.EvolutionaryTracking.Views-3.4.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Collections", "3.3")]31 [PluginDependency("HeuristicLab.Common", "3.3")]32 27 [PluginDependency("HeuristicLab.Core", "3.3")] 33 [PluginDependency("HeuristicLab. Data", "3.3")]28 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 34 29 [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")] 35 [PluginDependency("HeuristicLab.Operators", "3.3")] 36 [PluginDependency("HeuristicLab.Optimization", "3.3")] 37 [PluginDependency("HeuristicLab.Parameters", "3.3")] 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] 30 [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.4")] 31 [PluginDependency("HeuristicLab.MainForm", "3.3")] 32 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 33 [PluginDependency("HeuristicLab.Visualization", "3.3")] 34 [PluginDependency("HeuristicLab.EvolutionaryTracking", "3.4")] 35 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")] 36 39 37 public class HeuristicLabEvolutionaryTrackingPlugin : PluginBase { 40 38 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/Properties
-
Property
svn:ignore
set to
AssemblyInfo.cs
-
Property
svn:ignore
set to
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphArc.cs
r7779 r8213 25 25 26 26 namespace HeuristicLab.EvolutionaryTracking.Views { 27 class VisualGenealogyGraphArc : Line {27 public class VisualGenealogyGraphArc : Line { 28 28 public VisualGenealogyGraphNode Source; 29 29 public VisualGenealogyGraphNode Target; -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs
r7779 r8213 28 28 public class VisualGenealogyGraphNode : Ellipse { 29 29 public GenealogyGraphNode Data { get; internal set; } 30 internal List<VisualGenealogyGraphArc> IncomingArcs = new List<VisualGenealogyGraphArc>(); 31 internal List<VisualGenealogyGraphArc> OutgoingArcs = new List<VisualGenealogyGraphArc>(); 30 private List<VisualGenealogyGraphArc> _incomingArcs = new List<VisualGenealogyGraphArc>(); 31 private List<VisualGenealogyGraphArc> _outgoingArgs = new List<VisualGenealogyGraphArc>(); 32 33 public List<VisualGenealogyGraphArc> IncomingArcs { 34 get { return _incomingArcs; } 35 set { _incomingArcs = value; } 36 } 37 public List<VisualGenealogyGraphArc> OutgoingArcs { 38 get { return _outgoingArgs; } 39 set { _outgoingArgs = value; } 40 } 32 41 33 42 public VisualGenealogyGraphNode(IChart chart, PointD lowerLeft, PointD upperRight)
Note: See TracChangeset
for help on using the changeset viewer.