示例#1
0
 private GViewer CreateGraphControl()
 {
     var viewer = new GViewer();
     viewer.Dock = DockStyle.Fill;
     viewer.Graph = CreateGraphForObject();
     return viewer;
 }
        public GraphControl(IServiceProvider serviceProvider)
        {
            assemblyBrowser = (IAssemblyBrowser) serviceProvider.GetService(typeof (IAssemblyBrowser));

            viewer = new GViewer();
            viewer.SelectionChanged += OnSelectionChanged;
            DockControl(viewer);
        }
示例#3
0
 private void DrawTree(Tree tree, GViewer gViewer)
 {
     var g = new Graph("Coverage tree");
     var graphbuilder = new GraphBuilder();
     graphbuilder.FillGraph(g, tree.Root);
     if(g.NodeCount<50)
         gViewer.Graph = g;
 }
示例#4
0
        public GraphView()
        {
            InitializeComponent();
            gViewer = new GViewer();
            Controls.Add(gViewer);
            gViewer.Dock = DockStyle.Fill;

            mGraphBuilder          = new GraphBuilder();
            mGraphBuilder.Updated += mGraphBuilder_Updated;
        }
示例#5
0
        private void Group_Click(object sender, EventArgs e)
        {
            GViewer viewer = sender as GViewer;

            if (viewer.SelectedObject is Node)
            {
                Node node = viewer.SelectedObject as Node;
                //...do works here
            }
        }
        GViewer CreateGraphControl()
        {
            var viewer = new GViewer
            {
                Dock  = DockStyle.Fill,
                Graph = _graph
            };

            return(viewer);
        }
示例#7
0
 public ProcessMapForm(LogExplorerController controller, string id)
 {
     InitializeComponent();
     _controller = controller;
     _mapId      = id;
     viewer      = new GViewer();
     viewer.Dock = DockStyle.Fill;
     panelForMainView.Controls.Add(viewer);
     viewer.MouseClick += ViewerOnMouseClick;
 }
示例#8
0
        GViewer CreateGraphControl()
        {
            var viewer = new GViewer
                {
                    Dock = DockStyle.Fill,
                    Graph = _graph
                };

            return viewer;
        }
