- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r7582 r8331 31 31 [Content(typeof(OptimizerHiveTask), true)] 32 32 public partial class OptimizerHiveTaskView : HiveTaskView { 33 private Progress progress; 33 34 private ProgressView progressView; 34 35 … … 44 45 public OptimizerHiveTaskView() { 45 46 InitializeComponent(); 47 progress = new Progress() { 48 CanBeCanceled = false, 49 ProgressState = ProgressState.Finished 50 }; 46 51 } 47 52 … … 57 62 base.RegisterContentEvents(); 58 63 Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged); 64 progressView = new ProgressView(this, progress); 59 65 } 60 66 61 67 protected override void DeregisterContentEvents() { 62 68 Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged); 69 if (progressView != null) { 70 progressView.Content = null; 71 progressView.Dispose(); 72 progressView = null; 73 } 63 74 base.DeregisterContentEvents(); 64 75 } … … 74 85 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeTaskAsync); 75 86 task.ContinueWith((t) => { 76 FinishProgressView();87 progress.Finish(); 77 88 ErrorHandling.ShowErrorDialog(this, "An error occured while resuming the task.", t.Exception); 78 89 }, TaskContinuationOptions.OnlyOnFaulted); … … 82 93 var task = System.Threading.Tasks.Task.Factory.StartNew(PauseTaskAsync); 83 94 task.ContinueWith((t) => { 84 FinishProgressView();95 progress.Finish(); 85 96 ErrorHandling.ShowErrorDialog(this, "An error occured while pausing the task.", t.Exception); 86 97 }, TaskContinuationOptions.OnlyOnFaulted); … … 90 101 var task = System.Threading.Tasks.Task.Factory.StartNew(StopTaskAsync); 91 102 task.ContinueWith((t) => { 92 FinishProgressView();103 progress.Finish(); 93 104 ErrorHandling.ShowErrorDialog(this, "An error occured while stopping the task.", t.Exception); 94 105 }, TaskContinuationOptions.OnlyOnFaulted); … … 97 108 98 109 private void PauseTaskAsync() { 99 IProgress prog = new Progress(); 100 prog.Status = "Pausing task. Please be patient for the command to take effect."; 101 SetProgressView(prog); 110 progress.Status = "Pausing task. Please be patient for the command to take effect."; 111 progress.ProgressState = ProgressState.Started; 102 112 Content.Pause(); 103 FinishProgressView();113 progress.Finish(); 104 114 } 105 115 106 116 private void StopTaskAsync() { 107 IProgress prog = new Progress(); 108 prog.Status = "Stopping task. Please be patient for the command to take effect."; 109 SetProgressView(prog); 117 progress.Status = "Stopping task. Please be patient for the command to take effect."; 118 progress.ProgressState = ProgressState.Started; 110 119 Content.Stop(); 111 FinishProgressView();120 progress.Finish(); 112 121 } 113 122 114 123 private void ResumeTaskAsync() { 115 IProgress prog = new Progress(); 116 prog.Status = "Resuming task. Please be patient for the command to take effect."; 117 SetProgressView(prog); 124 progress.Status = "Resuming task. Please be patient for the command to take effect."; 125 progress.ProgressState = ProgressState.Started; 118 126 Content.Restart(); 119 FinishProgressView(); 120 } 121 122 private void SetProgressView(IProgress progress) { 123 if (InvokeRequired) { 124 Invoke(new Action<IProgress>(SetProgressView), progress); 125 } else { 126 if (progressView == null) { 127 progressView = new ProgressView(this, progress); 128 } else { 129 progressView.Progress = progress; 130 } 131 } 132 } 133 134 private void FinishProgressView() { 135 if (InvokeRequired) { 136 Invoke(new Action(FinishProgressView)); 137 } else { 138 if (progressView != null) { 139 progressView.Finish(); 140 progressView = null; 141 SetEnabledStateOfControls(); 142 } 143 } 127 progress.Finish(); 144 128 } 145 129 -
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views/3.3/Plugin.cs.frame
r7259 r8331 27 27 28 28 namespace HeuristicLab.Clients.Hive.Views { 29 [Plugin("HeuristicLab.Clients.Hive.Views", "3.3. 6.$WCREV$")]29 [Plugin("HeuristicLab.Clients.Hive.Views", "3.3.7.$WCREV$")] 30 30 [PluginFile("HeuristicLab.Clients.Hive.Views-3.3.dll", PluginFileType.Assembly)] 31 31 [PluginDependency("HeuristicLab.Clients.Hive", "3.3")] -
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views/3.3/Properties/AssemblyInfo.cs.frame
r7260 r8331 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3. 6.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")] -
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views/3.3/StateLog/StateLogGanttChartListView.cs
r7728 r8331 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Drawing; 24 25 using System.Linq; 26 using System.Windows.Forms; 27 using System.Windows.Forms.DataVisualization.Charting; 25 28 using HeuristicLab.Core.Views; 26 29 using HeuristicLab.MainForm; … … 31 34 [Content(typeof(StateLogListList), true)] 32 35 public sealed partial class StateLogGanttChartListView : ItemView { 36 private IList<LegendItem> invisibleLegendItems; 37 33 38 public new StateLogListList Content { 34 39 get { return (StateLogListList)base.Content; } … … 38 43 public StateLogGanttChartListView() { 39 44 InitializeComponent(); 45 invisibleLegendItems = new List<LegendItem>(); 40 46 } 41 47 42 48 protected override void DeregisterContentEvents() { 43 49 // Deregister your event handlers here 50 ganttChart.chart.MouseMove -= new System.Windows.Forms.MouseEventHandler(chart_MouseDown); 51 ganttChart.chart.MouseDown -= new System.Windows.Forms.MouseEventHandler(chart_MouseDown); 52 ganttChart.chart.CustomizeLegend -= new EventHandler<CustomizeLegendEventArgs>(chart_CustomizeLegend); 44 53 base.DeregisterContentEvents(); 45 54 } … … 48 57 base.RegisterContentEvents(); 49 58 // Register your event handlers here 59 ganttChart.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(chart_MouseMove); 60 ganttChart.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(chart_MouseDown); 61 ganttChart.chart.CustomizeLegend += new EventHandler<CustomizeLegendEventArgs>(chart_CustomizeLegend); 50 62 } 51 63 … … 75 87 for (int i = Content.Count - 1; i >= 0; i--) { 76 88 for (int j = 0; j < Content[i].Count - 1; j++) { 77 if (Content[i][j].State != TaskState.Offline )89 if (Content[i][j].State != TaskState.Offline && invisibleLegendItems.All(x => x.Name != Content[i][j].State.ToString())) 78 90 AddData(ganttChart, i.ToString(), Content[i][j], Content[i][j + 1], upperLimit); 79 91 } 80 if (Content[i].Count > 0 ) {92 if (Content[i].Count > 0 && invisibleLegendItems.All(x => x.Name != Content[i][Content[i].Count - 1].State.ToString())) { 81 93 AddData(ganttChart, i.ToString(), Content[i][Content[i].Count - 1], null, upperLimit); 82 94 } … … 113 125 base.SetEnabledStateOfControls(); 114 126 } 127 128 #region Events 129 void chart_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { 130 HitTestResult result = ganttChart.chart.HitTest(e.X, e.Y); 131 if (result.ChartElementType == ChartElementType.LegendItem) 132 Cursor = Cursors.Hand; 133 else 134 Cursor = Cursors.Default; 135 } 136 137 private void chart_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { 138 HitTestResult result = ganttChart.chart.HitTest(e.X, e.Y); 139 if (result.ChartElementType == ChartElementType.LegendItem) 140 ToggleLegendItemVisibility(result.Object as LegendItem); 141 ganttChart.Reset(); 142 OnContentChanged(); 143 } 144 145 private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) { 146 foreach (var item in e.LegendItems) 147 foreach (var cell in item.Cells) 148 cell.ForeColor = invisibleLegendItems.Any(x => x.Name == item.Name) ? Color.Gray : Color.Black; 149 } 150 #endregion 151 152 #region Helpers 153 private void ToggleLegendItemVisibility(LegendItem legendItem) { 154 var item = invisibleLegendItems.FirstOrDefault(x => x.Name == legendItem.Name); 155 if (item != null) invisibleLegendItems.Remove(item); 156 else invisibleLegendItems.Add(legendItem); 157 } 158 #endregion 115 159 } 116 160 } -
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views/3.3/TreeView/HiveTaskItemTreeView.cs
r8086 r8331 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Windows.Forms; … … 42 41 } 43 42 44 #region Register Content Events 45 protected override void DeregisterContentEvents() { 46 // TODO: Deregister your event handlers on the Content here 47 base.DeregisterContentEvents(); 48 } 49 protected override void RegisterContentEvents() { 50 base.RegisterContentEvents(); 51 // TODO: Register your event handlers on the Content here 52 } 53 #endregion 54 55 protected override void OnContentChanged() { 56 base.OnContentChanged(); 57 if (Content == null) { 58 // TODO: Put code here when content is null 59 } else { 60 // TODO: Put code here when content has been changed and is not null 61 } 62 } 63 64 protected override void SetEnabledStateOfControls() { 65 base.SetEnabledStateOfControls(); 66 // TODO: Put code here to enable or disable controls based on whether the Content is/not null or the view is ReadOnly 67 } 68 69 #region Event Handlers 70 // TODO: Put event handlers here 71 #endregion 72 73 #region Child Control Events 74 protected override void addButton_Click(object sender, EventArgs e) { 43 protected override void AddItem() { 75 44 IOptimizer optimizer = CreateItem<IOptimizer>(); 76 45 if (optimizer != null) { … … 88 57 } 89 58 90 protected override void removeButton_Click(object sender, EventArgs e) { 91 base.removeButton_Click(sender, e); 92 93 if (treeView.SelectedNode != null) { 94 var selectedItem = (HiveTask)treeView.SelectedNode.Tag; 95 var parentItem = GetParentItem(selectedItem); 96 if (parentItem == null) { 97 Content.Remove((HiveTask)treeView.SelectedNode.Tag); 98 } else { 99 var experiment = parentItem.ItemTask.Item as Experiment; 100 if (experiment != null) { 101 experiment.Optimizers.Remove(((OptimizerTask)selectedItem.ItemTask).Item); 102 } 59 protected override void RemoveItem(HiveTask item) { 60 var parentItem = GetParentItem(item); 61 if (parentItem == null) { 62 Content.Remove(item); 63 } else { 64 var experiment = parentItem.ItemTask.Item as Experiment; 65 if (experiment != null) { 66 experiment.Optimizers.Remove(((OptimizerTask)item.ItemTask).Item); 103 67 } 104 68 } 105 69 } 106 #endregion107 70 108 71 protected override ICollection<IItemTreeNodeAction<HiveTask>> GetTreeNodeItemActions(HiveTask selectedItem) { -
branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Views/3.3/TreeView/ItemTreeView.cs
r8086 r8331 36 36 [View("ItemTree View")] 37 37 [Content(typeof(ItemCollection<>), IsDefaultView = false)] 38 public partial class ItemTreeView<T> : ItemView where T : class, IItemTree<T> {38 public abstract partial class ItemTreeView<T> : ItemView where T : class, IItemTree<T> { 39 39 public new ItemCollection<T> Content { 40 40 get { return (ItemCollection<T>)base.Content; } … … 360 360 361 361 protected virtual void addButton_Click(object sender, EventArgs e) { 362 T item = CreateItem<T>(); 363 if (item != null) 364 Content.Add(item); 362 AddItem(); 365 363 } 366 364 367 365 protected virtual void removeButton_Click(object sender, EventArgs e) { 368 366 if (treeView.SelectedNode != null) { 367 RemoveItem(treeView.SelectedNode.Tag as T); 369 368 detailsViewHost.Content = null; 370 369 } 371 370 } 371 372 protected abstract void AddItem(); 373 374 protected abstract void RemoveItem(T item); 372 375 373 376 protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
Note: See TracChangeset
for help on using the changeset viewer.