コード例 #1
0
        private void panel_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            QuickNetronPanel panel = (QuickNetronPanel)sender;

            if (e.Delta != 0)
            {
                float zoom = panel.Zoom
                             + e.Delta * SystemInformation.MouseWheelScrollLines / 120.0f / 100;

                panel.Zoom = Math.Abs(zoom);
                panel.Invalidate(true);
            }
        }
コード例 #2
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
     this.mainMenu = new System.Windows.Forms.MainMenu();
     this.menuItem3 = new System.Windows.Forms.MenuItem();
     this.menuItem4 = new System.Windows.Forms.MenuItem();
     this.menuItem6 = new System.Windows.Forms.MenuItem();
     this.menuItem2 = new System.Windows.Forms.MenuItem();
     this.menuItem5 = new System.Windows.Forms.MenuItem();
     this.depthFirstSearchAlgorithmItem = new System.Windows.Forms.MenuItem();
     this.edgeDepthFirstSearchItem = new System.Windows.Forms.MenuItem();
     this.breadthFirstSearchItem = new System.Windows.Forms.MenuItem();
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this.menuItem7 = new System.Windows.Forms.MenuItem();
     this.menuItem8 = new System.Windows.Forms.MenuItem();
     this.statusBar = new System.Windows.Forms.StatusBar();
     this.messageBarPanel = new System.Windows.Forms.StatusBarPanel();
     this.errorBarPanel = new System.Windows.Forms.StatusBarPanel();
     this.toolBar = new System.Windows.Forms.ToolBar();
     this.imageList1 = new System.Windows.Forms.ImageList(this.components);
     this.dockingManagerExtender1 = new DockingManagerExtender.DockingManagerExtender(this.components);
     this.netronPanel = new QuickGraph.Layout.Forms.QuickNetronPanel(this.components);
     this.netronOverview1 = new Netron.UI.NetronOverview();
     ((System.ComponentModel.ISupportInitialize)(this.messageBarPanel)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.errorBarPanel)).BeginInit();
     this.netronPanel.SuspendLayout();
     this.SuspendLayout();
     //
     // mainMenu
     //
     this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                              this.menuItem3,
                                                                              this.menuItem2});
     //
     // menuItem3
     //
     this.menuItem3.Index = 0;
     this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuItem4,
                                                                               this.menuItem6});
     this.menuItem3.Text = "File";
     //
     // menuItem4
     //
     this.menuItem4.Index = 0;
     this.menuItem4.Text = "Load GraphML";
     this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
     //
     // menuItem6
     //
     this.menuItem6.Index = 1;
     this.menuItem6.Text = "Load GXL";
     //
     // menuItem2
     //
     this.menuItem2.Index = 1;
     this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuItem5,
                                                                               this.menuItem1});
     this.menuItem2.Text = "Algorithms";
     //
     // menuItem5
     //
     this.menuItem5.Index = 0;
     this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.depthFirstSearchAlgorithmItem,
                                                                               this.edgeDepthFirstSearchItem,
                                                                               this.breadthFirstSearchItem});
     this.menuItem5.Text = "Search";
     //
     // depthFirstSearchAlgorithmItem
     //
     this.depthFirstSearchAlgorithmItem.Index = 0;
     this.depthFirstSearchAlgorithmItem.Text = "DepthFirstSearchAlgorithm";
     this.depthFirstSearchAlgorithmItem.Click += new System.EventHandler(this.depthFirstSearchAlgorithmItem_Click);
     //
     // edgeDepthFirstSearchItem
     //
     this.edgeDepthFirstSearchItem.Index = 1;
     this.edgeDepthFirstSearchItem.Text = "EdgeDepthFirstSearchAlgorithm";
     this.edgeDepthFirstSearchItem.Click += new System.EventHandler(this.edgeDepthFirstSearchItem_Click);
     //
     // breadthFirstSearchItem
     //
     this.breadthFirstSearchItem.Index = 2;
     this.breadthFirstSearchItem.Text = "BreadthFirstSearchAlgorithm";
     this.breadthFirstSearchItem.Click += new System.EventHandler(this.breadthFirstSearchItem_Click);
     //
     // menuItem1
     //
     this.menuItem1.Index = 1;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuItem7,
                                                                               this.menuItem8});
     this.menuItem1.Text = "Walks";
     //
     // menuItem7
     //
     this.menuItem7.Index = 0;
     this.menuItem7.Text = "Uniform walk";
     this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click);
     //
     // menuItem8
     //
     this.menuItem8.Index = 1;
     this.menuItem8.Text = "Weighted walk";
     this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
     //
     // statusBar
     //
     this.statusBar.Location = new System.Drawing.Point(0, 403);
     this.statusBar.Name = "statusBar";
     this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
                                                                                  this.messageBarPanel,
                                                                                  this.errorBarPanel});
     this.statusBar.Size = new System.Drawing.Size(584, 22);
     this.statusBar.TabIndex = 0;
     this.statusBar.Text = "Status Bar";
     //
     // messageBarPanel
     //
     this.messageBarPanel.Text = "Message";
     //
     // errorBarPanel
     //
     this.errorBarPanel.Alignment = System.Windows.Forms.HorizontalAlignment.Right;
     this.errorBarPanel.Text = "Error";
     this.errorBarPanel.Width = 20;
     //
     // toolBar
     //
     this.toolBar.ButtonSize = new System.Drawing.Size(16, 16);
     this.toolBar.DropDownArrows = true;
     this.toolBar.ImageList = this.imageList1;
     this.toolBar.Location = new System.Drawing.Point(0, 0);
     this.toolBar.Name = "toolBar";
     this.toolBar.ShowToolTips = true;
     this.toolBar.Size = new System.Drawing.Size(584, 22);
     this.toolBar.TabIndex = 1;
     //
     // imageList1
     //
     this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.imageList1.ImageSize = new System.Drawing.Size(32, 32);
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     //
     // dockingManagerExtender1
     //
     this.dockingManagerExtender1.AutomaticStatePersistence = false;
     this.dockingManagerExtender1.ContainerControl = this;
     this.dockingManagerExtender1.InnerControl = null;
     this.dockingManagerExtender1.OuterControl = null;
     this.dockingManagerExtender1.PlainTabBorder = false;
     this.dockingManagerExtender1.VisualStyle = Crownwood.Magic.Common.VisualStyle.IDE;
     //
     // netronPanel
     //
     this.dockingManagerExtender1.SetADockingEnable(this.netronPanel, false);
     this.netronPanel.BackColor = System.Drawing.Color.White;
     this.netronPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.dockingManagerExtender1.SetCloseButton(this.netronPanel, false);
     this.dockingManagerExtender1.SetCloseOnHide(this.netronPanel, false);
     this.netronPanel.Controls.Add(this.netronOverview1);
     this.netronPanel.DataUpdateInterval = 50;
     this.netronPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.dockingManagerExtender1.SetDockingStyle(this.netronPanel, System.Windows.Forms.DockStyle.Left);
     this.netronPanel.Domain = null;
     this.dockingManagerExtender1.SetFullTitle(this.netronPanel, "netronPanel");
     this.netronPanel.Graph = null;
     this.dockingManagerExtender1.SetIcon(this.netronPanel, null);
     this.netronPanel.Location = new System.Drawing.Point(0, 22);
     this.netronPanel.Name = "netronPanel";
     this.netronPanel.Size = new System.Drawing.Size(584, 381);
     this.dockingManagerExtender1.SetTabbedMode(this.netronPanel, true);
     this.netronPanel.TabIndex = 4;
     this.dockingManagerExtender1.SetTitle(this.netronPanel, "netronPanel");
     this.netronPanel.Zoom = 1F;
     //
     // netronOverview1
     //
     this.dockingManagerExtender1.SetADockingEnable(this.netronOverview1, true);
     this.dockingManagerExtender1.SetCloseButton(this.netronOverview1, true);
     this.dockingManagerExtender1.SetCloseOnHide(this.netronOverview1, false);
     this.dockingManagerExtender1.SetDockingStyle(this.netronOverview1, System.Windows.Forms.DockStyle.Left);
     this.dockingManagerExtender1.SetFullTitle(this.netronOverview1, "NetronOverview");
     this.dockingManagerExtender1.SetIcon(this.netronOverview1, null);
     this.netronOverview1.Location = new System.Drawing.Point(24, 16);
     this.netronOverview1.Name = "netronOverview1";
     this.netronOverview1.Panel = null;
     this.netronOverview1.Size = new System.Drawing.Size(224, 248);
     this.dockingManagerExtender1.SetTabbedMode(this.netronOverview1, true);
     this.netronOverview1.TabIndex = 0;
     this.dockingManagerExtender1.SetTitle(this.netronOverview1, "NetronOverview");
     this.netronOverview1.Zoom = 0.2F;
     //
     // MainForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(584, 425);
     this.Controls.Add(this.netronPanel);
     this.Controls.Add(this.toolBar);
     this.Controls.Add(this.statusBar);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Menu = this.mainMenu;
     this.Name = "MainForm";
     this.Text = "QuickGraph - Netron - Test Application";
     ((System.ComponentModel.ISupportInitialize)(this.messageBarPanel)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.errorBarPanel)).EndInit();
     this.netronPanel.ResumeLayout(false);
     this.ResumeLayout(false);
 }
