Changeset 11852 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4
- Timestamp:
- 02/01/15 23:17:56 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
r11817 r11852 40 40 private readonly Pen defaultPen; 41 41 42 private Dictionary<IGenealogyGraphNode, VisualGenealogyGraphNode> nodeMap; 43 private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> arcMap; 44 42 45 public IGenealogyGraph GenealogyGraph { 43 46 get { return genealogyGraph; } … … 63 66 } 64 67 65 private Dictionary<IGenealogyGraphNode, VisualGenealogyGraphNode> nodeMap; 66 private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> arcMap; 68 public bool UpdateEnabled { 69 get { return Chart.UpdateEnabled; } 70 set { Chart.UpdateEnabled = value; } 71 } 72 73 public void EnforceUpdate() { 74 Chart.EnforceUpdate(); 75 } 67 76 68 77 #region chart modes … … 225 234 226 235 // update 227 Chart.UpdateEnabled = true;228 Chart.EnforceUpdate();236 UpdateEnabled = true; 237 EnforceUpdate(); 229 238 230 239 if (SelectedVisualNode != null) 231 /* emit clicked event */ 232 OnGenealogyGraphNodeClicked(SelectedVisualNode, e); 240 OnGenealogyGraphNodeClicked(SelectedVisualNode, e); // emit clicked event 233 241 234 242 base.pictureBox_MouseUp(sender, e); … … 306 314 } 307 315 316 public void ClearArcs() { 317 foreach (var primitive in Chart.Group.Primitives.OfType<VisualGenealogyGraphArc>()) { 318 primitive.Pen = Pens.Transparent; 319 } 320 } 321 322 public void ClearNodes() { 323 foreach (var primitive in Chart.Group.Primitives.OfType<VisualGenealogyGraphNode>()) { 324 primitive.Brush = new SolidBrush(Color.Transparent); 325 primitive.Pen = new Pen(Color.LightGray); 326 } 327 } 328 308 329 public virtual void ClearPrimitives() { 309 330 foreach (var primitive in Chart.Group.Primitives) { … … 313 334 primitive.Brush = new SolidBrush(Color.Transparent); 314 335 primitive.Pen = new Pen(Color.DarkGray); 315 } 316 } 317 } 318 319 public void HighlightNodes(IEnumerable<IGenealogyGraphNode> nodes) { 320 Chart.UpdateEnabled = false; 321 ClearPrimitives(); 336 // primitive.Pen = Pens.Transparent; // remove the node contour 337 } 338 } 339 } 340 341 public void HighlightNodes(IEnumerable<IGenealogyGraphNode> nodes, bool clearPrimitives = true) { 342 if (clearPrimitives) 343 ClearPrimitives(); 344 322 345 foreach (var node in nodes) { 323 346 var graphNode = GetMappedNode(node); 324 347 graphNode.Brush = new SolidBrush(node.GetColor()); 325 348 } 326 Chart.UpdateEnabled = true; 327 Chart.EnforceUpdate(); 349 } 350 351 public void HighlightNodes(IEnumerable<IGenealogyGraphNode> nodes, Color color, bool clearPrimitives = true) { 352 if (clearPrimitives) 353 ClearPrimitives(); 354 355 foreach (var node in nodes.Select(GetMappedNode)) { 356 node.Brush = new SolidBrush(color); 357 } 328 358 } 329 359 330 360 public void HighlightAll() { 331 Chart.UpdateEnabled = false;332 361 foreach (var visualNode in nodeMap.Values) { 333 362 visualNode.Brush = new SolidBrush(visualNode.Data.GetColor()); … … 340 369 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 341 370 } 342 Chart.UpdateEnabled = true;343 Chart.EnforceUpdate();344 371 } 345 372 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs
r11817 r11852 26 26 private void InitializeComponent() { 27 27 this.splitContainer = new System.Windows.Forms.SplitContainer(); 28 this.genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart(); 28 29 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 29 30 this.groupBox = new System.Windows.Forms.GroupBox(); … … 31 32 this.simpleLineages_checkBox = new System.Windows.Forms.CheckBox(); 32 33 this.trace_checkBox = new System.Windows.Forms.CheckBox(); 33 this. genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart();34 this.openNew_CheckBox = new System.Windows.Forms.CheckBox(); 34 35 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 35 36 this.splitContainer.Panel1.SuspendLayout(); … … 58 59 this.splitContainer.TabIndex = 0; 59 60 // 61 // genealogyGraphChart 62 // 63 this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 64 | System.Windows.Forms.AnchorStyles.Left) 65 | System.Windows.Forms.AnchorStyles.Right))); 66 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control; 67 this.genealogyGraphChart.GenealogyGraph = null; 68 this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0); 69 this.genealogyGraphChart.LockGenealogy = false; 70 this.genealogyGraphChart.Name = "genealogyGraphChart"; 71 this.genealogyGraphChart.ScaleOnResize = true; 72 this.genealogyGraphChart.SimpleLineages = false; 73 this.genealogyGraphChart.Size = new System.Drawing.Size(689, 738); 74 this.genealogyGraphChart.TabIndex = 0; 75 this.genealogyGraphChart.TraceFragments = false; 76 this.genealogyGraphChart.UpdateEnabled = true; 77 // 60 78 // viewHost 61 79 // … … 77 95 // groupBox 78 96 // 97 this.groupBox.Controls.Add(this.openNew_CheckBox); 79 98 this.groupBox.Controls.Add(this.lockGraph_checkBox); 80 99 this.groupBox.Controls.Add(this.simpleLineages_checkBox); … … 123 142 this.trace_checkBox.CheckedChanged += new System.EventHandler(this.trace_checkBox_CheckedChanged); 124 143 // 125 // genealogyGraphChart144 // openNew_CheckBox 126 145 // 127 this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 128 | System.Windows.Forms.AnchorStyles.Left) 129 | System.Windows.Forms.AnchorStyles.Right))); 130 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control; 131 this.genealogyGraphChart.GenealogyGraph = null; 132 this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0); 133 this.genealogyGraphChart.LockGenealogy = false; 134 this.genealogyGraphChart.Name = "genealogyGraphChart"; 135 this.genealogyGraphChart.ScaleOnResize = true; 136 this.genealogyGraphChart.SimpleLineages = false; 137 this.genealogyGraphChart.Size = new System.Drawing.Size(689, 738); 138 this.genealogyGraphChart.TabIndex = 0; 139 this.genealogyGraphChart.TraceFragments = false; 146 this.openNew_CheckBox.AutoSize = true; 147 this.openNew_CheckBox.Location = new System.Drawing.Point(237, 20); 148 this.openNew_CheckBox.Name = "openNew_CheckBox"; 149 this.openNew_CheckBox.Size = new System.Drawing.Size(111, 17); 150 this.openNew_CheckBox.TabIndex = 1; 151 this.openNew_CheckBox.Text = "Open in new view"; 152 this.openNew_CheckBox.UseVisualStyleBackColor = true; 140 153 // 141 154 // GenealogyGraphView … … 166 179 protected System.Windows.Forms.CheckBox simpleLineages_checkBox; 167 180 protected System.Windows.Forms.CheckBox lockGraph_checkBox; 181 protected System.Windows.Forms.CheckBox openNew_CheckBox; 168 182 169 183 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj
r11639 r11852 129 129 <None Include="HeuristicLab.snk" /> 130 130 </ItemGroup> 131 <ItemGroup> 132 <EmbeddedResource Include="GenealogyGraphView.resx"> 133 <DependentUpon>GenealogyGraphView.cs</DependentUpon> 134 </EmbeddedResource> 135 </ItemGroup> 131 136 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 132 137 <PropertyGroup>
Note: See TracChangeset
for help on using the changeset viewer.