Changeset 16149 for branches/2947_ConfigurableIndexedDataTable
- Timestamp:
- 09/15/18 11:47:03 (6 years ago)
- Location:
- branches/2947_ConfigurableIndexedDataTable
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis.Views/3.3/DataTableHistoryView.cs
r15583 r16149 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/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r15619 r16149 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 } -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.Designer.cs
r15583 r16149 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/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis.Views/3.3/DataTableVisualPropertiesDialog.cs
r15583 r16149 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/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.cs
r15583 r16149 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; … … 131 131 base.SetEnabledStateOfControls(); 132 132 chart.Enabled = Content != null; 133 } 134 135 public void ShowConfiguration() { 136 if (Content != null) { 137 using (var dialog = new DataTableVisualPropertiesDialog<IndexedDataRow<T>>(Content)) { 138 dialog.ShowDialog(this); 139 } 140 } else MessageBox.Show("Nothing to configure."); 133 141 } 134 142 … … 211 219 if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont; 212 220 if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor; 221 chart.Titles[0].Text = Content.VisualProperties.Title; 222 chart.Titles[0].Visible = !string.IsNullOrEmpty(Content.VisualProperties.Title); 213 223 214 224 if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont; -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis/3.3/DataVisualization/DataRow.cs
r15583 r16149 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 { -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs
r15583 r16149 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; } -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis/3.3/DataVisualization/IndexedDataTable.cs
r15583 r16149 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; } -
branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r14734 r16149 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" />
Note: See TracChangeset
for help on using the changeset viewer.