private void CreateComplexNestedGraph()
        {
            DGraph outerMost = GraphControlForNesting_Complex.Graph;

            outerMost.Name = "Outermost";
            DNode cellNode       = Nesting_Cell_AddNode(outerMost, "Cell", "Cell");
            Grid  cell_container = new Grid();

            cell_container.RowDefinitions.Add(new RowDefinition());
            cell_container.RowDefinitions.Add(new RowDefinition());
            cell_container.RowDefinitions.Add(new RowDefinition());
            cell_container.ColumnDefinitions.Add(new ColumnDefinition());
            cell_container.ColumnDefinitions.Add(new ColumnDefinition());
            cellNode.Label = new DNestedGraphLabel(cellNode, cell_container);
            TextBlock cell_header = new TextBlock()
            {
                Text = "Cell", TextAlignment = TextAlignment.Center, FontWeight = FontWeights.Bold
            };

            Grid.SetColumnSpan(cell_header, 2);
            cell_container.Children.Add(cell_header);
            TextBlock proliferation_header = new TextBlock()
            {
                Text = "Proliferation", TextAlignment = TextAlignment.Center
            };

            Grid.SetRow(proliferation_header, 1);
            cell_container.Children.Add(proliferation_header);
            TextBlock differentiation_header = new TextBlock()
            {
                Text = "Differentiation", TextAlignment = TextAlignment.Center
            };

            Grid.SetRow(differentiation_header, 1);
            Grid.SetColumn(differentiation_header, 1);
            cell_container.Children.Add(differentiation_header);

            DGraph proliferation = new DGraph(cellNode.Label as DNestedGraphLabel)
            {
                Name = "Proliferation", VerticalAlignment = VerticalAlignment.Top
            };

            Nesting_CreateProliferationGraph(proliferation);
            Grid.SetRow(proliferation, 2);
            cell_container.Children.Add(proliferation);
            (cellNode.Label as DNestedGraphLabel).Graphs.Add(proliferation);

            DGraph differentiation = new DGraph(cellNode.Label as DNestedGraphLabel)
            {
                Name = "Differentiation", VerticalAlignment = VerticalAlignment.Top
            };

            CreateDifferentiationGraph(differentiation);
            Grid.SetRow(differentiation, 2);
            Grid.SetColumn(differentiation, 1);
            cell_container.Children.Add(differentiation);
            (cellNode.Label as DNestedGraphLabel).Graphs.Add(differentiation);

            Dispatcher.BeginInvoke(() => outerMost.BeginLayout());
        }
        public MainPage()
        {
            InitializeComponent();

            SetupGraphControl();

            GraphControlSilverlight.Graph.Name = "GraphControl Test";
            CreateInitialGraph(GraphControlSilverlight.Graph);
            GraphControlSilverlight.BeginLayoutWithConstraints();

            DGraph.Name = "DGraph Test";
            CreateInitialGraph(DGraph);
            DGraph.BeginLayout();

            GraphControlForClusters.Graph.Name = "Clusters";
            CreateClusteredGraph();

            GraphControlForClusters_Complex.Name = "Complex Clusters";
            CreateComplexClusteredGraph();

            GraphControlForNesting.Graph.Name = "Nesting";
            CreateNestedGraph();

            GraphControlForNesting_Complex.Name = "Complex Nesting";
            CreateComplexNestedGraph();
            //*/
            //CreateGraphFromGeometry();
        }
        public MainPage()
        {
            InitializeComponent();

            SetupGraphControl();

            CreateInitialGraph(GraphControlSilverlight.Graph);
            CreateInitialGraph(DGraph);

            GraphControlSilverlight.BeginLayoutWithConstraints();
            DGraph.BeginLayout();
        }
예제 #4
0
        private void BeginNextLayout()
        {
            if (--count > 0)
            {
                return;
            }
            if (!m_LayoutQueue.Any())
            {
                m_Graph.Dispatcher.BeginInvoke((Action)(() => m_Graph.BeginLayout(true)));
                return;
            }
            DNestedGraphLabel l = m_LayoutQueue.Dequeue();

            count = 0;
            foreach (DGraph graph in l.Graphs)
            {
                count++;
                graph.GraphLayoutDone += SubGraphLayoutDone;
                graph.Dispatcher.BeginInvoke(() => graph.BeginLayout(true));
            }
        }