示例#9
0
 /// <summary>
 /// Instantiate a new Vetex Cover problem
 /// </summary>
 /// <param name="threeSAT"></param>
 public VertexCover(ThreeSAT threeSAT)
 {
     this.threeSAT = threeSAT;
     // Creates a form
     form = new Form();
     // Create a viewer object
     viewer = new GViewer();
     // Create the graph object
     graph = new Graph("graph");
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GViewerToolWindowControl"/> class.
        /// </summary>
        public GViewerToolWindowControl()
        {
            InitializeComponent();
            var graph   = CreateGraph();
            var gViewer = new GViewer {
                Graph = graph
            };

            Wfh.Child = gViewer;
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Text = _caption;

            GViewer viewer = CreateGraphControl();

            Controls.Add(viewer);
        }
示例#12
0
        public Control CreateControl()
        {
            var uiSvc = services.RequireService <IDecompilerShellUiService>();

            this.combinedCodeView      = new CombinedCodeView();
            this.combinedCodeView.Dock = DockStyle.Fill;

            this.combinedCodeView.CurrentAddressChanged += CombinedCodeView_CurrentAddressChanged;

            this.combinedCodeView.MixedCodeDataView.VScrollValueChanged += MixedCodeDataView_VScrollValueChanged;
            this.combinedCodeView.MixedCodeDataView.Services             = services;
            this.combinedCodeView.MixedCodeDataView.MouseDown           += MixedCodeDataView_MouseDown;
            this.combinedCodeView.MixedCodeDataView.ModelChanged        += MixedCodeDataView_ModelChanged;
            this.combinedCodeView.MixedCodeDataView.Navigate            += TextView_Navigate;

            this.combinedCodeView.CodeView.VScrollValueChanged += CodeView_VScrollValueChanged;
            this.combinedCodeView.CodeView.Services             = services;
            this.combinedCodeView.CodeView.MouseDown           += CodeView_MouseDown;
            this.combinedCodeView.CodeView.Navigate            += TextView_Navigate;

            this.combinedCodeView.ContextMenu = uiSvc.GetContextMenu(MenuIds.CtxCodeView);

            this.combinedCodeView.ToolBarGoButton.Click         += ToolBarGoButton_Click;
            this.combinedCodeView.ToolBarAddressTextbox.KeyDown += ToolBarAddressTextbox_KeyDown;

            this.gViewer                  = new GViewer();
            this.gViewer.Dock             = DockStyle.Fill;
            this.gViewer.Visible          = false;
            this.gViewer.PanButtonPressed = true;
            this.gViewer.ToolBarIsVisible = true;
            this.gViewer.KeyDown         += GViewer_KeyDown;
            this.gViewer.ContextMenu      = uiSvc.GetContextMenu(MenuIds.CtxCodeView);
            this.gViewer.LayoutAlgorithmSettingsButtonVisible = false;
            this.gViewer.LayoutEditingEnabled    = false;
            this.gViewer.EdgeInsertButtonVisible = false;
            this.gViewer.SaveButtonVisible       = false;
            this.gViewer.SaveGraphButtonVisible  = false;
            this.gViewer.SaveAsMsaglEnabled      = false;
            this.gViewer.UndoRedoButtonsVisible  = false;
            this.gViewer.KeyDown              += GViewer_KeyDown;
            this.gViewer.ContextMenu           = uiSvc.GetContextMenu(MenuIds.CtxCodeView);
            this.gViewer.MouseUp              += GViewer_MouseUp;
            this.gViewer.DrawingPanel.MouseUp += GViewer_MouseUp;
            var iViewer = (IViewer)gViewer;

            iViewer.MouseUp   += IViewer_MouseUp;
            iViewer.MouseDown += IViewer_MouseDown;

            this.navInteractor = new NavigationInteractor <Address>();
            this.navInteractor.Attach(this.combinedCodeView);

            declarationFormInteractor = new DeclarationFormInteractor(services);

            return(combinedCodeView);
        }
示例#13
0
        private void SetGraph(CityGraph g)
        {
            GViewer viewer = new GViewer();

            viewer.Graph = g.MSAGLGraph;
            panel1.SuspendLayout();
            viewer.Dock = DockStyle.Fill;
            panel1.Controls.Clear();
            panel1.Controls.Add(viewer);
            panel1.ResumeLayout();
        }
示例#14
0
        private void clearGraph()
        {
            GViewer viewer = new GViewer();

            viewer.Graph = graph;
            viewer.Name  = "viewer";
            viewer.Dock  = DockStyle.Fill;

            panelGraph.Controls.Clear();
            panelGraph.Controls.Add(viewer);
        }
示例#15
0
        public static void DrawNode(GViewer gLocalViewer, GraphItem item, bool selected, bool maxRelations)
        {
            if (gLocalViewer.InvokeRequired)
            {
                gLocalViewer.Invoke(new MethodInvoker(delegate() { DrawNode(gLocalViewer, item, selected, maxRelations); }));
                return;
            }

            Microsoft.Msagl.Drawing.Graph graph = gLocalViewer.Graph;
            Node node = new Node(item.UniqueID);

            if (item.Name.Length > 12)
            {
                node.Label.Text = string.Format("{0}...", item.Name.Substring(0, 6));
            }
            else
            {
                node.Label.Text = item.Name;
            }
            node.UserData = item;

            if (selected || maxRelations)
            {
                if (selected && maxRelations)
                {
                    node.DrawNodeDelegate = new DelegateToOverrideNodeRendering(CustomDrawMultiRelaitionsSelectedNode);
                }
                else
                {
                    if (selected)
                    {
                        node.DrawNodeDelegate = new DelegateToOverrideNodeRendering(CustomDrawNormalSelectedNode);
                    }
                    else
                    {
                        if (maxRelations)
                        {
                            node.DrawNodeDelegate = new DelegateToOverrideNodeRendering(CustomDrawMultiRelaitionsNode);
                        }
                        else
                        {
                            node.DrawNodeDelegate = new DelegateToOverrideNodeRendering(CustomDrawNormalNode);
                        }
                    }
                }
            }
            else
            {
                node.DrawNodeDelegate = new DelegateToOverrideNodeRendering(CustomDrawNormalNode);
            }
            graph.AddNode(node);
            gLocalViewer.Graph = graph;
        }
示例#16
0
        private void drawInitialGraph(MyGraph mg, DataGrid dataGridOutput, WindowsFormsHost host)
        {
            Graph   gr_1 = new Graph();   //создание экземпляра класса для рисования графа
            GViewer gv_1 = new GViewer(); //создание экземпляра класса для просмотра графа

            //mg.printMatrix(mg.InitialMatrix, textBoxOutput); //печать матрицы (начальной)
            mg.printMatrixToDG(mg.InitialMatrix, dataGridOutput);
            mg.drawGraph(mg.InitialMatrix, gr_1); //рисование графа (начального)
            gv_1.ToolBarIsVisible = false;        //скрытие тул-бара просмотрщика графа
            gv_1.Graph            = gr_1;         //присовение компоненте просмотра, какой граф отрисовывать
            host.Child            = gv_1;         //присвоение хосту дочернего обьекта просмотрщика графов
        }
示例#17
0
        private void drawPreprocessedGraph(MyGraph mg, WindowsFormsHost host)
        {
            Graph   gr_1 = new Graph();                                          //создание экземпляра класса для рисования графа
            GViewer gv_1 = new GViewer();                                        //создание экземпляра класса для просмотра графа

            mg.PreprocessedMatrix = Preprocess.doHomeomorphic(mg.InitialMatrix); //проведения предобработки
            mg.drawGraph(mg.PreprocessedMatrix, gr_1);                           //рисование графа (предобработанного)

            gv_1.ToolBarIsVisible = false;                                       //скрытие тул-бара просмотрщика графа
            gv_1.Graph            = gr_1;                                        //присовение компоненте просмотра, какой граф отрисовывать
            host.Child            = gv_1;                                        //присвоение хосту дочернего обьекта просмотрщика графов
        }
示例#18
0
 public MainWindow()
 {
     InitializeComponent();
     m_loadedGraphs   = new List <CpmGraph>();
     m_cpmGraphFacade = new CpmGraphFacade();
     m_gViewer        = PrepareViewer();
     panel.BackColor  = System.Drawing.Color.Gray;
     panel.Controls.Add(m_gViewer);
     btnRefresh.Enabled          = false;
     btnDrawCriticalPath.Enabled = false;
     FormBorderStyle             = FormBorderStyle.FixedSingle;
 }
        internal static void ShowGraph(Graph graph)
        {
            Form    f = new Form();
            GViewer v = new GViewer();

            v.Dock = DockStyle.Fill;
            f.SuspendLayout();
            f.Controls.Add(v);
            f.ResumeLayout();
            v.NeedToCalculateLayout = false;
            v.Graph = graph;
            f.ShowDialog();
        }
示例#20
0
 private void CreateGraphViewer()
 {
     _graphViewer = new GViewer
     {
         Dock                 = DockStyle.Fill,
         OutsideAreaBrush     = Brushes.White,
         LayoutEditingEnabled = false,
         LayoutAlgorithmSettingsButtonVisible = false,
         EdgeInsertButtonVisible = false,
         SaveAsMsaglEnabled      = false,
         UndoRedoButtonsVisible  = false
     };
 }
示例#21
0
        public GraphForm(Graph graph)
        {
            InitializeComponent();
            GViewer gViewer = new GViewer();

            graph.Attr.LayerDirection = LayerDirection.None;
            gViewer.Graph             = graph;
            gViewer.ToolBarIsVisible  = false;
            gViewer.Dock    = DockStyle.Fill;
            gViewer.Enabled = false;
            Controls.Add(gViewer);
            ResumeLayout();
        }
示例#22
0
        public void visualize(System.Windows.Forms.Panel panel)
        {
            Graph g = toMSAGLGraph();

            GViewer viewer = new GViewer();

            viewer.Graph = g;
            viewer.CurrentLayoutMethod = LayoutMethod.MDS;
            viewer.Dock = System.Windows.Forms.DockStyle.Fill;
            panel.Controls.Clear();
            panel.Controls.Add(viewer);
            panel.Refresh();
        }
示例#23
0
        /// <summary>
        /// Creates the graph viewer.
        /// </summary>
        /// <param name="graph">
        /// The graph.
        /// </param>
        /// <returns>
        /// The created Graph Viewer host.
        /// </returns>
        private UIElement CreateGraphViewer(Graph graph)
        {
            var graphViewer = new GViewer();

            graphViewer.ToolBarIsVisible = false;
            var host = new WindowsFormsHost();

            host.Child        = graphViewer;
            host.Height       = 300;
            graphViewer.Graph = graph;

            return(host);
        }
示例#24
0
        public void ShowGraph()
        {
            var form   = new Form();
            var viewer = new GViewer();
            var graph  = GetGraph("first");

            viewer.Graph = graph;
            form.SuspendLayout();
            viewer.Dock = DockStyle.Fill;
            form.Controls.Add(viewer);
            form.ResumeLayout();

            form.ShowDialog();
        }
        private void UIGraphAssetViz_Load(object sender, EventArgs e)
        {
            //create a viewer object
            viewer = new GViewer();

            //create the graph content
            drawGraphSafely();

            //associate the viewer with the form
            this.SuspendLayout();
            viewer.Dock = DockStyle.Fill;
            this.graphVizPanel.Controls.Add(viewer);
            this.ResumeLayout();
        }
示例#26
0
        static GViewer GetGViewerFromForm(Control form)
        {
            GViewer gv = null;

            foreach (object g in form.Controls)
            {
                gv = g as GViewer;
                if (gv != null)
                {
                    break;
                }
            }
            return(gv);
        }
示例#27
0
        public void InitializeForm()
        {
            this.algorithms = new List <Action>();

            this.nodePickingCancellationTokenSource = new CancellationTokenSource();
            this.nodePickingCancellationToken       = this.nodePickingCancellationTokenSource.Token;

            graph = new Frame.Models.DGraph(ArrowStyle.None);

            viewer = new Microsoft.Msagl.GraphViewerGdi.GViewer();

            viewer.EdgeInsertButtonVisible      = viewer.UndoRedoButtonsVisible =
                viewer.windowZoomButton.Visible = viewer.NavigationVisible = false;

            viewer.LayoutAlgorithmSettingsButtonVisible = true;

            graph.AddVertice("A");
            graph.AddVertice("B");
            graph.AddVertice("C");
            graph.AddVertice("D");

            //AddNodesLocations();

            graph.AddEdge("C", "B", 234);
            graph.AddEdge("A", "C", 53);
            graph.AddEdge("A", "C", 43);

            viewer.CenterToPoint(new Microsoft.Msagl.Core.Geometry.Point(viewer.Width / 2, viewer.Height / 2));
            viewer.Graph = graph;

            viewer.MouseDown               += Viewer_MouseDown;
            viewer.MouseUp                 += Viewer_MouseUp;
            viewer.MouseMove               += Viewer_MouseMove;
            viewer.MouseClick              += Viewer_MouseClick;
            viewer.GraphLoadingEnded       += Viewer_GraphLoadingEnded;
            viewer.GraphChanged            += Viewer_GraphChanged;
            viewer.CustomOpenButtonPressed += Viewer_CustomOpenButtonPressed;
            viewer.KeyDown                 += Viewer_KeyDown;

            //viewer.ObjectUnderMouseCursorChanged += Viewer_ObjectUnderMouseCursorChanged;

            /*viewer.LayoutEditor.RemoveEdgeDraggingDecorations = null;
             * viewer.LayoutEditor.RemoveObjDraggingDecorations = null;*/
            //viewer.AsyncLayout = true;

            this.SuspendLayout();
            viewer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.graphPanel.Controls.Add(viewer);
            this.ResumeLayout();
        }
示例#28
0
 static void SaveFile(string fileName, GViewer gViewer)
 {
     if (program != null)
     {
         using (StreamWriter writer = new StreamWriter(fileName))
         {
             PtoGraph.GenerateDgml(program, writer);
         }
     }
     else
     {
         MessageBox.Show("Please load a .p file first to generate the graph");
     }
 }
示例#29
0
        public GViewer generateMSAGL(List <Node> paths = null)
        {
            GViewer viewer = new GViewer();

            Microsoft.Msagl.Drawing.Graph graph = new Microsoft.Msagl.Drawing.Graph("graph");

            List <string[]> edges = new List <string[]>();

            foreach (Node n in this.nodes)
            {
                var node = graph.AddNode(n.getName());
                if (paths != null && paths.Count > 1 && paths.Contains(n))
                {
                    node.Attr.FillColor = Microsoft.Msagl.Drawing.Color.MistyRose;
                }

                foreach (string s in n.getNeighbor())
                {
                    //edges.FindIndex(e => e[0] == n.getName() && e[1] == s);
                    if (edges.FindIndex(e => e[0] == n.getName() && e[1] == s) < 0)
                    {
                        var edge = graph.AddEdge(n.getName(), s);

                        int indexOfNode1InPaths = -1;
                        int indexOfNode2InPaths = -1;
                        if (paths != null && paths.Count > 1)
                        {
                            indexOfNode1InPaths = paths.IndexOf(this.getNode(n.getName()));
                            indexOfNode2InPaths = paths.IndexOf(this.getNode(s));
                        }
                        if (indexOfNode1InPaths >= 0 && indexOfNode2InPaths >= 0 && Math.Abs(indexOfNode2InPaths - indexOfNode1InPaths) == 1)
                        {
                            edge.Attr.LineWidth = 3;
                        }
                        edge.Attr.ArrowheadAtTarget = Microsoft.Msagl.Drawing.ArrowStyle.None;
                        edge.Attr.ArrowheadAtSource = Microsoft.Msagl.Drawing.ArrowStyle.None;
                        string[] e1 = { n.getName(), s };
                        string[] e2 = { s, n.getName() };
                        edges.Add(e1);
                        edges.Add(e2);
                    }
                }
            }

            viewer.Graph = graph;
            viewer.Dock  = System.Windows.Forms.DockStyle.Fill;

            return(viewer);
        }
示例#30
0
        static Form CreateForm(Graph graph, GViewer gviewer)
        {
            Form form = FormStuff.CreateOrAttachForm(gviewer, null);

            form.SuspendLayout();
            SetEdgeSeparationBar(form);

            gviewer.GraphChanged += GviewerGraphChanged;

            if (graph != null)
            {
                gviewer.Graph = graph;
            }
            return(form);
        }
示例#31
0
        public DecisionTreeVisualizer(DecisionTree dt, AttributeType dvt, Dictionary <string, AttributeListInfo> attr)
        {
            InitializeComponent();
            this.MinimumSize = new System.Drawing.Size(500, 500);
            this.MaximizeBox = false;
            this.CenterToParent();
            tree = dt;
            decisionVariableType = dvt;
            attributes           = attr;

            viewer = new GViewer();
            graph  = new Graph("graph");

            drawTree();
        }
        static void Main(string[] args)
        {
#if TEST_MSAGL
            DisplayGeometryGraph.SetShowFunctions();
#endif
            ArgsParser.ArgsParser argsParser = SetArgsParser(args);
            if (argsParser.OptionIsUsed("-help"))
            {
                Console.WriteLine(argsParser.UsageString());
                Environment.Exit(0);
            }

            bundling = argsParser.OptionIsUsed(BundlingOption);

            var gviewer = new GViewer();
            if (argsParser.OptionIsUsed(FdOption))
            {
                gviewer.CurrentLayoutMethod = LayoutMethod.IcrementalLayout;
            }
            Form form = CreateForm(null, gviewer);
            if (argsParser.OptionIsUsed(AsyncLayoutOption))
            {
                gviewer.AsyncLayout = true;
            }

            string fileName = argsParser.GetStringOptionValue(FileOption);
            if (fileName != null)
            {
                string ext = Path.GetExtension(fileName);
                if (ext != null)
                {
                    ext = ext.ToLower();
                    if (ext == ".dot")
                    {
                        ProcessDotFile(gviewer, argsParser, fileName);
                    }
                }
                else
                {
                    Console.WriteLine("do not know how to process {0}", fileName);
                    Environment.Exit(1);
                }
            }
            if (!argsParser.OptionIsUsed(QuietOption))
            {
                Application.Run(form);
            }
        }
        private void Setup_GraphViewers()
        {
            graph_1  = new Graph();
            graph_2  = new Graph();
            viewer_1 = new GViewer
            {
                Graph = graph_1
            };

            viewer_2 = new GViewer
            {
                Graph = graph_2
            };
            _mainWindowInstance.WFH1.Child = viewer_1;
            _mainWindowInstance.WFH2.Child = viewer_2;
        }
示例#34
0
        public Form1()
        {
            InitializeComponent();
            _viewer = new GViewer();
            _viewer.BorderStyle = BorderStyle.None;

            _viewer.PanButtonPressed = true;

            _viewer.MouseClick += viewer_MouseClick;
            _viewer.MouseDoubleClick += viewer_MouseDoubleClick;
            _viewer.MouseWheel += viewer_MouseWheel;
            _viewer.OutsideAreaBrush = new Pen(Color.White).Brush;
            _viewer.Dock = DockStyle.Fill;
            _viewer.AutoScaleMode = AutoScaleMode.Dpi;
            panel1.Controls.Add(_viewer);
        }
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            /* Create a graph viewer
             */
            GViewer graphViewer = new GViewer();

            graphViewer.BindToPanel(this.Graph_DockPanel);

            /* Create a graph */
            Graph graph = new Graph();

            graph.AddEdge("a", "b");

            /* Connect graph to graphviewer */
            graphViewer.Graph = graph;
        }
