Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/Controller.cs
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/Controller.cs	(revision 7999)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/Controller.cs	(revision 8000)
@@ -30,4 +30,5 @@
 
 using System;
+using HeuristicLab.Netron.CustomTools;
 using Netron.Diagramming.Core;
 
@@ -40,4 +41,5 @@
     public Controller(IDiagramControl surface)
       : base(surface) {
+      base.AddTool(new CustomPanTool());
     }
 
Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/CustomTools/CustomPanTool.cs
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/CustomTools/CustomPanTool.cs	(revision 8000)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/CustomTools/CustomPanTool.cs	(revision 8000)
@@ -0,0 +1,91 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Drawing;
+using System.Windows.Forms;
+using Netron.Diagramming.Core;
+
+namespace HeuristicLab.Netron.CustomTools {
+  public class CustomPanTool : AbstractTool, IMouseListener, IKeyboardListener {
+    public const string ToolName = "Custom Pan Tool";
+
+    private Point initialLocation = Point.Empty;
+    private Point previousMouseLocation = Point.Empty;
+
+    public CustomPanTool() : base(ToolName) { }
+
+    public CustomPanTool(string toolName) : base(toolName) { }
+
+    protected override void OnActivateTool() {
+      base.OnActivateTool();
+      Cursor = CursorPalette.Pan;
+    }
+
+    #region IMouseListener Members
+    public bool MouseDown(MouseEventArgs e) {
+      this.previousMouseLocation = Point.Round(Controller.View.WorldToView(e.Location));
+      this.initialLocation = previousMouseLocation;
+      return true;
+    }
+
+    public void MouseMove(MouseEventArgs e) {
+      Point currentLocation = Point.Round(Controller.View.WorldToView(e.Location));
+      if (!IsSuspended && IsActive) {
+        IDiagramControl control = Controller.ParentControl;
+        Point origin = Controller.View.Origin;
+
+        Point offset = new Point(previousMouseLocation.X - currentLocation.X, previousMouseLocation.Y - currentLocation.Y);
+
+        origin.Offset(offset);
+
+        if (origin.X < 0) origin.X = 0;
+
+
+        if (origin.Y < 0) origin.Y = 0;
+
+        control.AutoScrollPosition = origin;
+        Controller.View.Origin = origin;
+        previousMouseLocation = currentLocation;
+      }
+    }
+
+    public void MouseUp(MouseEventArgs e) {
+      //if (IsActive && !IsSuspended) this.previousMouseLocation = Point.Empty;
+    }
+    #endregion
+
+    #region IKeyboardListener Members
+    public void KeyDown(KeyEventArgs e) {
+      if (e.KeyCode == Keys.Escape)
+        DeactivateTool();
+      else if (e.KeyCode == Keys.Space)
+        ActivateTool();
+    }
+
+    public void KeyUp(KeyEventArgs e) {
+      if (e.KeyCode == Keys.Space)
+        DeactivateTool();
+    }
+
+    public void KeyPress(KeyPressEventArgs e) { }
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446.csproj
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446.csproj	(revision 7999)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446.csproj	(revision 8000)
@@ -109,4 +109,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CustomTools\CustomPanTool.cs" />
     <Compile Include="ExpandableIconMaterial.cs" />
     <Compile Include="NetronVisualization.cs">
Index: trunk/sources/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.Designer.cs	(revision 7999)
+++ trunk/sources/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.Designer.cs	(revision 8000)
@@ -59,5 +59,4 @@
       this.relayoutButton = new System.Windows.Forms.Button();
       this.connectButton = new System.Windows.Forms.Button();
-      this.panButton = new System.Windows.Forms.Button();
       this.selectButton = new System.Windows.Forms.Button();
       this.detailsGroupBox = new System.Windows.Forms.GroupBox();
@@ -130,5 +129,4 @@
       this.splitContainer.Panel1.Controls.Add(this.relayoutButton);
       this.splitContainer.Panel1.Controls.Add(this.connectButton);
-      this.splitContainer.Panel1.Controls.Add(this.panButton);
       this.splitContainer.Panel1.Controls.Add(this.selectButton);
       this.splitContainer.Panel1.Controls.Add(this.graphVisualizationInfoView);
@@ -144,8 +142,8 @@
       // 
       this.screenshotButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Image;
-      this.screenshotButton.Location = new System.Drawing.Point(243, 3);
+      this.screenshotButton.Location = new System.Drawing.Point(213, 3);
       this.screenshotButton.Name = "screenshotButton";
       this.screenshotButton.Size = new System.Drawing.Size(24, 24);
-      this.screenshotButton.TabIndex = 8;
+      this.screenshotButton.TabIndex = 7;
       this.buttonToolTip.SetToolTip(this.screenshotButton, "Screenshot");
       this.screenshotButton.UseVisualStyleBackColor = true;
@@ -155,8 +153,8 @@
       // 
       this.zoomOutButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomOut;
-      this.zoomOutButton.Location = new System.Drawing.Point(213, 3);
+      this.zoomOutButton.Location = new System.Drawing.Point(183, 3);
       this.zoomOutButton.Name = "zoomOutButton";
       this.zoomOutButton.Size = new System.Drawing.Size(24, 24);
-      this.zoomOutButton.TabIndex = 7;
+      this.zoomOutButton.TabIndex = 6;
       this.buttonToolTip.SetToolTip(this.zoomOutButton, "Zoom Out");
       this.zoomOutButton.UseVisualStyleBackColor = true;
@@ -166,8 +164,8 @@
       // 
       this.zoomInButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomIn;
-      this.zoomInButton.Location = new System.Drawing.Point(183, 3);
+      this.zoomInButton.Location = new System.Drawing.Point(153, 3);
       this.zoomInButton.Name = "zoomInButton";
       this.zoomInButton.Size = new System.Drawing.Size(24, 24);
-      this.zoomInButton.TabIndex = 6;
+      this.zoomInButton.TabIndex = 5;
       this.buttonToolTip.SetToolTip(this.zoomInButton, "Zoom In");
       this.zoomInButton.UseVisualStyleBackColor = true;
@@ -177,8 +175,8 @@
       // 
       this.zoomToFitButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ActualSize;
-      this.zoomToFitButton.Location = new System.Drawing.Point(153, 3);
+      this.zoomToFitButton.Location = new System.Drawing.Point(123, 3);
       this.zoomToFitButton.Name = "zoomAreaButton";
       this.zoomToFitButton.Size = new System.Drawing.Size(24, 24);
-      this.zoomToFitButton.TabIndex = 5;
+      this.zoomToFitButton.TabIndex = 4;
       this.buttonToolTip.SetToolTip(this.zoomToFitButton, "Zoom to Fit");
       this.zoomToFitButton.UseVisualStyleBackColor = true;
@@ -188,8 +186,8 @@
       // 
       this.relayoutButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.RefreshDocument;
-      this.relayoutButton.Location = new System.Drawing.Point(123, 3);
+      this.relayoutButton.Location = new System.Drawing.Point(93, 3);
       this.relayoutButton.Name = "relayoutButton";
       this.relayoutButton.Size = new System.Drawing.Size(24, 24);
-      this.relayoutButton.TabIndex = 4;
+      this.relayoutButton.TabIndex = 3;
       this.buttonToolTip.SetToolTip(this.relayoutButton, "Relayout Graph");
       this.relayoutButton.UseVisualStyleBackColor = true;
@@ -199,22 +197,11 @@
       // 
       this.connectButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Interface;
-      this.connectButton.Location = new System.Drawing.Point(63, 3);
+      this.connectButton.Location = new System.Drawing.Point(33, 3);
       this.connectButton.Name = "connectButton";
       this.connectButton.Size = new System.Drawing.Size(24, 24);
-      this.connectButton.TabIndex = 3;
+      this.connectButton.TabIndex = 2;
       this.buttonToolTip.SetToolTip(this.connectButton, "Connection Tool");
       this.connectButton.UseVisualStyleBackColor = true;
       this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
-      // 
-      // panButton
-      // 
-      this.panButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Breakpoint;
-      this.panButton.Location = new System.Drawing.Point(33, 3);
-      this.panButton.Name = "panButton";
-      this.panButton.Size = new System.Drawing.Size(24, 24);
-      this.panButton.TabIndex = 2;
-      this.buttonToolTip.SetToolTip(this.panButton, "Pan Tool");
-      this.panButton.UseVisualStyleBackColor = true;
-      this.panButton.Click += new System.EventHandler(this.panButton_Click);
       // 
       // selectButton
@@ -290,5 +277,4 @@
     private System.Windows.Forms.Button relayoutButton;
     private System.Windows.Forms.Button connectButton;
-    private System.Windows.Forms.Button panButton;
     private System.Windows.Forms.Button screenshotButton;
     private System.Windows.Forms.ToolTip buttonToolTip;
Index: trunk/sources/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs	(revision 7999)
+++ trunk/sources/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs	(revision 8000)
@@ -27,4 +27,5 @@
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Netron.CustomTools;
 using Netron.Diagramming.Core;
 
@@ -33,4 +34,6 @@
   [Content(typeof(OperatorGraph), true)]
   public partial class OperatorGraphView : AsynchronousContentView {
+    private ITool lastActiveTool;
+
     public OperatorGraphView() {
       InitializeComponent();
@@ -39,4 +42,6 @@
       this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged);
       this.graphVisualizationInfoView.Controller.OnMouseDown += new EventHandler<MouseEventArgs>(Controller_OnMouseDown);
+      this.graphVisualizationInfoView.Controller.ParentControl.MouseDown += new MouseEventHandler(ParentControl_MouseDown);
+      this.graphVisualizationInfoView.Controller.ParentControl.MouseUp += new MouseEventHandler(ParentControl_MouseUp);
       foreach (ITool tool in this.graphVisualizationInfoView.Controller.Tools) {
         tool.OnToolActivate += new EventHandler<ToolEventArgs>(tool_OnToolActivate);
@@ -69,5 +74,4 @@
       if (Content == null) {
         selectButton.Enabled = false;
-        panButton.Enabled = false;
         relayoutButton.Enabled = false;
         zoomToFitButton.Enabled = false;
@@ -79,5 +83,4 @@
       } else {
         selectButton.Enabled = true;
-        panButton.Enabled = true;
         relayoutButton.Enabled = true;
         zoomToFitButton.Enabled = true;
@@ -150,4 +153,18 @@
     }
 
+    void ParentControl_MouseDown(object sender, MouseEventArgs e) {
+      lastActiveTool = this.graphVisualizationInfoView.Controller.ActiveTool;
+      if (e.Button == MouseButtons.Middle) {
+        if (!(lastActiveTool is CustomPanTool)) this.graphVisualizationInfoView.Controller.ActivateTool(CustomPanTool.ToolName);
+      }
+    }
+
+    void ParentControl_MouseUp(object sender, MouseEventArgs e) {
+      if (e.Button == MouseButtons.Middle) {
+        if (lastActiveTool != null) this.graphVisualizationInfoView.Controller.ActivateTool(lastActiveTool.Name);
+        else this.graphVisualizationInfoView.Controller.DeactivateAllTools();
+      }
+    }
+
     #region context menu
     private void Controller_OnShowContextMenu(object sender, EntityMenuEventArgs e) {
@@ -252,7 +269,4 @@
           button = this.selectButton;
           break;
-        case ControllerBase.PanToolName:
-          button = this.panButton;
-          break;
         case ControllerBase.ConnectionToolName:
           button = this.connectButton;
@@ -268,8 +282,4 @@
       ITool tool = this.graphVisualizationInfoView.Controller.Tools.Where(t => t.Name == ControllerBase.SelectionToolName).First();
       this.graphVisualizationInfoView.Controller.DeactivateAllTools();
-    }
-
-    private void panButton_Click(object sender, EventArgs e) {
-      this.graphVisualizationInfoView.Controller.ActivateTool(ControllerBase.PanToolName);
     }
 
