Free cookie consent management tool by TermsFeed Policy Generator

Changeset 168


Ignore:
Timestamp:
04/23/08 00:35:19 (16 years ago)
Author:
gkronber
Message:

fixed #118

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs

    r2 r168  
    3333      set {
    3434        Item = value;
    35         Item.Changed += new EventHandler(Item_Changed);
     35        Refresh();
    3636      }
    3737    }
    3838
    39     void Item_Changed(object sender, EventArgs e) {
    40       Refresh();
    41     }
    42 
    43     public DatasetView() : base() {
     39    public DatasetView()
     40      : base() {
    4441      InitializeComponent();
    4542      openFileDialog = new OpenFileDialog();
    4643    }
    4744
    48     public DatasetView(Dataset dataset) :this() {
     45    public DatasetView(Dataset dataset)
     46      : this() {
    4947      this.Dataset = dataset;
    5048    }
     
    5250    protected override void UpdateControls() {
    5351      base.UpdateControls();
    54       if(Dataset != null) {
     52      if (Dataset != null) {
    5553        int rows = Dataset.Rows;
    5654        int columns = Dataset.Columns;
    57 
    5855        nameTextBox.Text = Dataset.Name;
    5956        rowsTextBox.Text = rows + "";
     
    6158        dataGridView.ColumnCount = columns;
    6259        dataGridView.RowCount = rows;
    63         for(int i = 0; i < rows; i++) {
    64           for(int j = 0; j < columns; j++) {
     60        for (int i = 0; i < rows; i++) {
     61          for (int j = 0; j < columns; j++) {
    6562            dataGridView.Rows[i].Cells[j].Value = Dataset.GetValue(i, j);
    6663          }
     
    8582
    8683    private void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
    87       if(ValidateData((string)e.FormattedValue)) {
     84      if (ValidateData((string)e.FormattedValue)) {
    8885        SetArrayElement(e.RowIndex, e.ColumnIndex, (string)e.FormattedValue);
    8986        e.Cancel = false;
     
    9794      double result;
    9895      double.TryParse(element, out result);
    99       if(result != Dataset.GetValue(row, column)) {
     96      if (result != Dataset.GetValue(row, column)) {
    10097        Dataset.SetValue(row, column, result);
    10198        Dataset.FireChanged();
  • trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.Designer.cs

    r154 r168  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.nameLabel = new System.Windows.Forms.Label();
    48       this.nameTextBox = new System.Windows.Forms.TextBox();
    4947      this.importInstanceButton = new System.Windows.Forms.Button();
    5048      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    5149      this.tabControl = new System.Windows.Forms.TabControl();
    5250      this.dataTabPage = new System.Windows.Forms.TabPage();
    53       this.variablesLabel = new System.Windows.Forms.Label();
    54       this.variablesTextBox = new System.Windows.Forms.TextBox();
    55       this.samplesLabel = new System.Windows.Forms.Label();
    56       this.samplesTextBox = new System.Windows.Forms.TextBox();
    5751      this.variableInfosTabPage = new System.Windows.Forms.TabPage();
    5852      this.operatorBaseVariableInfosView = new HeuristicLab.Core.OperatorBaseVariableInfosView();
    5953      this.descriptionTabPage = new System.Windows.Forms.TabPage();
    6054      this.operatorBaseDescriptionView = new HeuristicLab.Core.OperatorBaseDescriptionView();
     55      this.datasetView = new HeuristicLab.DataAnalysis.DatasetView();
    6156      this.tabControl.SuspendLayout();
    6257      this.dataTabPage.SuspendLayout();
     
    6560      this.SuspendLayout();
    6661      //
    67       // nameLabel
    68       //
    69       this.nameLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
    70       this.nameLabel.AutoSize = true;
    71       this.nameLabel.Location = new System.Drawing.Point(6, 9);
    72       this.nameLabel.Name = "nameLabel";
    73       this.nameLabel.Size = new System.Drawing.Size(38, 13);
    74       this.nameLabel.TabIndex = 0;
    75       this.nameLabel.Text = "Name:";
    76       //
    77       // nameTextBox
    78       //
    79       this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
    80       this.nameTextBox.Location = new System.Drawing.Point(62, 6);
    81       this.nameTextBox.Name = "nameTextBox";
    82       this.nameTextBox.ReadOnly = true;
    83       this.nameTextBox.Size = new System.Drawing.Size(166, 20);
    84       this.nameTextBox.TabIndex = 1;
    85       //
    8662      // importInstanceButton
    8763      //
    88       this.importInstanceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
    89       this.importInstanceButton.Location = new System.Drawing.Point(6, 105);
     64      this.importInstanceButton.Location = new System.Drawing.Point(6, 6);
    9065      this.importInstanceButton.Name = "importInstanceButton";
    91       this.importInstanceButton.Size = new System.Drawing.Size(256, 21);
     66      this.importInstanceButton.Size = new System.Drawing.Size(129, 21);
    9267      this.importInstanceButton.TabIndex = 6;
    9368      this.importInstanceButton.Text = "&Import...";
     
    11186      this.tabControl.Name = "tabControl";
    11287      this.tabControl.SelectedIndex = 0;
    113       this.tabControl.Size = new System.Drawing.Size(276, 184);
     88      this.tabControl.Size = new System.Drawing.Size(507, 451);
    11489      this.tabControl.TabIndex = 0;
    11590      //
    11691      // dataTabPage
    11792      //
    118       this.dataTabPage.Controls.Add(this.variablesLabel);
    119       this.dataTabPage.Controls.Add(this.variablesTextBox);
    120       this.dataTabPage.Controls.Add(this.samplesLabel);
    121       this.dataTabPage.Controls.Add(this.samplesTextBox);
    122       this.dataTabPage.Controls.Add(this.nameLabel);
     93      this.dataTabPage.Controls.Add(this.datasetView);
    12394      this.dataTabPage.Controls.Add(this.importInstanceButton);
    124       this.dataTabPage.Controls.Add(this.nameTextBox);
    12595      this.dataTabPage.Location = new System.Drawing.Point(4, 22);
    12696      this.dataTabPage.Name = "dataTabPage";
    12797      this.dataTabPage.Padding = new System.Windows.Forms.Padding(3);
    128       this.dataTabPage.Size = new System.Drawing.Size(268, 158);
     98      this.dataTabPage.Size = new System.Drawing.Size(499, 425);
    12999      this.dataTabPage.TabIndex = 0;
    130100      this.dataTabPage.Text = "Data";
    131101      this.dataTabPage.UseVisualStyleBackColor = true;
    132       //
    133       // variablesLabel
    134       //
    135       this.variablesLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
    136       this.variablesLabel.AutoSize = true;
    137       this.variablesLabel.Location = new System.Drawing.Point(6, 61);
    138       this.variablesLabel.Name = "variablesLabel";
    139       this.variablesLabel.Size = new System.Drawing.Size(53, 13);
    140       this.variablesLabel.TabIndex = 9;
    141       this.variablesLabel.Text = "Variables:";
    142       //
    143       // variablesTextBox
    144       //
    145       this.variablesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
    146       this.variablesTextBox.Location = new System.Drawing.Point(62, 58);
    147       this.variablesTextBox.Name = "variablesTextBox";
    148       this.variablesTextBox.ReadOnly = true;
    149       this.variablesTextBox.Size = new System.Drawing.Size(81, 20);
    150       this.variablesTextBox.TabIndex = 10;
    151       //
    152       // samplesLabel
    153       //
    154       this.samplesLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
    155       this.samplesLabel.AutoSize = true;
    156       this.samplesLabel.Location = new System.Drawing.Point(6, 35);
    157       this.samplesLabel.Name = "samplesLabel";
    158       this.samplesLabel.Size = new System.Drawing.Size(50, 13);
    159       this.samplesLabel.TabIndex = 7;
    160       this.samplesLabel.Text = "Samples:";
    161       //
    162       // samplesTextBox
    163       //
    164       this.samplesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
    165       this.samplesTextBox.Location = new System.Drawing.Point(62, 32);
    166       this.samplesTextBox.Name = "samplesTextBox";
    167       this.samplesTextBox.ReadOnly = true;
    168       this.samplesTextBox.Size = new System.Drawing.Size(81, 20);
    169       this.samplesTextBox.TabIndex = 8;
    170102      //
    171103      // variableInfosTabPage
     
    175107      this.variableInfosTabPage.Name = "variableInfosTabPage";
    176108      this.variableInfosTabPage.Padding = new System.Windows.Forms.Padding(3);
    177       this.variableInfosTabPage.Size = new System.Drawing.Size(268, 158);
     109      this.variableInfosTabPage.Size = new System.Drawing.Size(499, 425);
    178110      this.variableInfosTabPage.TabIndex = 1;
    179111      this.variableInfosTabPage.Text = "Variable Infos";
     
    187119      this.operatorBaseVariableInfosView.Name = "operatorBaseVariableInfosView";
    188120      this.operatorBaseVariableInfosView.Operator = null;
    189       this.operatorBaseVariableInfosView.Size = new System.Drawing.Size(262, 152);
     121      this.operatorBaseVariableInfosView.Size = new System.Drawing.Size(493, 419);
    190122      this.operatorBaseVariableInfosView.TabIndex = 0;
    191123      //
     
    196128      this.descriptionTabPage.Name = "descriptionTabPage";
    197129      this.descriptionTabPage.Padding = new System.Windows.Forms.Padding(3);
    198       this.descriptionTabPage.Size = new System.Drawing.Size(268, 158);
     130      this.descriptionTabPage.Size = new System.Drawing.Size(499, 425);
    199131      this.descriptionTabPage.TabIndex = 2;
    200132      this.descriptionTabPage.Text = "Description";
     
    208140      this.operatorBaseDescriptionView.Name = "operatorBaseDescriptionView";
    209141      this.operatorBaseDescriptionView.Operator = null;
    210       this.operatorBaseDescriptionView.Size = new System.Drawing.Size(262, 152);
     142      this.operatorBaseDescriptionView.Size = new System.Drawing.Size(493, 419);
    211143      this.operatorBaseDescriptionView.TabIndex = 0;
     144      //
     145      // datasetView
     146      //
     147      this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     148                  | System.Windows.Forms.AnchorStyles.Left)
     149                  | System.Windows.Forms.AnchorStyles.Right)));
     150      this.datasetView.Caption = "View";
     151      this.datasetView.Location = new System.Drawing.Point(6, 33);
     152      this.datasetView.Name = "datasetView";
     153      this.datasetView.Size = new System.Drawing.Size(487, 386);
     154      this.datasetView.TabIndex = 7;
    212155      //
    213156      // StructIdProblemInjectorView
     
    217160      this.Controls.Add(this.tabControl);
    218161      this.Name = "StructIdProblemInjectorView";
    219       this.Size = new System.Drawing.Size(276, 184);
     162      this.Size = new System.Drawing.Size(507, 451);
    220163      this.tabControl.ResumeLayout(false);
    221164      this.dataTabPage.ResumeLayout(false);
    222       this.dataTabPage.PerformLayout();
    223165      this.variableInfosTabPage.ResumeLayout(false);
    224166      this.descriptionTabPage.ResumeLayout(false);
     
    229171    #endregion
    230172
    231     private System.Windows.Forms.Label nameLabel;
    232     private System.Windows.Forms.TextBox nameTextBox;
    233173    private System.Windows.Forms.Button importInstanceButton;
    234174    private System.Windows.Forms.OpenFileDialog openFileDialog;
     
    239179    private System.Windows.Forms.TabPage descriptionTabPage;
    240180    private HeuristicLab.Core.OperatorBaseDescriptionView operatorBaseDescriptionView;
    241     private System.Windows.Forms.Label variablesLabel;
    242     private System.Windows.Forms.TextBox variablesTextBox;
    243     private System.Windows.Forms.Label samplesLabel;
    244     private System.Windows.Forms.TextBox samplesTextBox;
     181    private HeuristicLab.DataAnalysis.DatasetView datasetView;
    245182  }
    246183}
  • trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.cs

    r131 r168  
    6161      base.UpdateControls();
    6262      if (StructIdProblemInjector == null) {
    63         nameTextBox.Text = "-";
    64         variablesTextBox.Text = "-";
    65         samplesTextBox.Text = "-";
    6663        importInstanceButton.Enabled = false;
    6764      } else {
    6865        Dataset dataset = (Dataset)StructIdProblemInjector.GetVariable("Dataset").Value;
    69         nameTextBox.Text = dataset.Name;
    70         samplesTextBox.Text = dataset.Rows+"";
    71         variablesTextBox.Text = dataset.Columns+"";
     66        datasetView.Dataset = dataset;
    7267        importInstanceButton.Enabled = true;
    7368      }
Note: See TracChangeset for help on using the changeset viewer.