Changeset 14982


Ignore:
Timestamp:
05/15/17 16:26:34 (3 months ago)
Author:
pfleck
Message:

#2713 Reverted the separation of the DataTable/ScatterPlotView in -View and -Control.
Instead, a ShowName property is added to control whether the name-textbox and the info-label from the NamedItemView are shown.

Location:
trunk/sources/HeuristicLab.Analysis.Views/3.3
Files:
1 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.Designer.cs

    r14981 r14982  
    2121
    2222namespace HeuristicLab.Analysis.Views {
    23   partial class DataTableControl {
     23  partial class DataTableView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    5252      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    5353      this.configureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     54      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5455      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
    5556      this.SuspendLayout();
    5657      //
     58      // nameTextBox
     59      //
     60      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     61      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
     62      this.nameTextBox.Location = new System.Drawing.Point(55, 0);
     63      this.nameTextBox.Size = new System.Drawing.Size(279, 20);
     64      //
     65      // infoLabel
     66      //
     67      this.infoLabel.Location = new System.Drawing.Point(340, 3);
     68      //
    5769      // chart
    5870      //
    59       this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    60             | System.Windows.Forms.AnchorStyles.Left) 
     71      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     72            | System.Windows.Forms.AnchorStyles.Left)
    6173            | System.Windows.Forms.AnchorStyles.Right)));
    6274      this.chart.BorderlineColor = System.Drawing.Color.Black;
     
    7486      legend1.Name = "Default";
    7587      this.chart.Legends.Add(legend1);
    76       this.chart.Location = new System.Drawing.Point(0, 0);
     88      this.chart.Location = new System.Drawing.Point(0, 26);
    7789      this.chart.Name = "chart";
    7890      series1.ChartArea = "Default";
     
    8092      series1.Name = "Default";
    8193      this.chart.Series.Add(series1);
    82       this.chart.Size = new System.Drawing.Size(359, 274);
     94      this.chart.Size = new System.Drawing.Size(359, 248);
    8395      this.chart.TabIndex = 3;
    8496      this.chart.Text = "chart";
     
    98110      this.configureToolStripMenuItem.Click += new System.EventHandler(this.configureToolStripMenuItem_Click);
    99111      //
    100       // DataTableControl
     112      // DataTableView
    101113      //
    102114      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    103115      this.Controls.Add(this.chart);
    104       this.Name = "DataTableControl";
     116      this.Name = "DataTableView";
    105117      this.Size = new System.Drawing.Size(359, 274);
     118      this.Controls.SetChildIndex(this.chart, 0);
     119      this.Controls.SetChildIndex(this.nameLabel, 0);
     120      this.Controls.SetChildIndex(this.nameTextBox, 0);
     121      this.Controls.SetChildIndex(this.infoLabel, 0);
     122      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    106123      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
    107124      this.ResumeLayout(false);
     125      this.PerformLayout();
    108126
    109127    }
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r14981 r14982  
    2727using System.Windows.Forms.DataVisualization.Charting;
    2828using HeuristicLab.Collections;
    29 using HeuristicLab.MainForm.WindowsForms;
     29using HeuristicLab.Core.Views;
     30using HeuristicLab.MainForm;
    3031
    3132namespace HeuristicLab.Analysis.Views {
    32   public partial class DataTableControl : AsynchronousContentView {
     33  [View("DataTable View")]
     34  [Content(typeof(DataTable), true)]
     35  public partial class DataTableView : NamedItemView, IConfigureableView {
    3336    protected List<Series> invisibleSeries;
    3437    protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable;
     
    3942    }
    4043
    41     public DataTableControl() {
     44    public bool ShowName {
     45      get { return nameTextBox.Visible; }
     46      set {
     47        if (nameTextBox.Visible != value) {
     48          foreach (Control c in Controls) {
     49            if (c == chart) continue;
     50            c.Visible = value;
     51          }
     52          chart.Dock = value ? DockStyle.None : DockStyle.Fill;
     53        }
     54      }
     55    }
     56
     57    public DataTableView() {
    4258      InitializeComponent();
    4359      valuesRowsTable = new Dictionary<IObservableList<double>, DataRow>();
     
    89105
    90106    protected override void OnContentChanged() {
     107      base.OnContentChanged();
    91108      invisibleSeries.Clear();
    92109      chart.Titles[0].Text = string.Empty;
     
    105122
    106123    protected override void SetEnabledStateOfControls() {
     124      base.SetEnabledStateOfControls();
    107125      chart.Enabled = Content != null;
    108126    }
     
    306324    #region Event Handlers
    307325    #region Content Event Handlers
     326    protected override void Content_NameChanged(object sender, EventArgs e) {
     327      if (InvokeRequired)
     328        Invoke(new EventHandler(Content_NameChanged), sender, e);
     329      else {
     330        Content.VisualProperties.Title = Content.Name;
     331        base.Content_NameChanged(sender, e);
     332      }
     333    }
    308334    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
    309335      if (InvokeRequired)
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj

    r14734 r14982  
    126126  </ItemGroup>
    127127  <ItemGroup>
    128     <Compile Include="DataTableControl.cs">
    129       <SubType>UserControl</SubType>
    130     </Compile>
    131     <Compile Include="DataTableControl.Designer.cs">
    132       <DependentUpon>DataTableControl.cs</DependentUpon>
     128    <Compile Include="DataTableView.cs">
     129      <SubType>UserControl</SubType>
     130    </Compile>
     131    <Compile Include="DataTableView.Designer.cs">
     132      <DependentUpon>DataTableView.cs</DependentUpon>
    133133    </Compile>
    134134    <Compile Include="GanttDataView.cs">
     
    144144      <DependentUpon>IndexedDataTableView.cs</DependentUpon>
    145145    </Compile>
    146     <Compile Include="ScatterPlotControl.cs">
    147       <SubType>UserControl</SubType>
    148     </Compile>
    149     <Compile Include="ScatterPlotControl.Designer.cs">
    150       <DependentUpon>ScatterPlotControl.cs</DependentUpon>
     146    <Compile Include="ScatterPlotView.cs">
     147      <SubType>UserControl</SubType>
     148    </Compile>
     149    <Compile Include="ScatterPlotView.Designer.cs">
     150      <DependentUpon>ScatterPlotView.cs</DependentUpon>
    151151    </Compile>
    152152    <Compile Include="ScatterPlotVisualPropertiesDialog.cs">
     
    168168      <DependentUpon>ScatterPlotDataRowVisualPropertiesControl.cs</DependentUpon>
    169169    </Compile>
    170     <Compile Include="ScatterPlotView.cs">
    171       <SubType>UserControl</SubType>
    172     </Compile>
    173     <Compile Include="ScatterPlotView.Designer.cs">
    174       <DependentUpon>ScatterPlotView.cs</DependentUpon>
    175     </Compile>
    176170    <Compile Include="ScatterPlotHistoryView.cs">
    177171      <SubType>UserControl</SubType>
     
    237231    <Compile Include="Plugin.cs" />
    238232    <Compile Include="Properties\AssemblyInfo.cs" />
    239     <Compile Include="DataTableView.cs">
    240       <SubType>UserControl</SubType>
    241     </Compile>
    242     <Compile Include="DataTableView.Designer.cs">
    243       <DependentUpon>DataTableView.cs</DependentUpon>
    244     </Compile>
    245233    <Compile Include="HistogramControl.cs">
    246234      <SubType>UserControl</SubType>
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.Designer.cs

    r14981 r14982  
    2121
    2222namespace HeuristicLab.Analysis.Views {
    23   partial class ScatterPlotControl {
     23  partial class ScatterPlotView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    5252      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    5353      this.configureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     54      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5455      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
    5556      this.SuspendLayout();
     57      //
     58      // nameTextBox
     59      //
     60      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     61      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
     62      this.nameTextBox.Location = new System.Drawing.Point(55, 0);
     63      this.nameTextBox.Size = new System.Drawing.Size(279, 20);
     64      //
     65      // infoLabel
     66      //
     67      this.infoLabel.Location = new System.Drawing.Point(340, 3);
    5668      //
    5769      // chart
     
    7385      legend1.Name = "Default";
    7486      this.chart.Legends.Add(legend1);
    75       this.chart.Location = new System.Drawing.Point(0, 0);
     87      this.chart.Location = new System.Drawing.Point(0, 26);
    7688      this.chart.Name = "chart";
    7789      series1.ChartArea = "Default";
     
    7991      series1.Name = "Default";
    8092      this.chart.Series.Add(series1);
    81       this.chart.Size = new System.Drawing.Size(359, 274);
     93      this.chart.Size = new System.Drawing.Size(359, 248);
    8294      this.chart.TabIndex = 3;
    8395      this.chart.Text = "chart";
     
    98110      this.configureToolStripMenuItem.Click += new System.EventHandler(this.configureToolStripMenuItem_Click);
    99111      //
    100       // ScatterPlotControl
     112      // ScatterPlotView
    101113      //
    102114      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    103115      this.Controls.Add(this.chart);
    104       this.Name = "ScatterPlotControl";
     116      this.Name = "ScatterPlotView";
    105117      this.Size = new System.Drawing.Size(359, 274);
     118      this.Controls.SetChildIndex(this.chart, 0);
     119      this.Controls.SetChildIndex(this.nameLabel, 0);
     120      this.Controls.SetChildIndex(this.nameTextBox, 0);
     121      this.Controls.SetChildIndex(this.infoLabel, 0);
     122      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    106123      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
    107124      this.ResumeLayout(false);
     125      this.PerformLayout();
    108126
    109127    }
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs

    r14981 r14982  
    2929using HeuristicLab.Collections;
    3030using HeuristicLab.Common;
     31using HeuristicLab.Core.Views;
    3132using HeuristicLab.MainForm;
    32 using HeuristicLab.MainForm.WindowsForms;
    3333
    3434namespace HeuristicLab.Analysis.Views {
    35   public partial class ScatterPlotControl : AsynchronousContentView {
     35  [View("ScatterPlot View")]
     36  [Content(typeof(ScatterPlot), true)]
     37  public partial class ScatterPlotView : NamedItemView, IConfigureableView {
    3638    protected List<Series> invisibleSeries;
    3739    protected Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow> pointsRowsTable;
     
    4446    }
    4547
    46     public ScatterPlotControl() {
     48    public bool ShowName {
     49      get { return nameTextBox.Visible; }
     50      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;
     57        }
     58      }
     59    }
     60
     61    public ScatterPlotView() {
    4762      InitializeComponent();
    4863      pointsRowsTable = new Dictionary<IObservableList<Point2D<double>>, ScatterPlotDataRow>();
     
    93108
    94109    protected override void OnContentChanged() {
     110      base.OnContentChanged();
    95111      invisibleSeries.Clear();
    96112      chart.Titles[0].Text = string.Empty;
     
    109125
    110126    protected override void SetEnabledStateOfControls() {
     127      base.SetEnabledStateOfControls();
    111128      chart.Enabled = Content != null;
    112129    }
     
    282299    #region Event Handlers
    283300    #region Content Event Handlers
     301    protected override void Content_NameChanged(object sender, EventArgs e) {
     302      if (InvokeRequired)
     303        Invoke(new EventHandler(Content_NameChanged), sender, e);
     304      else {
     305        Content.VisualProperties.Title = Content.Name;
     306        base.Content_NameChanged(sender, e);
     307      }
     308    }
    284309    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
    285310      if (InvokeRequired)
     
    443468    #region Chart Event Handlers
    444469    private void chart_MouseDoubleClick(object sender, MouseEventArgs e) {
    445       HitTestResult result = chart.HitTest(e.X, e.Y,ChartElementType.DataPoint);
     470      HitTestResult result = chart.HitTest(e.X, e.Y, ChartElementType.DataPoint);
    446471      if (result.ChartElementType != ChartElementType.DataPoint) return;
    447472
Note: See TracChangeset for help on using the changeset viewer.