示例#36
0
 private static FormContent CreateForm()
 {
     var startPageText = new TextBox { Name = "StartPage", Width = 150 };
     var depthText = new TextBox { Name = "Depth", Width = 50 };
     var viewer = new GViewer { Dock = DockStyle.Fill, Graph = new Graph("someGraph") };
     var layoutPanel = new TableLayoutPanel
                           {
                               Dock = DockStyle.Fill,
                               Controls =
                                   {
                                       { FlowLayout(Label("Start Page:"), startPageText), 0, 0 },
                                       { FlowLayout(Label("Depth:"), depthText), 1, 0 },
                                       { viewer, 0, 1 }
                                   }
                           };
     layoutPanel.SetColumnSpan(viewer, 2);
     var form = new Form
                    {
                        WindowState = FormWindowState.Maximized,
                        Controls = { layoutPanel },
                        Text = Assembly.GetExecutingAssembly().GetName().Name
                    };
     return new FormContent { Form = form, DepthText = depthText, StartPageText = startPageText, Viewer = viewer };
 }
示例#37
0
        public GcTypeHeap Render()
        {
            Console.WriteLine("rendering...");
            if (this.graph.VertexCount > 500)
            {
                Console.WriteLine("too many vertices ");
                return this;
            }

            var gleeGraph = this.graph.ToGleeGraph(populator_NodeAdded, populator_EdgeAdded);
            if (viewer == null)
            {
                viewerForm = new Form();
                viewer = new GViewer();
                viewer.Dock = DockStyle.Fill;
                viewerForm.Controls.Add(viewer);
            }
            viewer.Graph = gleeGraph;
            viewerForm.ShowDialog();

            return this;
        }
