- Timestamp:
- 01/10/19 15:40:44 (6 years ago)
- Location:
- branches/2520_PersistenceReintegration
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2520_PersistenceReintegration
- Property svn:mergeinfo changed
-
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
/branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis.Views (added) merged: 16149-16150,16520,16524 /trunk/HeuristicLab.Analysis.Views (added) merged: 16527
- Property svn:mergeinfo changed
-
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/DataTableHistoryView.cs
r16453 r16529 37 37 DataTable current = viewHost.Content as DataTable; 38 38 if (current == null) return; 39 using ( DataTableVisualPropertiesDialog dialog = new DataTableVisualPropertiesDialog(current)) {39 using (var dialog = new DataTableVisualPropertiesDialog<DataRow>(current)) { 40 40 if (dialog.ShowDialog(this) != DialogResult.OK) return; 41 41 HashSet<string> modifiedDisplayNames = new HashSet<string>(dialog.RowsWithModifiedDisplayNames); -
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r16453 r16529 128 128 public void ShowConfiguration() { 129 129 if (Content != null) { 130 using (var dialog = new DataTableVisualPropertiesDialog (Content)) {130 using (var dialog = new DataTableVisualPropertiesDialog<DataRow>(Content)) { 131 131 dialog.ShowDialog(this); 132 132 } … … 337 337 #region Event Handlers 338 338 #region Content Event Handlers 339 protected override void Content_NameChanged(object sender, EventArgs e) {340 if (InvokeRequired)341 Invoke(new EventHandler(Content_NameChanged), sender, e);342 else {343 Content.VisualProperties.Title = Content.Name;344 base.Content_NameChanged(sender, e);345 }346 }347 339 private void Content_VisualPropertiesChanged(object sender, EventArgs e) { 348 340 if (InvokeRequired) -
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs
r16453 r16529 21 21 22 22 namespace HeuristicLab.Analysis.Views { 23 partial class DataTableVisualPropertiesDialog {23 partial class DataTableVisualPropertiesDialog<TDataRow> { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.cs
r16453 r16529 27 27 28 28 namespace HeuristicLab.Analysis.Views { 29 public partial class DataTableVisualPropertiesDialog : Form{29 public partial class DataTableVisualPropertiesDialog<TDataRow> : Form where TDataRow : class, IDataRow { 30 30 protected bool SuppressEvents { get; set; } 31 protected DataTableContent { get; private set; }31 protected IDataTable<TDataRow> Content { get; private set; } 32 32 private DataTableVisualProperties originalDataTableVPs; 33 33 private Dictionary<string, DataRowVisualProperties> originalDataRowVPs; … … 36 36 public IEnumerable<string> RowsWithModifiedDisplayNames { get { return modifiedDisplayNames.AsEnumerable(); } } 37 37 38 public DataTableVisualPropertiesDialog( DataTabledataTable) {38 public DataTableVisualPropertiesDialog(IDataTable<TDataRow> dataTable) { 39 39 InitializeComponent(); 40 40 #region Prepare controls … … 51 51 originalDataTableVPs = (DataTableVisualProperties)Content.VisualProperties.Clone(); 52 52 originalDataRowVPs = new Dictionary<string, DataRowVisualProperties>(); 53 foreach ( DataRowrow in Content.Rows)53 foreach (var row in Content.Rows) 54 54 originalDataRowVPs.Add(row.Name, (DataRowVisualProperties)row.VisualProperties.Clone()); 55 55 … … 62 62 63 63 private void RegisterContentEvents() { 64 foreach ( DataRowrow in Content.Rows) {64 foreach (var row in Content.Rows) { 65 65 row.VisualProperties.PropertyChanged += new PropertyChangedEventHandler(Row_VisualProperties_PropertyChanged); 66 66 } … … 68 68 69 69 private void DeregisterContentEvents() { 70 foreach ( DataRowrow in Content.Rows) {70 foreach (var row in Content.Rows) { 71 71 row.VisualProperties.PropertyChanged -= new PropertyChangedEventHandler(Row_VisualProperties_PropertyChanged); 72 72 } … … 80 80 81 81 private void Row_VisualProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) { 82 foreach ( DataRowrow in Content.Rows) {82 foreach (var row in Content.Rows) { 83 83 if (e.PropertyName == "DisplayName" && row.VisualProperties == sender) { 84 84 modifiedDisplayNames.Add(row.Name); … … 109 109 private void cancelButton_Click(object sender, System.EventArgs e) { 110 110 DialogResult = DialogResult.Cancel; 111 foreach ( DataRowrow in Content.Rows) {111 foreach (var row in Content.Rows) { 112 112 row.VisualProperties = originalDataRowVPs[row.Name]; 113 113 } … … 160 160 private void FillSeriesListView() { 161 161 seriesListView.SelectedIndices.Clear(); 162 foreach ( DataRowrow in Content.Rows) {162 foreach (var row in Content.Rows) { 163 163 seriesListView.Items.Add(new ListViewItem(row.Name, 0)); 164 164 } … … 168 168 169 169 private void UpdateAllSeriesPositions() { 170 Dictionary<string, DataRow>rows = Content.Rows.ToDictionary(x => x.Name);170 var rows = Content.Rows.ToDictionary(x => x.Name); 171 171 Content.Rows.Clear(); 172 172 for (int i = 0; i < seriesListView.Items.Count; i++) { -
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.Designer.cs
r16453 r16529 50 50 System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); 51 51 this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart(); 52 this.configureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 52 53 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 53 54 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); … … 100 101 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 101 102 // 103 // configureToolStripMenuItem 104 // 105 this.configureToolStripMenuItem.Name = "configureToolStripMenuItem"; 106 this.configureToolStripMenuItem.Size = new System.Drawing.Size(256, 22); 107 this.configureToolStripMenuItem.Text = "Configure Chart..."; 108 this.configureToolStripMenuItem.Click += new System.EventHandler(this.configureToolStripMenuItem_Click); 109 // 102 110 // DataTableView 103 111 // … … 121 129 122 130 protected HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart; 123 131 private System.Windows.Forms.ToolStripMenuItem configureToolStripMenuItem; 124 132 } 125 133 } -
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.cs
r16453 r16529 20 20 #endregion 21 21 22 using HeuristicLab.Collections;23 using HeuristicLab.Core.Views;24 using HeuristicLab.MainForm;25 22 using System; 26 23 using System.Collections.Generic; … … 29 26 using System.Windows.Forms; 30 27 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Collections; 29 using HeuristicLab.Core.Views; 30 using HeuristicLab.MainForm; 31 31 32 32 namespace HeuristicLab.Analysis.Views { 33 33 [View("IndexedDataTable View")] 34 34 [Content(typeof(IndexedDataTable<>), true)] 35 public partial class IndexedDataTableView<T> : NamedItemView {35 public partial class IndexedDataTableView<T> : NamedItemView, IConfigureableView { 36 36 protected List<Series> invisibleSeries; 37 37 protected Dictionary<IObservableList<Tuple<T, double>>, IndexedDataRow<T>> valuesRowsTable; … … 49 49 chart.ChartAreas[0].CursorX.Interval = 1; 50 50 chart.SuppressExceptions = true; 51 chart.ContextMenuStrip.Items.Add(configureToolStripMenuItem); 51 52 } 52 53 … … 131 132 base.SetEnabledStateOfControls(); 132 133 chart.Enabled = Content != null; 134 } 135 136 public void ShowConfiguration() { 137 if (Content != null) { 138 using (var dialog = new DataTableVisualPropertiesDialog<IndexedDataRow<T>>(Content)) { 139 dialog.ShowDialog(this); 140 } 141 } else MessageBox.Show("Nothing to configure."); 133 142 } 134 143 … … 211 220 if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont; 212 221 if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor; 222 chart.Titles[0].Text = Content.VisualProperties.Title; 223 chart.Titles[0].Visible = !string.IsNullOrEmpty(Content.VisualProperties.Title); 213 224 214 225 if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont; … … 313 324 #region Event Handlers 314 325 #region Content Event Handlers 315 protected override void Content_NameChanged(object sender, EventArgs e) {316 if (InvokeRequired)317 Invoke(new EventHandler(Content_NameChanged), sender, e);318 else {319 chart.Titles[0].Text = Content.Name;320 base.Content_NameChanged(sender, e);321 }322 }323 326 private void Content_VisualPropertiesChanged(object sender, EventArgs e) { 324 327 if (InvokeRequired) … … 508 511 } 509 512 #endregion 513 private void configureToolStripMenuItem_Click(object sender, EventArgs e) { 514 ShowConfiguration(); 515 } 510 516 #endregion 511 517 -
branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs
r16453 r16529 40 40 protected Dictionary<Series, Series> seriesToRegressionSeriesTable; 41 41 private double xMin, xMax, yMin, yMax; 42 protected bool showChartOnly = false; 42 43 43 44 public new ScatterPlot Content { … … 46 47 } 47 48 48 public bool Show Name{49 get { return nameTextBox.Visible; }49 public bool ShowChartOnly { 50 get { return showChartOnly; } 50 51 set { 51 if (nameTextBox.Visible != value) { 52 foreach (Control c in Controls) { 53 if (c == chart) continue; 54 c.Visible = value; 55 } 56 chart.Dock = value ? DockStyle.None : DockStyle.Fill; 52 if (showChartOnly != value) { 53 showChartOnly = value; 54 UpdateControlsVisibility(); 57 55 } 58 56 } … … 137 135 } 138 136 } else MessageBox.Show("Nothing to configure."); 137 } 138 139 protected void UpdateControlsVisibility() { 140 if (InvokeRequired) 141 Invoke(new Action(UpdateControlsVisibility)); 142 else { 143 foreach (Control c in Controls) { 144 if (c == chart) continue; 145 c.Visible = !showChartOnly; 146 } 147 chart.Dock = showChartOnly ? DockStyle.Fill : DockStyle.None; 148 } 139 149 } 140 150
Note: See TracChangeset
for help on using the changeset viewer.