Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/13/10 04:37:49 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • implemented reviewers' comments
  • added additional plugins HeuristicLab.Evolutionary, HeuristicLab.Permutation, HeuristicLab.Selection, and HeuristicLab.Routing.TSP
Location:
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs

    r2713 r2790  
    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.Linq;
    4 using System.Text;
    525using System.Windows.Forms;
    6 using System.Drawing;
    726using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    9 using HeuristicLab.Common.Resources;
    1027
    1128namespace HeuristicLab.Optimizer.MenuItems {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs

    r2713 r2790  
    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;
    3 using System.Linq;
    4 using System.Text;
    524using System.Windows.Forms;
    6 using System.Drawing;
    725using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    9 using HeuristicLab.Common.Resources;
    1026
    1127namespace HeuristicLab.Optimizer.MenuItems {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/ExitMenuItem.cs

    r2713 r2790  
    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
    222using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    523using System.Windows.Forms;
    6 using System.Drawing;
    724using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    9 using HeuristicLab.Common.Resources;
    1025
    1126namespace HeuristicLab.Optimizer.MenuItems {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/NewMenuItem.cs

    r2713 r2790  
    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
    222using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     23using System.Drawing;
    524using System.Windows.Forms;
    6 using System.Drawing;
    7 using HeuristicLab.MainForm.WindowsForms;
    825using HeuristicLab.Common.Resources;
    926
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OpenMenuItem.cs

    r2713 r2790  
    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
    222using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     23using System.Drawing;
    524using System.Windows.Forms;
    6 using System.Drawing;
    7 using HeuristicLab.MainForm.WindowsForms;
    825using HeuristicLab.Common.Resources;
    926
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OperatorsMenuItem.cs

    r2713 r2790  
    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.Linq;
    4 using System.Text;
    525using System.Windows.Forms;
    6 using System.Drawing;
     26using HeuristicLab.Core.Views;
    727using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    9 using HeuristicLab.Common.Resources;
    10 using HeuristicLab.Core;
    11 using HeuristicLab.Core.Views;
    1228
    1329namespace HeuristicLab.Optimizer.MenuItems {
    1430  internal class OperatorsMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    15     private OperatorsSidebar view;
    1631    private ToolStripMenuItem menuItem;
    1732
     
    2742
    2843    protected override void OnToolStripItemSet(EventArgs e) {
    29       view = new OperatorsSidebar();
    30       view.Dock = DockStyle.Left;
     44      MainFormManager.MainForm.ViewShown += new EventHandler<ViewShownEventArgs>(MainForm_ViewShown);
    3145      MainFormManager.MainForm.ViewHidden += new EventHandler<ViewEventArgs>(MainForm_ViewHidden);
    3246
    3347      menuItem = ToolStripItem as ToolStripMenuItem;
    34       if (menuItem != null) {
    35         menuItem.Checked = true;
     48      if (menuItem != null)
    3649        menuItem.CheckOnClick = true;
    37       }
    38       view.Show();
    3950    }
    4051
     52    private void MainForm_ViewShown(object sender, ViewShownEventArgs e) {
     53      if ((e.View is OperatorsSidebar) && (menuItem != null))
     54        menuItem.Checked = true;
     55    }
    4156    private void MainForm_ViewHidden(object sender, ViewEventArgs e) {
    42       if ((e.View == view) && (menuItem != null))
     57      if ((e.View is OperatorsSidebar) && (menuItem != null))
    4358        menuItem.Checked = false;
    4459    }
    4560
    4661    public override void Execute() {
    47       if (menuItem != null) {
    48         if (menuItem.Checked)
    49           view.Show();
    50         else
    51           view.Hide();
    52       } else {
     62      var view = (from v in MainFormManager.MainForm.Views
     63                 where v is OperatorsSidebar
     64                 select v as OperatorsSidebar).FirstOrDefault();
     65      if (view.IsShown)
     66        view.Hide();
     67      else
    5368        view.Show();
    54       }
    5569    }
    5670  }
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs

    r2713 r2790  
    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;
     24using System.Drawing;
    325using System.Linq;
    4 using System.Text;
    526using System.Windows.Forms;
    6 using System.Drawing;
    7 using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    927using HeuristicLab.Common.Resources;
    1028using HeuristicLab.Core;
    11 using HeuristicLab.Core.Views;
     29using HeuristicLab.MainForm;
    1230
    1331namespace HeuristicLab.Optimizer.MenuItems {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs

    r2713 r2790  
    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;
    3 using System.Linq;
    4 using System.Text;
    524using System.Windows.Forms;
    6 using System.Drawing;
     25using HeuristicLab.Core;
    726using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    9 using HeuristicLab.Common.Resources;
    10 using HeuristicLab.Core;
    11 using HeuristicLab.Core.Views;
    1227
    1328namespace HeuristicLab.Optimizer.MenuItems {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs

    r2713 r2790  
    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;
    3 using System.Linq;
    4 using System.Text;
     24using System.Drawing;
    525using System.Windows.Forms;
    6 using System.Drawing;
    7 using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    926using HeuristicLab.Common.Resources;
    1027using HeuristicLab.Core;
    11 using HeuristicLab.Core.Views;
     28using HeuristicLab.MainForm;
    1229
    1330namespace HeuristicLab.Optimizer.MenuItems {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/Separators.cs

    r2708 r2790  
    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
    222using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Windows.Forms;
    6 using System.Drawing;
    723using HeuristicLab.MainForm;
    8 using HeuristicLab.MainForm.WindowsForms;
    9 using HeuristicLab.Common.Resources;
    1024
    1125namespace HeuristicLab.Optimizer.MenuItems {
Note: See TracChangeset for help on using the changeset viewer.