Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/15/10 05:26:02 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on operators, parameters and problems
Location:
trunk/sources/HeuristicLab.Core.Views/3.3
Files:
4 added
11 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.Designer.cs

    r2790 r2796  
    120120      this.descriptionTextBox.Name = "descriptionTextBox";
    121121      this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    122       this.descriptionTextBox.Size = new System.Drawing.Size(452, 103);
     122      this.descriptionTextBox.Size = new System.Drawing.Size(452, 102);
    123123      this.descriptionTextBox.TabIndex = 4;
    124124      //
     
    127127      this.dataTypeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    128128      this.dataTypeLabel.AutoSize = true;
    129       this.dataTypeLabel.Location = new System.Drawing.Point(9, 426);
     129      this.dataTypeLabel.Location = new System.Drawing.Point(12, 425);
    130130      this.dataTypeLabel.Name = "dataTypeLabel";
    131131      this.dataTypeLabel.Size = new System.Drawing.Size(60, 13);
     
    138138                  | System.Windows.Forms.AnchorStyles.Right)));
    139139      this.dataTypeTextBox.Enabled = false;
    140       this.dataTypeTextBox.Location = new System.Drawing.Point(78, 423);
     140      this.dataTypeTextBox.Location = new System.Drawing.Point(78, 422);
    141141      this.dataTypeTextBox.Name = "dataTypeTextBox";
    142142      this.dataTypeTextBox.ReadOnly = true;
    143       this.dataTypeTextBox.Size = new System.Drawing.Size(423, 20);
     143      this.dataTypeTextBox.Size = new System.Drawing.Size(422, 20);
    144144      this.dataTypeTextBox.TabIndex = 6;
    145145      //
     
    149149      this.setDataTypeButton.Enabled = false;
    150150      this.setDataTypeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
    151       this.setDataTypeButton.Location = new System.Drawing.Point(507, 421);
     151      this.setDataTypeButton.Location = new System.Drawing.Point(506, 420);
    152152      this.setDataTypeButton.Name = "setDataTypeButton";
    153       this.setDataTypeButton.Size = new System.Drawing.Size(23, 23);
     153      this.setDataTypeButton.Size = new System.Drawing.Size(24, 24);
    154154      this.setDataTypeButton.TabIndex = 7;
    155155      this.toolTip.SetToolTip(this.setDataTypeButton, "Set Data Type");
     
    193193      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    194194      this.Text = "Create Parameter";
    195       this.Load += new System.EventHandler(this.CreateParameterDialog_Load);
    196195      this.ResumeLayout(false);
    197196      this.PerformLayout();
  • trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.cs

    r2790 r2796  
    3535    protected TypeSelectorDialog typeSelectorDialog;
    3636
     37    public TypeSelector ParameterTypeSelector {
     38      get { return parameterTypeSelector; }
     39    }
    3740    public IParameter Parameter {
    3841      get {
     
    5659    public CreateParameterDialog() {
    5760      InitializeComponent();
     61      parameterTypeSelector.Configure(typeof(IParameter), false, true);
    5862    }
    5963
     
    7074      }
    7175      okButton.Enabled = dataTypeTextBox.Tag != null;
    72     }
    73 
    74     protected virtual void CreateParameterDialog_Load(object sender, EventArgs e) {
    75       parameterTypeSelector.Configure(typeof(IParameter), false, true);
    7676    }
    7777
  • trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.Designer.cs

    r2790 r2796  
    3333    protected override void Dispose(bool disposing) {
    3434      if (disposing) {
     35        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
    3536        if (components != null) components.Dispose();
    3637      }
     
    5455      this.startButton = new System.Windows.Forms.Button();
    5556      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     57      this.newProblemButton = new System.Windows.Forms.Button();
     58      this.openProblemButton = new System.Windows.Forms.Button();
     59      this.saveProblemButton = new System.Windows.Forms.Button();
     60      this.newOperatorGraphButton = new System.Windows.Forms.Button();
     61      this.openOperatorGraphButton = new System.Windows.Forms.Button();
     62      this.saveOperatorGraphButton = new System.Windows.Forms.Button();
    5663      this.tabControl = new System.Windows.Forms.TabControl();
    5764      this.operatorGraphTabPage = new System.Windows.Forms.TabPage();
    5865      this.globalScopeTabPage = new System.Windows.Forms.TabPage();
     66      this.problemTabPage = new System.Windows.Forms.TabPage();
     67      this.problemViewHost = new HeuristicLab.Core.Views.ViewHost();
     68      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     69      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
    5970      this.tabControl.SuspendLayout();
    6071      this.operatorGraphTabPage.SuspendLayout();
    6172      this.globalScopeTabPage.SuspendLayout();
     73      this.problemTabPage.SuspendLayout();
    6274      this.SuspendLayout();
    6375      //
     
    8799                  | System.Windows.Forms.AnchorStyles.Right)));
    88100      this.operatorGraphView.Caption = "Operator Graph";
    89       this.operatorGraphView.Location = new System.Drawing.Point(6, 6);
     101      this.operatorGraphView.Content = null;
     102      this.operatorGraphView.Location = new System.Drawing.Point(6, 36);
    90103      this.operatorGraphView.Name = "operatorGraphView";
    91       this.operatorGraphView.Size = new System.Drawing.Size(782, 573);
    92       this.operatorGraphView.TabIndex = 0;
     104      this.operatorGraphView.Size = new System.Drawing.Size(782, 542);
     105      this.operatorGraphView.TabIndex = 3;
    93106      //
    94107      // scopeView
     
    98111                  | System.Windows.Forms.AnchorStyles.Right)));
    99112      this.scopeView.Caption = "Scope";
     113      this.scopeView.Content = null;
    100114      this.scopeView.Location = new System.Drawing.Point(6, 6);
    101115      this.scopeView.Name = "scopeView";
    102       this.scopeView.Size = new System.Drawing.Size(782, 573);
     116      this.scopeView.Size = new System.Drawing.Size(782, 572);
    103117      this.scopeView.TabIndex = 0;
    104118      //
     
    107121      this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    108122      this.resetButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Restart;
    109       this.resetButton.Location = new System.Drawing.Point(58, 617);
     123      this.resetButton.Location = new System.Drawing.Point(60, 616);
    110124      this.resetButton.Name = "resetButton";
    111       this.resetButton.Size = new System.Drawing.Size(23, 23);
     125      this.resetButton.Size = new System.Drawing.Size(24, 24);
    112126      this.resetButton.TabIndex = 3;
    113127      this.toolTip.SetToolTip(this.resetButton, "Reset Engine");
     
    120134      this.stopButton.Enabled = false;
    121135      this.stopButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
    122       this.stopButton.Location = new System.Drawing.Point(29, 617);
     136      this.stopButton.Location = new System.Drawing.Point(30, 616);
    123137      this.stopButton.Name = "stopButton";
    124       this.stopButton.Size = new System.Drawing.Size(23, 23);
     138      this.stopButton.Size = new System.Drawing.Size(24, 24);
    125139      this.stopButton.TabIndex = 2;
    126140      this.toolTip.SetToolTip(this.stopButton, "Stop Engine");
     
    132146      this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    133147      this.startButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
    134       this.startButton.Location = new System.Drawing.Point(0, 617);
     148      this.startButton.Location = new System.Drawing.Point(0, 616);
    135149      this.startButton.Name = "startButton";
    136       this.startButton.Size = new System.Drawing.Size(23, 23);
     150      this.startButton.Size = new System.Drawing.Size(24, 24);
    137151      this.startButton.TabIndex = 1;
    138152      this.toolTip.SetToolTip(this.startButton, "Start Engine");
    139153      this.startButton.UseVisualStyleBackColor = true;
    140154      this.startButton.Click += new System.EventHandler(this.startButton_Click);
     155      //
     156      // newProblemButton
     157      //
     158      this.newProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;
     159      this.newProblemButton.Location = new System.Drawing.Point(6, 6);
     160      this.newProblemButton.Name = "newProblemButton";
     161      this.newProblemButton.Size = new System.Drawing.Size(24, 24);
     162      this.newProblemButton.TabIndex = 0;
     163      this.toolTip.SetToolTip(this.newProblemButton, "Create New Problem");
     164      this.newProblemButton.UseVisualStyleBackColor = true;
     165      this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);
     166      //
     167      // openProblemButton
     168      //
     169      this.openProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;
     170      this.openProblemButton.Location = new System.Drawing.Point(36, 6);
     171      this.openProblemButton.Name = "openProblemButton";
     172      this.openProblemButton.Size = new System.Drawing.Size(24, 24);
     173      this.openProblemButton.TabIndex = 1;
     174      this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");
     175      this.openProblemButton.UseVisualStyleBackColor = true;
     176      this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);
     177      //
     178      // saveProblemButton
     179      //
     180      this.saveProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;
     181      this.saveProblemButton.Location = new System.Drawing.Point(66, 6);
     182      this.saveProblemButton.Name = "saveProblemButton";
     183      this.saveProblemButton.Size = new System.Drawing.Size(24, 24);
     184      this.saveProblemButton.TabIndex = 2;
     185      this.toolTip.SetToolTip(this.saveProblemButton, "Save Problem");
     186      this.saveProblemButton.UseVisualStyleBackColor = true;
     187      this.saveProblemButton.Click += new System.EventHandler(this.saveProblemButton_Click);
     188      //
     189      // newOperatorGraphButton
     190      //
     191      this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;
     192      this.newOperatorGraphButton.Location = new System.Drawing.Point(6, 6);
     193      this.newOperatorGraphButton.Name = "newOperatorGraphButton";
     194      this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     195      this.newOperatorGraphButton.TabIndex = 0;
     196      this.toolTip.SetToolTip(this.newOperatorGraphButton, "Create New Operator Graph");
     197      this.newOperatorGraphButton.UseVisualStyleBackColor = true;
     198      this.newOperatorGraphButton.Click += new System.EventHandler(this.newOperatorGraphButton_Click);
     199      //
     200      // openOperatorGraphButton
     201      //
     202      this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;
     203      this.openOperatorGraphButton.Location = new System.Drawing.Point(36, 6);
     204      this.openOperatorGraphButton.Name = "openOperatorGraphButton";
     205      this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     206      this.openOperatorGraphButton.TabIndex = 1;
     207      this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");
     208      this.openOperatorGraphButton.UseVisualStyleBackColor = true;
     209      this.openOperatorGraphButton.Click += new System.EventHandler(this.openOperatorGraphButton_Click);
     210      //
     211      // saveOperatorGraphButton
     212      //
     213      this.saveOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;
     214      this.saveOperatorGraphButton.Location = new System.Drawing.Point(66, 6);
     215      this.saveOperatorGraphButton.Name = "saveOperatorGraphButton";
     216      this.saveOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     217      this.saveOperatorGraphButton.TabIndex = 2;
     218      this.toolTip.SetToolTip(this.saveOperatorGraphButton, "Save Operator Graph");
     219      this.saveOperatorGraphButton.UseVisualStyleBackColor = true;
     220      this.saveOperatorGraphButton.Click += new System.EventHandler(this.saveOperatorGraphButton_Click);
    141221      //
    142222      // tabControl
     
    147227      this.tabControl.Controls.Add(this.operatorGraphTabPage);
    148228      this.tabControl.Controls.Add(this.globalScopeTabPage);
     229      this.tabControl.Controls.Add(this.problemTabPage);
    149230      this.tabControl.Location = new System.Drawing.Point(0, 0);
    150231      this.tabControl.Name = "tabControl";
    151232      this.tabControl.SelectedIndex = 0;
    152       this.tabControl.Size = new System.Drawing.Size(802, 611);
    153       this.tabControl.TabIndex = 0;
     233      this.tabControl.Size = new System.Drawing.Size(802, 610);
     234      this.tabControl.TabIndex = 3;
    154235      //
    155236      // operatorGraphTabPage
    156237      //
     238      this.operatorGraphTabPage.Controls.Add(this.saveOperatorGraphButton);
     239      this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton);
     240      this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton);
    157241      this.operatorGraphTabPage.Controls.Add(this.operatorGraphView);
    158242      this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22);
    159243      this.operatorGraphTabPage.Name = "operatorGraphTabPage";
    160244      this.operatorGraphTabPage.Padding = new System.Windows.Forms.Padding(3);
    161       this.operatorGraphTabPage.Size = new System.Drawing.Size(794, 585);
     245      this.operatorGraphTabPage.Size = new System.Drawing.Size(794, 584);
    162246      this.operatorGraphTabPage.TabIndex = 0;
    163247      this.operatorGraphTabPage.Text = "Operator Graph";
     
    170254      this.globalScopeTabPage.Name = "globalScopeTabPage";
    171255      this.globalScopeTabPage.Padding = new System.Windows.Forms.Padding(3);
    172       this.globalScopeTabPage.Size = new System.Drawing.Size(794, 585);
     256      this.globalScopeTabPage.Size = new System.Drawing.Size(794, 584);
    173257      this.globalScopeTabPage.TabIndex = 1;
    174258      this.globalScopeTabPage.Text = "Global Scope";
    175259      this.globalScopeTabPage.UseVisualStyleBackColor = true;
     260      //
     261      // problemTabPage
     262      //
     263      this.problemTabPage.Controls.Add(this.saveProblemButton);
     264      this.problemTabPage.Controls.Add(this.openProblemButton);
     265      this.problemTabPage.Controls.Add(this.newProblemButton);
     266      this.problemTabPage.Controls.Add(this.problemViewHost);
     267      this.problemTabPage.Location = new System.Drawing.Point(4, 22);
     268      this.problemTabPage.Name = "problemTabPage";
     269      this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);
     270      this.problemTabPage.Size = new System.Drawing.Size(794, 584);
     271      this.problemTabPage.TabIndex = 2;
     272      this.problemTabPage.Text = "Problem";
     273      this.problemTabPage.UseVisualStyleBackColor = true;
     274      //
     275      // problemViewHost
     276      //
     277      this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     278                  | System.Windows.Forms.AnchorStyles.Left)
     279                  | System.Windows.Forms.AnchorStyles.Right)));
     280      this.problemViewHost.Content = null;
     281      this.problemViewHost.Location = new System.Drawing.Point(6, 36);
     282      this.problemViewHost.Name = "problemViewHost";
     283      this.problemViewHost.Size = new System.Drawing.Size(782, 542);
     284      this.problemViewHost.TabIndex = 3;
     285      //
     286      // openFileDialog
     287      //
     288      this.openFileDialog.DefaultExt = "hl";
     289      this.openFileDialog.FileName = "Item";
     290      this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";
     291      this.openFileDialog.Title = "Open File";
     292      //
     293      // saveFileDialog
     294      //
     295      this.saveFileDialog.DefaultExt = "hl";
     296      this.saveFileDialog.FileName = "Item";
     297      this.saveFileDialog.Filter = "Uncompressed HeuristicLab Files|*.hl|HeuristicLab Files|*.hl|All Files|*.*";
     298      this.saveFileDialog.FilterIndex = 2;
     299      this.saveFileDialog.Title = "Save File";
    176300      //
    177301      // EngineView
     
    190314      this.operatorGraphTabPage.ResumeLayout(false);
    191315      this.globalScopeTabPage.ResumeLayout(false);
     316      this.problemTabPage.ResumeLayout(false);
    192317      this.ResumeLayout(false);
    193318      this.PerformLayout();
     
    208333    protected System.Windows.Forms.TabPage operatorGraphTabPage;
    209334    protected System.Windows.Forms.TabPage globalScopeTabPage;
     335    protected System.Windows.Forms.TabPage problemTabPage;
     336    protected ViewHost problemViewHost;
     337    protected System.Windows.Forms.Button newProblemButton;
     338    protected System.Windows.Forms.Button saveOperatorGraphButton;
     339    protected System.Windows.Forms.Button openOperatorGraphButton;
     340    protected System.Windows.Forms.Button newOperatorGraphButton;
     341    protected System.Windows.Forms.Button saveProblemButton;
     342    protected System.Windows.Forms.Button openProblemButton;
     343    protected System.Windows.Forms.OpenFileDialog openFileDialog;
     344    protected System.Windows.Forms.SaveFileDialog saveFileDialog;
    210345
    211346  }
  • trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.cs

    r2790 r2796  
    3030using HeuristicLab.Common;
    3131using HeuristicLab.MainForm;
     32using HeuristicLab.Persistence.Default.Xml;
    3233
    3334namespace HeuristicLab.Core.Views {
     
    3839  [Content(typeof(IEngine), false)]
    3940  public partial class EngineView : ItemView {
     41    protected TypeSelectorDialog typeSelectorDialog;
    4042    private int executionTimeCounter;
    4143
     
    6668    protected override void DeregisterContentEvents() {
    6769      Content.OperatorGraphChanged -= new EventHandler(Content_OperatorGraphChanged);
     70      Content.ProblemChanged -= new EventHandler(Content_ProblemChanged);
    6871      Content.Prepared -= new EventHandler(Content_Prepared);
    6972      Content.Started -= new EventHandler(Content_Started);
     
    8184      base.RegisterContentEvents();
    8285      Content.OperatorGraphChanged += new EventHandler(Content_OperatorGraphChanged);
     86      Content.ProblemChanged += new EventHandler(Content_ProblemChanged);
    8387      Content.Prepared += new EventHandler(Content_Prepared);
    8488      Content.Started += new EventHandler(Content_Started);
     
    96100      stopButton.Enabled = false;
    97101      if (Content == null) {
     102        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = false;
    98103        operatorGraphView.Enabled = false;
    99104        scopeView.Enabled = false;
    100         startButton.Enabled = false;
    101         resetButton.Enabled = false;
     105        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;
     106        problemViewHost.Enabled = false;
     107        startButton.Enabled = resetButton.Enabled = false;
    102108        executionTimeTextBox.Enabled = false;
    103109      } else {
     110        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = true;
    104111        operatorGraphView.Content = Content.OperatorGraph;
     112        operatorGraphView.Enabled = true;
    105113        scopeView.Content = Content.GlobalScope;
     114        scopeView.Enabled = true;
     115        newProblemButton.Enabled = openProblemButton.Enabled = true;
     116        saveProblemButton.Enabled = Content.Problem != null;
     117        problemViewHost.Content = Content.Problem;
     118        problemViewHost.Enabled = true;
    106119        startButton.Enabled = !Content.Finished;
    107120        resetButton.Enabled = true;
     
    118131        operatorGraphView.Content = Content.OperatorGraph;
    119132    }
     133    protected void Content_ProblemChanged(object sender, EventArgs e) {
     134      if (InvokeRequired)
     135        Invoke(new EventHandler(Content_ProblemChanged), sender, e);
     136      else {
     137        saveProblemButton.Enabled = Content.Problem != null;
     138        problemViewHost.Content = Content.Problem;
     139      }
     140    }
    120141    protected virtual void Content_Prepared(object sender, EventArgs e) {
    121142      if (InvokeRequired)
    122143        Invoke(new EventHandler(Content_Prepared), sender, e);
    123144      else {
     145        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = true;
    124146        operatorGraphView.Enabled = true;
    125147        scopeView.Enabled = true;
     148        newProblemButton.Enabled = openProblemButton.Enabled = true;
     149        saveProblemButton.Enabled = Content.Problem != null;
     150        problemViewHost.Enabled = true;
    126151        startButton.Enabled = !Content.Finished;
    127152        stopButton.Enabled = false;
     
    135160        Invoke(new EventHandler(Content_Started), sender, e);
    136161      else {
     162        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = false;
    137163        operatorGraphView.Enabled = false;
    138164        scopeView.Enabled = false;
     165        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;
     166        problemViewHost.Enabled = false;
    139167        startButton.Enabled = false;
    140168        stopButton.Enabled = true;
     
    147175        Invoke(new EventHandler(Content_Stopped), sender, e);
    148176      else {
     177        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = true;
    149178        operatorGraphView.Enabled = true;
    150179        scopeView.Enabled = true;
     180        newProblemButton.Enabled = openProblemButton.Enabled = true;
     181        saveProblemButton.Enabled = Content.Problem != null;
     182        problemViewHost.Enabled = true;
    151183        startButton.Enabled = !Content.Finished;
    152184        stopButton.Enabled = false;
     
    171203
    172204    #region Button events
     205    protected void newOperatorGraphButton_Click(object sender, EventArgs e) {
     206      Content.OperatorGraph = new OperatorGraph();
     207    }
     208    protected void openOperatorGraphButton_Click(object sender, EventArgs e) {
     209      openFileDialog.Title = "Open Operator Graph";
     210      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     211        OperatorGraph operatorGraph = null;
     212        try {
     213          operatorGraph = XmlParser.Deserialize(openFileDialog.FileName) as OperatorGraph;
     214        }
     215        catch (Exception ex) {
     216          Auxiliary.ShowErrorMessageBox(ex);
     217        }
     218        if (operatorGraph == null)
     219          MessageBox.Show(this, "Selected file does not contain an operator graph.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
     220        else
     221          Content.OperatorGraph = operatorGraph;
     222      }
     223    }
     224    protected void saveOperatorGraphButton_Click(object sender, EventArgs e) {
     225      saveFileDialog.Title = "Save Operator Graph";
     226      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
     227        try {
     228          if (saveFileDialog.FilterIndex == 1)
     229            XmlGenerator.Serialize(Content.OperatorGraph, saveFileDialog.FileName, 0);
     230          else
     231            XmlGenerator.Serialize(Content.OperatorGraph, saveFileDialog.FileName, 9);
     232        }
     233        catch (Exception ex) {
     234          Auxiliary.ShowErrorMessageBox(ex);
     235        }
     236      }
     237    }
     238    protected void newProblemButton_Click(object sender, EventArgs e) {
     239      if (typeSelectorDialog == null) {
     240        typeSelectorDialog = new TypeSelectorDialog();
     241      }
     242      typeSelectorDialog.Caption = "Select Problem";
     243      typeSelectorDialog.TypeSelector.Configure(typeof(IProblem), false, false);
     244
     245      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     246        Content.Problem = (IProblem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     247      }
     248    }
     249    protected void openProblemButton_Click(object sender, EventArgs e) {
     250      openFileDialog.Title = "Open Problem";
     251      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     252        IProblem problem = null;
     253        try {
     254          problem = XmlParser.Deserialize(openFileDialog.FileName) as IProblem;
     255        }
     256        catch (Exception ex) {
     257          Auxiliary.ShowErrorMessageBox(ex);
     258        }
     259        if (problem == null)
     260          MessageBox.Show(this, "Selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
     261        else
     262          Content.Problem = problem;
     263      }
     264    }
     265    protected void saveProblemButton_Click(object sender, EventArgs e) {
     266      saveFileDialog.Title = "Save Problem";
     267      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
     268        try {
     269          if (saveFileDialog.FilterIndex == 1)
     270            XmlGenerator.Serialize(Content.Problem, saveFileDialog.FileName, 0);
     271          else
     272            XmlGenerator.Serialize(Content.Problem, saveFileDialog.FileName, 9);
     273        }
     274        catch (Exception ex) {
     275          Auxiliary.ShowErrorMessageBox(ex);
     276        }
     277      }
     278    }
    173279    protected virtual void startButton_Click(object sender, EventArgs e) {
    174280      Content.Start();
  • trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj

    r2754 r2796  
    5353  <ItemGroup>
    5454    <None Include="HeuristicLabCoreViewsPlugin.cs.frame" />
     55    <Compile Include="ValueParameterCollectionView.cs">
     56      <SubType>UserControl</SubType>
     57    </Compile>
     58    <Compile Include="ValueParameterCollectionView.Designer.cs">
     59      <DependentUpon>ValueParameterCollectionView.cs</DependentUpon>
     60    </Compile>
    5561    <Compile Include="ItemArrayView.cs">
    5662      <SubType>UserControl</SubType>
     
    107113    <Compile Include="OperatorTreeView.Designer.cs">
    108114      <DependentUpon>OperatorTreeView.cs</DependentUpon>
     115    </Compile>
     116    <Compile Include="OperatorView.cs">
     117      <SubType>UserControl</SubType>
     118    </Compile>
     119    <Compile Include="OperatorView.Designer.cs">
     120      <DependentUpon>OperatorView.cs</DependentUpon>
     121    </Compile>
     122    <Compile Include="ProblemView.cs">
     123      <SubType>UserControl</SubType>
     124    </Compile>
     125    <Compile Include="ProblemView.Designer.cs">
     126      <DependentUpon>ProblemView.cs</DependentUpon>
    109127    </Compile>
    110128    <Compile Include="TypeSelectorDialog.cs">
     
    223241      <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    224242      <Name>HeuristicLab.MainForm-3.2</Name>
     243    </ProjectReference>
     244    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
     245      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
     246      <Name>HeuristicLab.Persistence-3.3</Name>
    225247    </ProjectReference>
    226248    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
  • trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLabCoreViewsPlugin.cs.frame

    r2790 r2796  
    3737  [PluginDependency("HeuristicLab.MainForm", "3.2")]
    3838  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.2")]
     39  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    3940  public class HeuristicLabCoreViewsPlugin : PluginBase {
    4041  }
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs

    r2790 r2796  
    9696      this.moveUpButton.Location = new System.Drawing.Point(3, 3);
    9797      this.moveUpButton.Name = "moveUpButton";
    98       this.moveUpButton.Size = new System.Drawing.Size(23, 23);
     98      this.moveUpButton.Size = new System.Drawing.Size(24, 24);
    9999      this.moveUpButton.TabIndex = 0;
    100100      this.toolTip.SetToolTip(this.moveUpButton, "Move Up");
     
    106106      this.moveDownButton.Enabled = false;
    107107      this.moveDownButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowDown;
    108       this.moveDownButton.Location = new System.Drawing.Point(32, 3);
     108      this.moveDownButton.Location = new System.Drawing.Point(33, 3);
    109109      this.moveDownButton.Name = "moveDownButton";
    110       this.moveDownButton.Size = new System.Drawing.Size(23, 23);
     110      this.moveDownButton.Size = new System.Drawing.Size(24, 24);
    111111      this.moveDownButton.TabIndex = 1;
    112112      this.toolTip.SetToolTip(this.moveDownButton, "Move Down");
     
    124124      this.itemsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    125125      this.itemsListView.HideSelection = false;
    126       this.itemsListView.Location = new System.Drawing.Point(3, 32);
     126      this.itemsListView.Location = new System.Drawing.Point(3, 33);
    127127      this.itemsListView.Name = "itemsListView";
    128128      this.itemsListView.ShowItemToolTips = true;
    129       this.itemsListView.Size = new System.Drawing.Size(194, 287);
     129      this.itemsListView.Size = new System.Drawing.Size(194, 286);
    130130      this.itemsListView.SmallImageList = this.imageList;
    131131      this.itemsListView.TabIndex = 2;
     
    153153                  | System.Windows.Forms.AnchorStyles.Right)));
    154154      this.detailsGroupBox.Controls.Add(this.viewHost);
    155       this.detailsGroupBox.Location = new System.Drawing.Point(3, 26);
     155      this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
    156156      this.detailsGroupBox.Name = "detailsGroupBox";
    157157      this.detailsGroupBox.Size = new System.Drawing.Size(283, 294);
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs

    r2790 r2796  
    104104      this.itemsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    105105      this.itemsListView.HideSelection = false;
    106       this.itemsListView.Location = new System.Drawing.Point(3, 32);
     106      this.itemsListView.Location = new System.Drawing.Point(3, 33);
    107107      this.itemsListView.Name = "itemsListView";
    108108      this.itemsListView.ShowItemToolTips = true;
    109       this.itemsListView.Size = new System.Drawing.Size(244, 328);
     109      this.itemsListView.Size = new System.Drawing.Size(244, 327);
    110110      this.itemsListView.SmallImageList = this.imageList;
    111111      this.itemsListView.TabIndex = 4;
     
    131131      this.sortDescendingButton.Enabled = false;
    132132      this.sortDescendingButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.SortUp;
    133       this.sortDescendingButton.Location = new System.Drawing.Point(32, 3);
     133      this.sortDescendingButton.Location = new System.Drawing.Point(33, 3);
    134134      this.sortDescendingButton.Name = "sortDescendingButton";
    135       this.sortDescendingButton.Size = new System.Drawing.Size(23, 23);
     135      this.sortDescendingButton.Size = new System.Drawing.Size(24, 24);
    136136      this.sortDescendingButton.TabIndex = 1;
    137137      this.toolTip.SetToolTip(this.sortDescendingButton, "Sort Descending");
     
    143143      this.sortAscendingButton.Enabled = false;
    144144      this.sortAscendingButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Sort;
    145       this.sortAscendingButton.Location = new System.Drawing.Point(61, 3);
     145      this.sortAscendingButton.Location = new System.Drawing.Point(63, 3);
    146146      this.sortAscendingButton.Name = "sortAscendingButton";
    147       this.sortAscendingButton.Size = new System.Drawing.Size(23, 23);
     147      this.sortAscendingButton.Size = new System.Drawing.Size(24, 24);
    148148      this.sortAscendingButton.TabIndex = 2;
    149149      this.toolTip.SetToolTip(this.sortAscendingButton, "Sort Ascending");
     
    155155      this.removeButton.Enabled = false;
    156156      this.removeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    157       this.removeButton.Location = new System.Drawing.Point(90, 3);
     157      this.removeButton.Location = new System.Drawing.Point(93, 3);
    158158      this.removeButton.Name = "removeButton";
    159       this.removeButton.Size = new System.Drawing.Size(23, 23);
     159      this.removeButton.Size = new System.Drawing.Size(24, 24);
    160160      this.removeButton.TabIndex = 3;
    161161      this.toolTip.SetToolTip(this.removeButton, "Remove");
     
    168168      this.addButton.Location = new System.Drawing.Point(3, 3);
    169169      this.addButton.Name = "addButton";
    170       this.addButton.Size = new System.Drawing.Size(23, 23);
     170      this.addButton.Size = new System.Drawing.Size(24, 24);
    171171      this.addButton.TabIndex = 0;
    172172      this.toolTip.SetToolTip(this.addButton, "Add");
     
    180180                  | System.Windows.Forms.AnchorStyles.Right)));
    181181      this.detailsGroupBox.Controls.Add(this.viewHost);
    182       this.detailsGroupBox.Location = new System.Drawing.Point(3, 26);
     182      this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
    183183      this.detailsGroupBox.Name = "detailsGroupBox";
    184184      this.detailsGroupBox.Size = new System.Drawing.Size(266, 335);
     
    192192                  | System.Windows.Forms.AnchorStyles.Left)
    193193                  | System.Windows.Forms.AnchorStyles.Right)));
     194      this.viewHost.Content = null;
    194195      this.viewHost.Location = new System.Drawing.Point(6, 19);
    195196      this.viewHost.Name = "viewHost";
    196       this.viewHost.Content = null;
    197197      this.viewHost.Size = new System.Drawing.Size(254, 310);
    198198      this.viewHost.TabIndex = 0;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs

    r2790 r2796  
    9696      this.removeButton.Enabled = false;
    9797      this.removeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    98       this.removeButton.Location = new System.Drawing.Point(90, 3);
     98      this.removeButton.Location = new System.Drawing.Point(93, 3);
    9999      this.removeButton.Name = "removeButton";
    100       this.removeButton.Size = new System.Drawing.Size(23, 23);
     100      this.removeButton.Size = new System.Drawing.Size(24, 24);
    101101      this.removeButton.TabIndex = 3;
    102102      this.toolTip.SetToolTip(this.removeButton, "Remove");
     
    108108      this.moveUpButton.Enabled = false;
    109109      this.moveUpButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowUp;
    110       this.moveUpButton.Location = new System.Drawing.Point(32, 3);
     110      this.moveUpButton.Location = new System.Drawing.Point(33, 3);
    111111      this.moveUpButton.Name = "moveUpButton";
    112       this.moveUpButton.Size = new System.Drawing.Size(23, 23);
     112      this.moveUpButton.Size = new System.Drawing.Size(24, 24);
    113113      this.moveUpButton.TabIndex = 1;
    114114      this.toolTip.SetToolTip(this.moveUpButton, "Move Up");
     
    120120      this.moveDownButton.Enabled = false;
    121121      this.moveDownButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowDown;
    122       this.moveDownButton.Location = new System.Drawing.Point(61, 3);
     122      this.moveDownButton.Location = new System.Drawing.Point(63, 3);
    123123      this.moveDownButton.Name = "moveDownButton";
    124       this.moveDownButton.Size = new System.Drawing.Size(23, 23);
     124      this.moveDownButton.Size = new System.Drawing.Size(24, 24);
    125125      this.moveDownButton.TabIndex = 2;
    126126      this.toolTip.SetToolTip(this.moveDownButton, "Move Down");
     
    138138      this.itemsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    139139      this.itemsListView.HideSelection = false;
    140       this.itemsListView.Location = new System.Drawing.Point(3, 32);
     140      this.itemsListView.Location = new System.Drawing.Point(3, 33);
    141141      this.itemsListView.Name = "itemsListView";
    142142      this.itemsListView.ShowItemToolTips = true;
    143       this.itemsListView.Size = new System.Drawing.Size(194, 287);
     143      this.itemsListView.Size = new System.Drawing.Size(194, 286);
    144144      this.itemsListView.SmallImageList = this.imageList;
    145145      this.itemsListView.TabIndex = 4;
     
    166166      this.addButton.Location = new System.Drawing.Point(3, 3);
    167167      this.addButton.Name = "addButton";
    168       this.addButton.Size = new System.Drawing.Size(23, 23);
     168      this.addButton.Size = new System.Drawing.Size(24, 24);
    169169      this.addButton.TabIndex = 0;
    170170      this.toolTip.SetToolTip(this.addButton, "Add");
     
    178178                  | System.Windows.Forms.AnchorStyles.Right)));
    179179      this.detailsGroupBox.Controls.Add(this.viewHost);
    180       this.detailsGroupBox.Location = new System.Drawing.Point(3, 26);
     180      this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
    181181      this.detailsGroupBox.Name = "detailsGroupBox";
    182182      this.detailsGroupBox.Size = new System.Drawing.Size(283, 294);
     
    190190                  | System.Windows.Forms.AnchorStyles.Left)
    191191                  | System.Windows.Forms.AnchorStyles.Right)));
     192      this.viewHost.Content = null;
    192193      this.viewHost.Location = new System.Drawing.Point(6, 19);
    193194      this.viewHost.Name = "viewHost";
    194       this.viewHost.Content = null;
    195195      this.viewHost.Size = new System.Drawing.Size(271, 269);
    196196      this.viewHost.TabIndex = 0;
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorView.Designer.cs

    r2795 r2796  
    2020#endregion
    2121
    22 namespace HeuristicLab.Operators.Views {
     22namespace HeuristicLab.Core.Views {
    2323  partial class OperatorView {
    2424    /// <summary>
     
    9494    protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    9595
    96 
    9796  }
    9897}
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorView.cs

    r2795 r2796  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    28 using System.Windows.Forms;
    29 using HeuristicLab.Core;
    30 using HeuristicLab.Core.Views;
    3122using HeuristicLab.MainForm;
    3223
    33 namespace HeuristicLab.Operators.Views {
     24namespace HeuristicLab.Core.Views {
    3425  /// <summary>
    3526  /// The base class for visual representations of items.
  • trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs

    r2727 r2796  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.ComponentModel;
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs

    r2790 r2796  
    112112                  | System.Windows.Forms.AnchorStyles.Right)));
    113113      this.valuePanel.Controls.Add(this.viewHost);
    114       this.valuePanel.Location = new System.Drawing.Point(6, 48);
     114      this.valuePanel.Location = new System.Drawing.Point(6, 49);
    115115      this.valuePanel.Name = "valuePanel";
    116       this.valuePanel.Size = new System.Drawing.Size(347, 100);
     116      this.valuePanel.Size = new System.Drawing.Size(347, 99);
    117117      this.valuePanel.TabIndex = 2;
    118118      this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     
    122122      // viewHost
    123123      //
     124      this.viewHost.Content = null;
    124125      this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    125126      this.viewHost.Location = new System.Drawing.Point(0, 0);
    126127      this.viewHost.Name = "viewHost";
    127       this.viewHost.Content = null;
    128       this.viewHost.Size = new System.Drawing.Size(347, 100);
     128      this.viewHost.Size = new System.Drawing.Size(347, 99);
    129129      this.viewHost.TabIndex = 0;
    130130      //
     
    132132      //
    133133      this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    134       this.clearValueButton.Location = new System.Drawing.Point(35, 19);
     134      this.clearValueButton.Location = new System.Drawing.Point(36, 19);
    135135      this.clearValueButton.Name = "clearValueButton";
    136       this.clearValueButton.Size = new System.Drawing.Size(23, 23);
     136      this.clearValueButton.Size = new System.Drawing.Size(24, 24);
    137137      this.clearValueButton.TabIndex = 1;
    138138      this.toolTip.SetToolTip(this.clearValueButton, "Clear Value");
     
    145145      this.setValueButton.Location = new System.Drawing.Point(6, 19);
    146146      this.setValueButton.Name = "setValueButton";
    147       this.setValueButton.Size = new System.Drawing.Size(23, 23);
     147      this.setValueButton.Size = new System.Drawing.Size(24, 24);
    148148      this.setValueButton.TabIndex = 1;
    149149      this.toolTip.SetToolTip(this.setValueButton, "Set Value");
Note: See TracChangeset for help on using the changeset viewer.