Changeset 3135
- Timestamp:
- 03/20/10 02:35:09 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs
r3105 r3135 70 70 parametersOperatorTable = new Dictionary<IObservableKeyedCollection<string, IParameter>, IOperator>(); 71 71 Caption = "Operator"; 72 imageList.Images.Add("Default", HeuristicLab.Common.Resources.VS2008ImageLibrary.Method);73 72 } 74 73 /// <summary> … … 120 119 opParamNodeTable[opParam].Add(node); 121 120 122 IOperator op = opParam.Value; 123 if (op == null) 121 FillTreeNode(node, opParam.Value); 122 return node; 123 } 124 private void FillTreeNode(TreeNode node, IOperator op) { 125 if (op == null) { 126 if (!graphTreeView.ImageList.Images.ContainsKey("Default")) 127 graphTreeView.ImageList.Images.Add("Default", HeuristicLab.Common.Resources.VS2008ImageLibrary.Method); 128 124 129 node.Text += "-"; 125 else126 FillTreeNode(node, op);127 128 return node;129 }130 private void FillTreeNode(TreeNode node, IOperator op) {131 if (!graphTreeView.ImageList.Images.ContainsKey(op.GetType().FullName))132 graphTreeView.ImageList.Images.Add(op.GetType().FullName, op.ItemImage); 133 134 node.Text += op.Name;135 node.ToolTipText = op.ItemName + ": " + op.ItemDescription;136 node.ImageIndex = graphTreeView.ImageList.Images.IndexOfKey(op.GetType().FullName);137 node.SelectedImageIndex = node.ImageIndex;138 SetOperatorTag(node, op); 139 140 if (!operatorNodeTable.ContainsKey(op)) {141 operatorNodeTable.Add(op, new List<TreeNode>());142 op.NameChanged += new EventHandler(op_NameChanged);143 op.BreakpointChanged += new EventHandler(op_BreakpointChanged);144 parametersOperatorTable.Add(op.Parameters, op);145 op.Parameters.ItemsAdded += new CollectionItemsChangedEventHandler<IParameter>(Parameters_ItemsAdded);146 op.Parameters.ItemsRemoved += new CollectionItemsChangedEventHandler<IParameter>(Parameters_ItemsRemoved);147 op.Parameters.ItemsReplaced += new CollectionItemsChangedEventHandler<IParameter>(Parameters_ItemsReplaced);148 op.Parameters.CollectionReset += new CollectionItemsChangedEventHandler<IParameter>(Parameters_CollectionReset);149 }150 operatorNodeTable[op].Add(node); 151 152 if (op.Breakpoint)153 node.ForeColor = Color.Red; 154 155 foreach (IParameter param in op.Parameters) {156 if (param is IValueParameter<IOperator>)157 node.Nodes.Add(new TreeNode());158 }159 node.Collapse();130 node.ToolTipText = ""; 131 node.ImageIndex = graphTreeView.ImageList.Images.IndexOfKey("Default"); ; 132 node.SelectedImageIndex = node.ImageIndex; 133 node.ForeColor = graphTreeView.ForeColor; 134 } else { 135 if (!graphTreeView.ImageList.Images.ContainsKey(op.GetType().FullName)) 136 graphTreeView.ImageList.Images.Add(op.GetType().FullName, op.ItemImage); 137 138 node.Text += op.Name; 139 node.ToolTipText = op.ItemName + ": " + op.ItemDescription; 140 node.ImageIndex = graphTreeView.ImageList.Images.IndexOfKey(op.GetType().FullName); 141 node.SelectedImageIndex = node.ImageIndex; 142 SetOperatorTag(node, op); 143 144 if (!operatorNodeTable.ContainsKey(op)) { 145 operatorNodeTable.Add(op, new List<TreeNode>()); 146 op.NameChanged += new EventHandler(op_NameChanged); 147 op.BreakpointChanged += new EventHandler(op_BreakpointChanged); 148 parametersOperatorTable.Add(op.Parameters, op); 149 op.Parameters.ItemsAdded += new CollectionItemsChangedEventHandler<IParameter>(Parameters_ItemsAdded); 150 op.Parameters.ItemsRemoved += new CollectionItemsChangedEventHandler<IParameter>(Parameters_ItemsRemoved); 151 op.Parameters.ItemsReplaced += new CollectionItemsChangedEventHandler<IParameter>(Parameters_ItemsReplaced); 152 op.Parameters.CollectionReset += new CollectionItemsChangedEventHandler<IParameter>(Parameters_CollectionReset); 153 } 154 operatorNodeTable[op].Add(node); 155 156 if (op.Breakpoint) node.ForeColor = Color.Red; 157 else node.ForeColor = graphTreeView.ForeColor; 158 159 foreach (IParameter param in op.Parameters) { 160 if (param is IValueParameter<IOperator>) 161 node.Nodes.Add(new TreeNode()); 162 } 163 node.Collapse(); 164 } 160 165 } 161 166 private void ClearTreeNode(TreeNode node) { … … 223 228 foreach (TreeNode node in opParamNodeTable[opParam]) { 224 229 node.Text = opParam.Name + ": "; 225 if (opParam.Value == null) 226 node.Text += "-"; 227 else 228 FillTreeNode(node, opParam.Value); 230 FillTreeNode(node, opParam.Value); 229 231 } 230 232 }
Note: See TracChangeset
for help on using the changeset viewer.