Changeset 2687 for trunk/sources/HeuristicLab.Core.Views/3.3
- Timestamp:
- 01/27/10 03:55:16 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.Designer.cs
r2676 r2687 48 48 this.executionTimeTextBox = new System.Windows.Forms.TextBox(); 49 49 this.executionTimeLabel = new System.Windows.Forms.Label(); 50 this.splitContainer = new System.Windows.Forms.SplitContainer();51 50 this.operatorGraphView = new HeuristicLab.Core.Views.OperatorGraphView(); 52 51 this.scopeView = new HeuristicLab.Core.Views.ScopeView(); … … 55 54 this.startButton = new System.Windows.Forms.Button(); 56 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 57 this.splitContainer.Panel1.SuspendLayout(); 58 this.splitContainer.Panel2.SuspendLayout(); 59 this.splitContainer.SuspendLayout(); 56 this.tabControl = new System.Windows.Forms.TabControl(); 57 this.operatorGraphTabPage = new System.Windows.Forms.TabPage(); 58 this.globalScopeTabPage = new System.Windows.Forms.TabPage(); 59 this.tabControl.SuspendLayout(); 60 this.operatorGraphTabPage.SuspendLayout(); 61 this.globalScopeTabPage.SuspendLayout(); 60 62 this.SuspendLayout(); 61 63 // … … 63 65 // 64 66 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 65 this.executionTimeTextBox.Location = new System.Drawing.Point(6 55, 620);67 this.executionTimeTextBox.Location = new System.Drawing.Point(661, 620); 66 68 this.executionTimeTextBox.Name = "executionTimeTextBox"; 67 69 this.executionTimeTextBox.ReadOnly = true; 68 70 this.executionTimeTextBox.Size = new System.Drawing.Size(141, 20); 69 this.executionTimeTextBox.TabIndex = 4;71 this.executionTimeTextBox.TabIndex = 5; 70 72 // 71 73 // executionTimeLabel … … 73 75 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 74 76 this.executionTimeLabel.AutoSize = true; 75 this.executionTimeLabel.Location = new System.Drawing.Point(5 66, 623);77 this.executionTimeLabel.Location = new System.Drawing.Point(572, 623); 76 78 this.executionTimeLabel.Name = "executionTimeLabel"; 77 79 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13); 78 this.executionTimeLabel.TabIndex = 3;80 this.executionTimeLabel.TabIndex = 4; 79 81 this.executionTimeLabel.Text = "&Execution Time:"; 80 //81 // splitContainer82 //83 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)84 | System.Windows.Forms.AnchorStyles.Left)85 | System.Windows.Forms.AnchorStyles.Right)));86 this.splitContainer.Location = new System.Drawing.Point(0, 0);87 this.splitContainer.Name = "splitContainer";88 //89 // splitContainer.Panel190 //91 this.splitContainer.Panel1.Controls.Add(this.operatorGraphView);92 //93 // splitContainer.Panel294 //95 this.splitContainer.Panel2.Controls.Add(this.scopeView);96 this.splitContainer.Size = new System.Drawing.Size(802, 611);97 this.splitContainer.SplitterDistance = 401;98 this.splitContainer.TabIndex = 0;99 82 // 100 83 // operatorGraphView … … 105 88 this.operatorGraphView.Caption = "Operator Graph"; 106 89 this.operatorGraphView.Item = null; 107 this.operatorGraphView.Location = new System.Drawing.Point( 3, 3);90 this.operatorGraphView.Location = new System.Drawing.Point(6, 6); 108 91 this.operatorGraphView.Name = "operatorGraphView"; 109 92 this.operatorGraphView.Object = null; 110 93 this.operatorGraphView.OperatorGraph = null; 111 this.operatorGraphView.Size = new System.Drawing.Size( 395, 605);94 this.operatorGraphView.Size = new System.Drawing.Size(782, 573); 112 95 this.operatorGraphView.TabIndex = 0; 113 96 // … … 119 102 this.scopeView.Caption = "Scope"; 120 103 this.scopeView.Item = null; 121 this.scopeView.Location = new System.Drawing.Point( 3, 3);104 this.scopeView.Location = new System.Drawing.Point(6, 6); 122 105 this.scopeView.Name = "scopeView"; 123 106 this.scopeView.Object = null; 124 107 this.scopeView.Scope = null; 125 this.scopeView.Size = new System.Drawing.Size( 391, 605);108 this.scopeView.Size = new System.Drawing.Size(782, 573); 126 109 this.scopeView.TabIndex = 0; 127 110 // … … 130 113 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 131 114 this.resetButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Restart; 132 this.resetButton.Location = new System.Drawing.Point( 63, 617);115 this.resetButton.Location = new System.Drawing.Point(58, 617); 133 116 this.resetButton.Name = "resetButton"; 134 117 this.resetButton.Size = new System.Drawing.Size(23, 23); 135 this.resetButton.TabIndex = 2;118 this.resetButton.TabIndex = 3; 136 119 this.toolTip.SetToolTip(this.resetButton, "Reset Engine"); 137 120 this.resetButton.UseVisualStyleBackColor = true; … … 143 126 this.stopButton.Enabled = false; 144 127 this.stopButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop; 145 this.stopButton.Location = new System.Drawing.Point( 34, 617);128 this.stopButton.Location = new System.Drawing.Point(29, 617); 146 129 this.stopButton.Name = "stopButton"; 147 130 this.stopButton.Size = new System.Drawing.Size(23, 23); 148 this.stopButton.TabIndex = 1;131 this.stopButton.TabIndex = 2; 149 132 this.toolTip.SetToolTip(this.stopButton, "Stop Engine"); 150 133 this.stopButton.UseVisualStyleBackColor = true; … … 155 138 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 156 139 this.startButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Play; 157 this.startButton.Location = new System.Drawing.Point( 5, 617);140 this.startButton.Location = new System.Drawing.Point(0, 617); 158 141 this.startButton.Name = "startButton"; 159 142 this.startButton.Size = new System.Drawing.Size(23, 23); 160 this.startButton.TabIndex = 0;143 this.startButton.TabIndex = 1; 161 144 this.toolTip.SetToolTip(this.startButton, "Start Engine"); 162 145 this.startButton.UseVisualStyleBackColor = true; 163 146 this.startButton.Click += new System.EventHandler(this.startButton_Click); 164 147 // 148 // tabControl 149 // 150 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 151 | System.Windows.Forms.AnchorStyles.Left) 152 | System.Windows.Forms.AnchorStyles.Right))); 153 this.tabControl.Controls.Add(this.operatorGraphTabPage); 154 this.tabControl.Controls.Add(this.globalScopeTabPage); 155 this.tabControl.Location = new System.Drawing.Point(0, 0); 156 this.tabControl.Name = "tabControl"; 157 this.tabControl.SelectedIndex = 0; 158 this.tabControl.Size = new System.Drawing.Size(802, 611); 159 this.tabControl.TabIndex = 0; 160 // 161 // operatorGraphTabPage 162 // 163 this.operatorGraphTabPage.Controls.Add(this.operatorGraphView); 164 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22); 165 this.operatorGraphTabPage.Name = "operatorGraphTabPage"; 166 this.operatorGraphTabPage.Padding = new System.Windows.Forms.Padding(3); 167 this.operatorGraphTabPage.Size = new System.Drawing.Size(794, 585); 168 this.operatorGraphTabPage.TabIndex = 0; 169 this.operatorGraphTabPage.Text = "Operator Graph"; 170 this.operatorGraphTabPage.UseVisualStyleBackColor = true; 171 // 172 // globalScopeTabPage 173 // 174 this.globalScopeTabPage.Controls.Add(this.scopeView); 175 this.globalScopeTabPage.Location = new System.Drawing.Point(4, 22); 176 this.globalScopeTabPage.Name = "globalScopeTabPage"; 177 this.globalScopeTabPage.Padding = new System.Windows.Forms.Padding(3); 178 this.globalScopeTabPage.Size = new System.Drawing.Size(794, 585); 179 this.globalScopeTabPage.TabIndex = 1; 180 this.globalScopeTabPage.Text = "Global Scope"; 181 this.globalScopeTabPage.UseVisualStyleBackColor = true; 182 // 165 183 // EngineView 166 184 // 167 185 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 168 186 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 187 this.Controls.Add(this.tabControl); 169 188 this.Controls.Add(this.executionTimeTextBox); 170 189 this.Controls.Add(this.stopButton); 171 190 this.Controls.Add(this.executionTimeLabel); 172 this.Controls.Add(this.splitContainer);173 191 this.Controls.Add(this.resetButton); 174 192 this.Controls.Add(this.startButton); 175 193 this.Name = "EngineView"; 176 194 this.Size = new System.Drawing.Size(802, 640); 177 this. splitContainer.Panel1.ResumeLayout(false);178 this. splitContainer.Panel2.ResumeLayout(false);179 this. splitContainer.ResumeLayout(false);195 this.tabControl.ResumeLayout(false); 196 this.operatorGraphTabPage.ResumeLayout(false); 197 this.globalScopeTabPage.ResumeLayout(false); 180 198 this.ResumeLayout(false); 181 199 this.PerformLayout(); … … 187 205 protected System.Windows.Forms.TextBox executionTimeTextBox; 188 206 protected System.Windows.Forms.Label executionTimeLabel; 189 protected System.Windows.Forms.SplitContainer splitContainer;190 207 protected System.Windows.Forms.Button resetButton; 191 208 protected System.Windows.Forms.Button stopButton; … … 194 211 protected HeuristicLab.Core.Views.ScopeView scopeView; 195 212 protected System.Windows.Forms.ToolTip toolTip; 213 protected System.Windows.Forms.TabControl tabControl; 214 protected System.Windows.Forms.TabPage operatorGraphTabPage; 215 protected System.Windows.Forms.TabPage globalScopeTabPage; 196 216 197 217 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ScopeListView.cs
r2655 r2687 12 12 namespace HeuristicLab.Core.Views { 13 13 [Content(typeof(ScopeList), true)] 14 [Content(typeof(IObservableList< Scope>), true)]15 public partial class ScopeListView : ItemListView< Scope> {14 [Content(typeof(IObservableList<IScope>), true)] 15 public partial class ScopeListView : ItemListView<IScope> { 16 16 /// <summary> 17 17 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". … … 28 28 /// <remarks>Calls <see cref="VariablesScopeView()"/>.</remarks> 29 29 /// <param name="scope">The scope whose variables should be represented visually.</param> 30 public ScopeListView(IObservableList< Scope> scopeList)30 public ScopeListView(IObservableList<IScope> scopeList) 31 31 : this() { 32 32 ItemList = scopeList; -
trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs
r2676 r2687 38 38 [Content(typeof(Scope), true)] 39 39 public sealed partial class ScopeView : ItemView { 40 private Dictionary< Scope, TreeNode> scopeNodeTable;41 private Dictionary<ScopeList, Scope> subScopesScopeTable;40 private Dictionary<IScope, TreeNode> scopeNodeTable; 41 private Dictionary<ScopeList, IScope> subScopesScopeTable; 42 42 43 43 /// <summary> … … 46 46 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 47 47 /// No own data storage present.</remarks> 48 public Scope Scope {49 get { return ( Scope)Item; }48 public IScope Scope { 49 get { return (IScope)Item; } 50 50 set { base.Item = value; } 51 51 } … … 58 58 InitializeComponent(); 59 59 Caption = "Scope"; 60 scopeNodeTable = new Dictionary< Scope, TreeNode>();61 subScopesScopeTable = new Dictionary<ScopeList, Scope>();60 scopeNodeTable = new Dictionary<IScope, TreeNode>(); 61 subScopesScopeTable = new Dictionary<ScopeList, IScope>(); 62 62 63 63 } … … 67 67 /// <remarks>Calls <see cref="ScopeView()"/>.</remarks> 68 68 /// <param name="scope">The scope to represent visually.</param> 69 public ScopeView( Scope scope)69 public ScopeView(IScope scope) 70 70 : this() { 71 71 Scope = scope; … … 94 94 } 95 95 96 private TreeNode CreateTreeNode( Scope scope) {96 private TreeNode CreateTreeNode(IScope scope) { 97 97 TreeNode node = new TreeNode(); 98 98 node.Text = scope.Name; … … 101 101 scopeNodeTable.Add(scope, node); 102 102 scope.NameChanged += new EventHandler(Scope_NameChanged); 103 scope.SubScopes.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded);104 scope.SubScopes.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved);105 scope.SubScopes.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced);106 scope.SubScopes.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsMoved);107 scope.SubScopes.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset);103 scope.SubScopes.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded); 104 scope.SubScopes.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved); 105 scope.SubScopes.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced); 106 scope.SubScopes.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsMoved); 107 scope.SubScopes.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset); 108 108 subScopesScopeTable.Add(scope.SubScopes, scope); 109 109 if (scope.SubScopes.Count > 0) … … 116 116 RemoveTreeNode(child); 117 117 118 Scope scope = node.Tag asScope;118 IScope scope = node.Tag as IScope; 119 119 if (scope != null) { 120 120 scopeNodeTable.Remove(scope); 121 121 scope.NameChanged -= new EventHandler(Scope_NameChanged); 122 scope.SubScopes.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded);123 scope.SubScopes.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved);124 scope.SubScopes.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced);125 scope.SubScopes.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsMoved);126 scope.SubScopes.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset);122 scope.SubScopes.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded); 123 scope.SubScopes.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved); 124 scope.SubScopes.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced); 125 scope.SubScopes.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsMoved); 126 scope.SubScopes.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset); 127 127 subScopesScopeTable.Remove(scope.SubScopes); 128 128 } … … 132 132 private void scopesTreeView_MouseDown(object sender, MouseEventArgs e) { 133 133 TreeNode node = scopesTreeView.GetNodeAt(e.X, e.Y); 134 if ((node != null) && (node.Tag is Scope)) {135 variableCollectionView.NamedItemCollection = (( Scope)node.Tag).Variables;134 if ((node != null) && (node.Tag is IScope)) { 135 variableCollectionView.NamedItemCollection = ((IScope)node.Tag).Variables; 136 136 variableCollectionView.Enabled = true; 137 137 } else { … … 143 143 private void scopesTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) { 144 144 TreeNode node = e.Node; 145 Scope scope = (Scope)node.Tag;145 IScope scope = (IScope)node.Tag; 146 146 147 147 node.Nodes.Clear(); … … 151 151 private void scopesTreeView_AfterCollapse(object sender, System.Windows.Forms.TreeViewEventArgs e) { 152 152 TreeNode node = e.Node; 153 Scope scope = (Scope)node.Tag;153 IScope scope = (IScope)node.Tag; 154 154 155 155 if (node.Nodes.Count > 0) { … … 162 162 private void scopesTreeView_ItemDrag(object sender, ItemDragEventArgs e) { 163 163 TreeNode node = (TreeNode)e.Item; 164 Scope scope = node.Tag asScope;164 IScope scope = node.Tag as IScope; 165 165 if (scope != null) { 166 166 DataObject data = new DataObject(); … … 177 177 Invoke(new EventHandler(Scope_NameChanged), sender, e); 178 178 else { 179 Scope scope = (Scope)sender;179 IScope scope = (IScope)sender; 180 180 scopeNodeTable[scope].Text = scope.Name; 181 181 } … … 184 184 185 185 #region SubScopes Events 186 private void SubScopes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {187 if (InvokeRequired) 188 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded), sender, e);189 else { 190 Scope parentScope = subScopesScopeTable[(ScopeList)sender];191 TreeNode parentNode = scopeNodeTable[parentScope]; 192 if (parentNode.IsExpanded) { 193 foreach (IndexedItem< Scope> item in e.Items) {186 private void SubScopes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 187 if (InvokeRequired) 188 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded), sender, e); 189 else { 190 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 191 TreeNode parentNode = scopeNodeTable[parentScope]; 192 if (parentNode.IsExpanded) { 193 foreach (IndexedItem<IScope> item in e.Items) { 194 194 TreeNode node = CreateTreeNode(item.Value); 195 195 parentNode.Nodes.Insert(item.Index, node); … … 200 200 } 201 201 } 202 private void SubScopes_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {203 if (InvokeRequired) 204 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved), sender, e);205 else { 206 Scope parentScope = subScopesScopeTable[(ScopeList)sender];207 TreeNode parentNode = scopeNodeTable[parentScope]; 208 if (parentNode.IsExpanded) { 209 foreach (IndexedItem< Scope> item in e.Items) {202 private void SubScopes_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 203 if (InvokeRequired) 204 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved), sender, e); 205 else { 206 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 207 TreeNode parentNode = scopeNodeTable[parentScope]; 208 if (parentNode.IsExpanded) { 209 foreach (IndexedItem<IScope> item in e.Items) { 210 210 TreeNode node = scopeNodeTable[item.Value]; 211 211 RemoveTreeNode(node); … … 217 217 } 218 218 } 219 private void SubScopes_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {220 if (InvokeRequired) 221 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced), sender, e);222 else { 223 Scope parentScope = subScopesScopeTable[(ScopeList)sender];224 TreeNode parentNode = scopeNodeTable[parentScope]; 225 if (parentNode.IsExpanded) { 226 foreach (IndexedItem< Scope> item in e.Items) {219 private void SubScopes_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 220 if (InvokeRequired) 221 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced), sender, e); 222 else { 223 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 224 TreeNode parentNode = scopeNodeTable[parentScope]; 225 if (parentNode.IsExpanded) { 226 foreach (IndexedItem<IScope> item in e.Items) { 227 227 TreeNode node = parentNode.Nodes[item.Index]; 228 228 RemoveTreeNode(node); … … 234 234 } 235 235 } 236 private void SubScopes_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {237 if (InvokeRequired) 238 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsMoved), sender, e);239 else { 240 Scope parentScope = subScopesScopeTable[(ScopeList)sender];241 TreeNode parentNode = scopeNodeTable[parentScope]; 242 if (parentNode.IsExpanded) { 243 parentNode.Nodes.Clear(); 244 foreach (IndexedItem< Scope> item in e.Items)236 private void SubScopes_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 237 if (InvokeRequired) 238 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsMoved), sender, e); 239 else { 240 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 241 TreeNode parentNode = scopeNodeTable[parentScope]; 242 if (parentNode.IsExpanded) { 243 parentNode.Nodes.Clear(); 244 foreach (IndexedItem<IScope> item in e.Items) 245 245 parentNode.Nodes.Insert(item.Index, scopeNodeTable[item.Value]); 246 246 } 247 247 } 248 248 } 249 private void SubScopes_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {250 if (InvokeRequired) 251 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset), sender, e);252 else { 253 Scope parentScope = subScopesScopeTable[(ScopeList)sender];249 private void SubScopes_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 250 if (InvokeRequired) 251 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset), sender, e); 252 else { 253 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 254 254 TreeNode parentNode = scopeNodeTable[parentScope]; 255 255 if (parentNode.IsExpanded) { … … 257 257 RemoveTreeNode(node); 258 258 parentNode.Nodes.Clear(); 259 foreach (IndexedItem< Scope> item in e.Items) {259 foreach (IndexedItem<IScope> item in e.Items) { 260 260 TreeNode node = CreateTreeNode(item.Value); 261 261 parentNode.Nodes.Insert(item.Index, node); -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableCollectionView.cs
r2655 r2687 12 12 namespace HeuristicLab.Core.Views { 13 13 [Content(typeof(VariableCollection), true)] 14 [Content(typeof(IObservableKeyedCollection<string, Variable>), true)]15 public partial class VariableCollectionView : NamedItemCollectionView< Variable> {14 [Content(typeof(IObservableKeyedCollection<string, IVariable>), true)] 15 public partial class VariableCollectionView : NamedItemCollectionView<IVariable> { 16 16 /// <summary> 17 17 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". … … 28 28 /// <remarks>Calls <see cref="VariablesScopeView()"/>.</remarks> 29 29 /// <param name="scope">The scope whose variables should be represented visually.</param> 30 public VariableCollectionView(IObservableKeyedCollection<string, Variable> variableCollection)30 public VariableCollectionView(IObservableKeyedCollection<string, IVariable> variableCollection) 31 31 : this() { 32 32 NamedItemCollection = variableCollection; 33 33 } 34 35 protected override IVariable CreateItem() { 36 IVariable item = new Variable(); 37 item.Name = GetUniqueName(item.Name); 38 return item; 39 } 34 40 } 35 41 } -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs
r2676 r2687 65 65 66 66 /// <summary> 67 /// Removes the eventhandlers from the underlying <see cref=" IVariable"/>.67 /// Removes the eventhandlers from the underlying <see cref="Variable"/>. 68 68 /// </summary> 69 69 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> … … 74 74 75 75 /// <summary> 76 /// Adds eventhandlers to the underlying <see cref=" IVariable"/>.76 /// Adds eventhandlers to the underlying <see cref="Variable"/>. 77 77 /// </summary> 78 78 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> -
trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.Designer.cs
r2676 r2687 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.viewPanel = new System.Windows.Forms.Panel(); 48 49 this.messageLabel = new System.Windows.Forms.Label(); 49 this.view Label = new System.Windows.Forms.Label();50 this. viewComboBox = new System.Windows.Forms.ComboBox();50 this.viewsLabel = new System.Windows.Forms.Label(); 51 this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 51 52 this.SuspendLayout(); 52 53 // … … 56 57 | System.Windows.Forms.AnchorStyles.Left) 57 58 | System.Windows.Forms.AnchorStyles.Right))); 58 this.viewPanel.Location = new System.Drawing.Point(0, 27);59 this.viewPanel.Location = new System.Drawing.Point(0, 0); 59 60 this.viewPanel.Name = "viewPanel"; 60 this.viewPanel.Size = new System.Drawing.Size(2 27, 157);61 this.viewPanel.Size = new System.Drawing.Size(205, 184); 61 62 this.viewPanel.TabIndex = 2; 62 63 // … … 71 72 this.messageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 72 73 // 73 // view Label74 // viewsLabel 74 75 // 75 this.viewLabel.AutoSize = true; 76 this.viewLabel.Location = new System.Drawing.Point(3, 3); 77 this.viewLabel.Name = "viewLabel"; 78 this.viewLabel.Size = new System.Drawing.Size(33, 13); 79 this.viewLabel.TabIndex = 0; 80 this.viewLabel.Text = "&View:"; 76 this.viewsLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 77 this.viewsLabel.ContextMenuStrip = this.contextMenuStrip; 78 this.viewsLabel.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Windows; 79 this.viewsLabel.Location = new System.Drawing.Point(211, 0); 80 this.viewsLabel.Name = "viewsLabel"; 81 this.viewsLabel.Size = new System.Drawing.Size(16, 16); 82 this.viewsLabel.TabIndex = 0; 81 83 // 82 // viewComboBox84 // contextMenuStrip 83 85 // 84 this.viewComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 85 | System.Windows.Forms.AnchorStyles.Right))); 86 this.viewComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 87 this.viewComboBox.FormattingEnabled = true; 88 this.viewComboBox.Location = new System.Drawing.Point(42, 0); 89 this.viewComboBox.Name = "viewComboBox"; 90 this.viewComboBox.Size = new System.Drawing.Size(185, 21); 91 this.viewComboBox.TabIndex = 1; 92 this.viewComboBox.SelectedIndexChanged += new System.EventHandler(this.viewComboBox_SelectedIndexChanged); 86 this.contextMenuStrip.Name = "contextMenuStrip"; 87 this.contextMenuStrip.ShowCheckMargin = true; 88 this.contextMenuStrip.ShowImageMargin = false; 89 this.contextMenuStrip.Size = new System.Drawing.Size(61, 4); 90 this.contextMenuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip_ItemClicked); 93 91 // 94 92 // ViewHost … … 96 94 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 97 95 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 98 this.Controls.Add(this.viewComboBox);99 this.Controls.Add(this.viewLabel);100 96 this.Controls.Add(this.viewPanel); 97 this.Controls.Add(this.viewsLabel); 101 98 this.Controls.Add(this.messageLabel); 102 99 this.Name = "ViewHost"; 103 100 this.Size = new System.Drawing.Size(227, 184); 104 101 this.ResumeLayout(false); 105 this.PerformLayout();106 102 107 103 } … … 110 106 111 107 protected System.Windows.Forms.Panel viewPanel; 112 protected System.Windows.Forms.Label viewLabel; 113 protected System.Windows.Forms.ComboBox viewComboBox; 108 protected System.Windows.Forms.Label viewsLabel; 114 109 protected System.Windows.Forms.Label messageLabel; 110 protected System.Windows.Forms.ContextMenuStrip contextMenuStrip; 115 111 116 112 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs
r2684 r2687 32 32 namespace HeuristicLab.Core.Views { 33 33 public partial class ViewHost : UserControl { 34 private Dictionary<Type, ToolStripMenuItem> typeMenuItemTable; 35 34 36 private object obj; 35 37 public object Object { … … 44 46 45 47 public ViewHost() { 48 typeMenuItemTable = new Dictionary<Type, ToolStripMenuItem>(); 46 49 InitializeComponent(); 47 50 Initialize(); … … 49 52 50 53 protected virtual void Initialize() { 51 viewLabel.Visible = false; 52 viewComboBox.Items.Clear(); 53 viewComboBox.Enabled = false; 54 viewComboBox.Visible = false; 54 viewsLabel.Enabled = false; 55 viewsLabel.Visible = false; 56 typeMenuItemTable.Clear(); 57 contextMenuStrip.Items.Clear(); 58 contextMenuStrip.Enabled = false; 55 59 messageLabel.Visible = false; 56 60 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose(); … … 63 67 orderby t.Name ascending 64 68 select t; 65 foreach (Type viewType in viewTypes) 66 viewComboBox.Items.Add(viewType); 67 if (viewComboBox.Items.Count == 0) { 69 foreach (Type viewType in viewTypes) { 70 ToolStripMenuItem item = new ToolStripMenuItem(viewType.Name); 71 item.Name = viewType.FullName; 72 item.ToolTipText = viewType.FullName; 73 item.Tag = viewType; 74 contextMenuStrip.Items.Add(item); 75 typeMenuItemTable.Add(viewType, item); 76 } 77 if (contextMenuStrip.Items.Count == 0) { 68 78 messageLabel.Visible = true; 69 79 } else { 70 view Label.Visible= true;71 view ComboBox.Enabled= true;72 viewComboBox.Visible= true;80 viewsLabel.Enabled = true; 81 viewsLabel.Visible = true; 82 contextMenuStrip.Enabled = true; 73 83 messageLabel.Visible = false; 74 84 } … … 81 91 viewPanel.Enabled = true; 82 92 viewPanel.Visible = true; 83 viewComboBox.SelectedItem = view.GetType(); 93 typeMenuItemTable[view.GetType()].Checked = true; 94 typeMenuItemTable[view.GetType()].Enabled = false; 84 95 } 85 96 } 86 97 } 87 98 88 protected virtual void viewComboBox_SelectedIndexChanged(object sender, EventArgs e) { 89 if (viewComboBox.SelectedItem != viewPanel.Tag) { 90 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose(); 91 viewPanel.Controls.Clear(); 92 Control view = (Control)MainFormManager.CreateView((Type)viewComboBox.SelectedItem, Object); 93 viewPanel.Controls.Add(view); 94 viewPanel.Tag = view; 95 view.Dock = DockStyle.Fill; 99 protected void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { 100 Type viewType = (Type)e.ClickedItem.Tag; 101 foreach (ToolStripMenuItem item in typeMenuItemTable.Values) { 102 item.Checked = false; 103 item.Enabled = true; 96 104 } 105 typeMenuItemTable[viewType].Checked = true; 106 typeMenuItemTable[viewType].Enabled = false; 107 108 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose(); 109 viewPanel.Controls.Clear(); 110 Control view = (Control)MainFormManager.CreateView(viewType, Object); 111 viewPanel.Controls.Add(view); 112 viewPanel.Tag = view; 113 view.Dock = DockStyle.Fill; 97 114 } 98 115 }
Note: See TracChangeset
for help on using the changeset viewer.