- Timestamp:
- 04/19/19 10:07:53 (6 years ago)
- Location:
- stable
- Files:
-
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/branches/2947_ConfigurableIndexedDataTable (added) merged: 16148-16150,16156,16520,16524 /trunk merged: 16527
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Analysis.Views/3.3/DataTableHistoryView.cs
r15584 r16838 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); -
stable/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r15584 r16838 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) -
stable/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs
r15584 r16838 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. -
stable/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.cs
r15584 r16838 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++) { -
stable/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.Designer.cs
r15584 r16838 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 } -
stable/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.cs
r15584 r16838 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 -
stable/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs
r15584 r16838 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 -
stable/HeuristicLab.Analysis/3.3/DataVisualization/DataRow.cs
r15584 r16838 34 34 [Item("DataRow", "A row of data values.")] 35 35 [StorableClass] 36 public class DataRow : NamedItem {36 public class DataRow : NamedItem , IDataRow { 37 37 private DataRowVisualProperties visualProperties; 38 38 public DataRowVisualProperties VisualProperties { -
stable/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs
r15584 r16838 37 37 [Item("DataTable", "A table of data values.")] 38 38 [StorableClass] 39 public class DataTable : NamedItem, IStringConvertibleMatrix {39 public class DataTable : NamedItem, IStringConvertibleMatrix, IDataTable<DataRow> { 40 40 public static new Image StaticItemImage { 41 41 get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; } -
stable/HeuristicLab.Analysis/3.3/DataVisualization/IndexedDataRow.cs
r16282 r16838 32 32 [Item("IndexedDataRow", "A data row that contains a series of points.")] 33 33 [StorableClass] 34 public class IndexedDataRow<T> : NamedItem {34 public class IndexedDataRow<T> : NamedItem, IDataRow { 35 35 36 36 private DataRowVisualProperties visualProperties; -
stable/HeuristicLab.Analysis/3.3/DataVisualization/IndexedDataTable.cs
r15584 r16838 34 34 [Item("IndexedDataTable", "A data table where the points are also given with a certain index.")] 35 35 [StorableClass] 36 public class IndexedDataTable<T> : NamedItem, IStringConvertibleMatrix {36 public class IndexedDataTable<T> : NamedItem, IStringConvertibleMatrix, IDataTable<IndexedDataRow<T>> { 37 37 public static new Image StaticItemImage { 38 38 get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; } … … 90 90 public IndexedDataTable(string name) 91 91 : base(name) { 92 VisualProperties = new DataTableVisualProperties( );92 VisualProperties = new DataTableVisualProperties(name); 93 93 rows = new NamedItemCollection<IndexedDataRow<T>>(); 94 94 this.RegisterRowsEvents(); … … 96 96 public IndexedDataTable(string name, string description) 97 97 : base(name, description) { 98 VisualProperties = new DataTableVisualProperties( );98 VisualProperties = new DataTableVisualProperties(name); 99 99 rows = new NamedItemCollection<IndexedDataRow<T>>(); 100 100 this.RegisterRowsEvents(); … … 103 103 public override IDeepCloneable Clone(Cloner cloner) { 104 104 return new IndexedDataTable<T>(this, cloner); 105 } 106 107 #region BackwardsCompatibility3.3 108 // Using the name as title is the old style 109 [Storable(DefaultValue = true)] 110 private bool useNameAsTitle = false; 111 #endregion 112 113 [StorableHook(HookType.AfterDeserialization)] 114 private void AfterDeserialization() { 115 // BackwardsCompatibility3.3 116 #region Backwards compatible code, remove with 3.4 117 // Previously, the Name of the IndexedDataTable was used as Title 118 if (useNameAsTitle && string.IsNullOrEmpty(VisualProperties.Title)) { 119 VisualProperties.Title = Name; 120 useNameAsTitle = false; 121 } 122 #endregion 105 123 } 106 124 -
stable/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r15220 r16838 134 134 <Compile Include="DataVisualization\IndexedDataRow.cs" /> 135 135 <Compile Include="DataVisualization\IndexedDataTable.cs" /> 136 <Compile Include="DataVisualization\Interfaces\IDataRow.cs" /> 137 <Compile Include="DataVisualization\Interfaces\IDataTable.cs" /> 136 138 <Compile Include="DataVisualization\ScatterPlotDataRowVisualProperties.cs" /> 137 139 <Compile Include="DataVisualization\ScatterPlotDataRow.cs" /> -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r15584 r16838 457 457 Content = scatterPlot, 458 458 Dock = DockStyle.Fill, 459 Show Name = false459 ShowChartOnly = true 460 460 //ShowLegend = false, 461 461 //XAxisFormat = "G3" -
stable/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs
r15584 r16838 86 86 this.scatterPlotView.Name = "scatterPlotView"; 87 87 this.scatterPlotView.ReadOnly = false; 88 this.scatterPlotView.Show Name = false;88 this.scatterPlotView.ShowChartOnly = true; 89 89 this.scatterPlotView.Size = new System.Drawing.Size(618, 517); 90 90 this.scatterPlotView.TabIndex = 0; -
stable/HeuristicLab.Problems.TestFunctions.Views/3.3/ParetoFrontScatterPlotView.Designer.cs
r15584 r16838 62 62 this.scatterPlotView.Name = "scatterPlotView"; 63 63 this.scatterPlotView.ReadOnly = false; 64 this.scatterPlotView.Show Name = false;64 this.scatterPlotView.ShowChartOnly = true; 65 65 this.scatterPlotView.Size = new System.Drawing.Size(615, 342); 66 66 this.scatterPlotView.TabIndex = 3;
Note: See TracChangeset
for help on using the changeset viewer.