示例#38
0
 public CGraph(GViewer gg, ListView lv, Form1 f)
 {
     fxLv = lv;
     gViewer = gg;
     parent = f;
 }
        private void PhysicalScheduleForm_Load(object sender, EventArgs e)
        {
            //add necessary columns
            dgvSchedule.Columns.Add("category", "Category");
            dgvSchedule.Columns.Add("name", "Component Name");
            dgvSchedule.Columns.Add("pred", "Predecessor");
            dgvSchedule.Columns.Add("succ", "Successor");

            //disable editing certain columns
            dgvSchedule.Columns["name"].ReadOnly = true;
            dgvSchedule.Columns["category"].ReadOnly = true;

            foreach (BuildingComponent bComp in this.Components)
            {

                        //add necessary info
                        DataGridViewRow row = new DataGridViewRow();
                        DataGridViewTextBoxCell catCell = new DataGridViewTextBoxCell();
                        catCell.Value = bComp.Category;
                        row.Cells.Add(catCell);
                        DataGridViewTextBoxCell nameCell = new DataGridViewTextBoxCell();
                        nameCell.Value = bComp.Name;
                        row.Cells.Add(nameCell);

                        Boolean exists = false;
                        foreach (DataGridViewRow r in dgvSchedule.Rows)
                        {
                            if (r.Cells["name"].Value.Equals(row.Cells[1].Value) && r.Cells["category"].Value.Equals(row.Cells[0].Value))
                            {
                                exists = true;
                                break;
                            }
                        }

                        if (!exists)
                            dgvSchedule.Rows.Add(row);
            }
            GViewer gView = new GViewer();
            gView.Name = "GraphViewer";
            gView.PanButtonPressed = true;
            gView.Dock = DockStyle.Fill;
            graphPanel.Controls.Add(gView);
        }
