Changeset 11086 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
- Timestamp:
- 07/04/14 13:38:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
r10561 r11086 83 83 protected override void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) { 84 84 currSelected = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; ; 85 if (currSelected != null) {86 currSelected.LineColor = Color.FromArgb(130, currSelected.LineColor);87 RepaintNode(currSelected);88 }89 85 base.OnSymbolicExpressionTreeNodeClicked(sender, e); 90 }91 92 protected override void SymbolicExpressionTreeChart_MouseClick(object sender, MouseEventArgs e) {93 if (currSelected != null) {94 currSelected.LineColor = Color.FromArgb(255, currSelected.LineColor);95 RepaintNode(currSelected);96 }97 base.SymbolicExpressionTreeChart_MouseClick(sender, e);98 86 } 99 87 … … 108 96 109 97 using (var dialog = new InsertNodeDialog()) { 110 dialog.SetAllowedSymbols(parent.Grammar. AllowedSymbols.Where(s => s.Enabled && s.InitialFrequency > 0.0 && !(s is ProgramRootSymbol || s is StartSymbol || s is Defun)));98 dialog.SetAllowedSymbols(parent.Grammar.Symbols.Where(s => !(s is ProgramRootSymbol || s is StartSymbol || s is Defun))); // allow everything 111 99 dialog.ShowDialog(this); 112 100 if (dialog.DialogResult != DialogResult.OK) return; … … 172 160 foreach (var subtree in tempNode.IterateNodesPostfix()) { 173 161 var visualNode = GetVisualSymbolicExpressionTreeNode(subtree); 174 visualNode.LineColor = Color. FromArgb(255, visualNode.LineColor); // reset the alpha value to 255175 visualNode.TextColor = Color. FromArgb(255, visualNode.TextColor);162 visualNode.LineColor = Color.Black; 163 visualNode.TextColor = Color.Black; 176 164 if (subtree.Parent != null) { 177 165 var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(subtree.Parent, subtree); 178 visualLine.LineColor = Color. FromArgb(255, visualLine.LineColor);166 visualLine.LineColor = Color.Black; 179 167 } 180 168 } … … 183 171 foreach (var node in tempNode.IterateNodesPostfix()) { 184 172 var visualNode = GetVisualSymbolicExpressionTreeNode(node); 185 visualNode.LineColor = Color. FromArgb(100, visualNode.LineColor);186 visualNode.TextColor = Color. FromArgb(100, visualNode.TextColor);173 visualNode.LineColor = Color.LightGray; 174 visualNode.TextColor = Color.LightGray; 187 175 foreach (var subtree in node.Subtrees) { 188 176 var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node, subtree); 189 visualLine.LineColor = Color. FromArgb(100, visualLine.LineColor);190 } 191 } 192 currSelected = null; 193 Repaint ();177 visualLine.LineColor = Color.LightGray; 178 } 179 } 180 currSelected = null; 181 RepaintNodes(); // no need to redo the layout and repaint everything since this operation does not change the tree 194 182 } 195 183 private void removeNodeToolStripMenuItem_Click(object sender, EventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.