コード例 #3
0
 public void Detach(QuickNetronPanel panel)
 {
     panel.AutoScroll = true;
     panel.MouseWheel-=new System.Windows.Forms.MouseEventHandler(this.panel_MouseWheel);
 }
コード例 #4
0
 public void Attach(QuickNetronPanel panel)
 {
     panel.AutoScroll = false;
     panel.MouseWheel+=new System.Windows.Forms.MouseEventHandler(panel_MouseWheel);
 }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: tmauldin/mb-unit
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
     this.mainMenu  = new System.Windows.Forms.MainMenu();
     this.menuItem3 = new System.Windows.Forms.MenuItem();
     this.menuItem4 = new System.Windows.Forms.MenuItem();
     this.menuItem6 = new System.Windows.Forms.MenuItem();
     this.menuItem2 = new System.Windows.Forms.MenuItem();
     this.menuItem5 = new System.Windows.Forms.MenuItem();
     this.depthFirstSearchAlgorithmItem = new System.Windows.Forms.MenuItem();
     this.edgeDepthFirstSearchItem      = new System.Windows.Forms.MenuItem();
     this.breadthFirstSearchItem        = new System.Windows.Forms.MenuItem();
     this.menuItem1               = new System.Windows.Forms.MenuItem();
     this.menuItem7               = new System.Windows.Forms.MenuItem();
     this.menuItem8               = new System.Windows.Forms.MenuItem();
     this.statusBar               = new System.Windows.Forms.StatusBar();
     this.messageBarPanel         = new System.Windows.Forms.StatusBarPanel();
     this.errorBarPanel           = new System.Windows.Forms.StatusBarPanel();
     this.toolBar                 = new System.Windows.Forms.ToolBar();
     this.imageList1              = new System.Windows.Forms.ImageList(this.components);
     this.dockingManagerExtender1 = new DockingManagerExtender.DockingManagerExtender(this.components);
     this.netronPanel             = new QuickGraph.Layout.Forms.QuickNetronPanel(this.components);
     this.netronOverview1         = new Netron.UI.NetronOverview();
     ((System.ComponentModel.ISupportInitialize)(this.messageBarPanel)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.errorBarPanel)).BeginInit();
     this.netronPanel.SuspendLayout();
     this.SuspendLayout();
     //
     // mainMenu
     //
     this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem3,
         this.menuItem2
     });
     //
     // menuItem3
     //
     this.menuItem3.Index = 0;
     this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem4,
         this.menuItem6
     });
     this.menuItem3.Text = "File";
     //
     // menuItem4
     //
     this.menuItem4.Index  = 0;
     this.menuItem4.Text   = "Load GraphML";
     this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
     //
     // menuItem6
     //
     this.menuItem6.Index = 1;
     this.menuItem6.Text  = "Load GXL";
     //
     // menuItem2
     //
     this.menuItem2.Index = 1;
     this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem5,
         this.menuItem1
     });
     this.menuItem2.Text = "Algorithms";
     //
     // menuItem5
     //
     this.menuItem5.Index = 0;
     this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.depthFirstSearchAlgorithmItem,
         this.edgeDepthFirstSearchItem,
         this.breadthFirstSearchItem
     });
     this.menuItem5.Text = "Search";
     //
     // depthFirstSearchAlgorithmItem
     //
     this.depthFirstSearchAlgorithmItem.Index  = 0;
     this.depthFirstSearchAlgorithmItem.Text   = "DepthFirstSearchAlgorithm";
     this.depthFirstSearchAlgorithmItem.Click += new System.EventHandler(this.depthFirstSearchAlgorithmItem_Click);
     //
     // edgeDepthFirstSearchItem
     //
     this.edgeDepthFirstSearchItem.Index  = 1;
     this.edgeDepthFirstSearchItem.Text   = "EdgeDepthFirstSearchAlgorithm";
     this.edgeDepthFirstSearchItem.Click += new System.EventHandler(this.edgeDepthFirstSearchItem_Click);
     //
     // breadthFirstSearchItem
     //
     this.breadthFirstSearchItem.Index  = 2;
     this.breadthFirstSearchItem.Text   = "BreadthFirstSearchAlgorithm";
     this.breadthFirstSearchItem.Click += new System.EventHandler(this.breadthFirstSearchItem_Click);
     //
     // menuItem1
     //
     this.menuItem1.Index = 1;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem7,
         this.menuItem8
     });
     this.menuItem1.Text = "Walks";
     //
     // menuItem7
     //
     this.menuItem7.Index  = 0;
     this.menuItem7.Text   = "Uniform walk";
     this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click);
     //
     // menuItem8
     //
     this.menuItem8.Index  = 1;
     this.menuItem8.Text   = "Weighted walk";
     this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
     //
     // statusBar
     //
     this.statusBar.Location = new System.Drawing.Point(0, 403);
     this.statusBar.Name     = "statusBar";
     this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
         this.messageBarPanel,
         this.errorBarPanel
     });
     this.statusBar.Size     = new System.Drawing.Size(584, 22);
     this.statusBar.TabIndex = 0;
     this.statusBar.Text     = "Status Bar";
     //
     // messageBarPanel
     //
     this.messageBarPanel.Text = "Message";
     //
     // errorBarPanel
     //
     this.errorBarPanel.Alignment = System.Windows.Forms.HorizontalAlignment.Right;
     this.errorBarPanel.Text      = "Error";
     this.errorBarPanel.Width     = 20;
     //
     // toolBar
     //
     this.toolBar.ButtonSize     = new System.Drawing.Size(16, 16);
     this.toolBar.DropDownArrows = true;
     this.toolBar.ImageList      = this.imageList1;
     this.toolBar.Location       = new System.Drawing.Point(0, 0);
     this.toolBar.Name           = "toolBar";
     this.toolBar.ShowToolTips   = true;
     this.toolBar.Size           = new System.Drawing.Size(584, 22);
     this.toolBar.TabIndex       = 1;
     //
     // imageList1
     //
     this.imageList1.ColorDepth       = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.imageList1.ImageSize        = new System.Drawing.Size(32, 32);
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     //
     // dockingManagerExtender1
     //
     this.dockingManagerExtender1.AutomaticStatePersistence = false;
     this.dockingManagerExtender1.ContainerControl          = this;
     this.dockingManagerExtender1.InnerControl   = null;
     this.dockingManagerExtender1.OuterControl   = null;
     this.dockingManagerExtender1.PlainTabBorder = false;
     this.dockingManagerExtender1.VisualStyle    = Crownwood.Magic.Common.VisualStyle.IDE;
     //
     // netronPanel
     //
     this.dockingManagerExtender1.SetADockingEnable(this.netronPanel, false);
     this.netronPanel.BackColor   = System.Drawing.Color.White;
     this.netronPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.dockingManagerExtender1.SetCloseButton(this.netronPanel, false);
     this.dockingManagerExtender1.SetCloseOnHide(this.netronPanel, false);
     this.netronPanel.Controls.Add(this.netronOverview1);
     this.netronPanel.DataUpdateInterval = 50;
     this.netronPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.dockingManagerExtender1.SetDockingStyle(this.netronPanel, System.Windows.Forms.DockStyle.Left);
     this.netronPanel.Domain = null;
     this.dockingManagerExtender1.SetFullTitle(this.netronPanel, "netronPanel");
     this.netronPanel.Graph = null;
     this.dockingManagerExtender1.SetIcon(this.netronPanel, null);
     this.netronPanel.Location = new System.Drawing.Point(0, 22);
     this.netronPanel.Name     = "netronPanel";
     this.netronPanel.Size     = new System.Drawing.Size(584, 381);
     this.dockingManagerExtender1.SetTabbedMode(this.netronPanel, true);
     this.netronPanel.TabIndex = 4;
     this.dockingManagerExtender1.SetTitle(this.netronPanel, "netronPanel");
     this.netronPanel.Zoom = 1F;
     //
     // netronOverview1
     //
     this.dockingManagerExtender1.SetADockingEnable(this.netronOverview1, true);
     this.dockingManagerExtender1.SetCloseButton(this.netronOverview1, true);
     this.dockingManagerExtender1.SetCloseOnHide(this.netronOverview1, false);
     this.dockingManagerExtender1.SetDockingStyle(this.netronOverview1, System.Windows.Forms.DockStyle.Left);
     this.dockingManagerExtender1.SetFullTitle(this.netronOverview1, "NetronOverview");
     this.dockingManagerExtender1.SetIcon(this.netronOverview1, null);
     this.netronOverview1.Location = new System.Drawing.Point(24, 16);
     this.netronOverview1.Name     = "netronOverview1";
     this.netronOverview1.Panel    = null;
     this.netronOverview1.Size     = new System.Drawing.Size(224, 248);
     this.dockingManagerExtender1.SetTabbedMode(this.netronOverview1, true);
     this.netronOverview1.TabIndex = 0;
     this.dockingManagerExtender1.SetTitle(this.netronOverview1, "NetronOverview");
     this.netronOverview1.Zoom = 0.2F;
     //
     // MainForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(584, 425);
     this.Controls.Add(this.netronPanel);
     this.Controls.Add(this.toolBar);
     this.Controls.Add(this.statusBar);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Menu = this.mainMenu;
     this.Name = "MainForm";
     this.Text = "QuickGraph - Netron - Test Application";
     ((System.ComponentModel.ISupportInitialize)(this.messageBarPanel)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.errorBarPanel)).EndInit();
     this.netronPanel.ResumeLayout(false);
     this.ResumeLayout(false);
 }
コード例 #6
0
 public void Detach(QuickNetronPanel panel)
 {
     panel.AutoScroll  = true;
     panel.MouseWheel -= new System.Windows.Forms.MouseEventHandler(this.panel_MouseWheel);
 }
コード例 #7
0
 public void Attach(QuickNetronPanel panel)
 {
     panel.AutoScroll  = false;
     panel.MouseWheel += new System.Windows.Forms.MouseEventHandler(panel_MouseWheel);
 }