示例#40
0
文件: Create.cs 项目: rosaskc/gptrees
 /// <summary>
 /// The initialize glee graph.
 /// </summary>
 private void InitializeGleeGraph()
 {
     this.gleeGraphViewer = new GViewer
     {
         Anchor = ((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right,
         AsyncLayout = false,
         AutoScroll = true,
         BackwardEnabled = false,
         ForwardEnabled = false,
         Graph = null,
         Location = new Point(195, 16),
         MouseHitDistance = 0.05D,
         Name = "graphViewer",
         NavigationVisible = true,
         PanButtonPressed = false,
         SaveButtonVisible = true,
         Size = new Size(this.Width - 220, this.Height - 65),
         ZoomF = 1D,
         ZoomFraction = 0.5D,
         ZoomWindowThreshold = 0.05D
     };
     this.Controls.Add(this.gleeGraphViewer);
 }
示例#41
0
        public GcTypeHeap Render()
        {
            Console.WriteLine("rendering...");
            if (this.graph.VertexCount > 500)
            {
                Console.WriteLine("too many vertices ");
                return this;
            }

            GleeGraphPopulator<GcType, GcTypeEdge> populator = GleeGraphUtility.Create(this.graph);
            try
            {
                populator.NodeAdded += new GleeVertexNodeEventHandler<GcType>(populator_NodeAdded);
                populator.EdgeAdded += new GleeEdgeEventHandler<GcType, GcTypeEdge>(populator_EdgeAdded);
                populator.Compute();

                if (viewer == null)
                {
                    viewerForm = new Form();
                    viewer = new GViewer();
                    viewer.Dock = DockStyle.Fill;
                    viewerForm.Controls.Add(viewer);
                }
                viewer.Graph = populator.GleeGraph;
                viewerForm.ShowDialog();
            }
            finally
            {
                populator.NodeAdded -= new GleeVertexNodeEventHandler<GcType>(populator_NodeAdded);
                populator.EdgeAdded -= new GleeEdgeEventHandler<GcType, GcTypeEdge>(populator_EdgeAdded);
            }

            return this;
        }