Exemplo n.º 1
0
 /// <summary>
 /// Redraws the graph with the specified layout type
 /// </summary>
 /// <param name="layout">Type of graph layout</param>
 /// <param name="isAnimated">Specifies whether or not to animate the graph when it's laid out</param>
 public void LayoutGraph(LayoutBase layout, bool isAnimated, string scope)
 {
     LayoutGraph(layout, isAnimated, scope, rootNode: null);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Redraws the graph with the specified layout type
        /// </summary>
        /// <param name="layout">Type of graph layout</param>
        /// <param name="isAnimated">Specifies whether or not to animate the graph when it's laid out</param>
        /// <param name="scope">Specifies the default graph scope</param>
        /// <param name="rootNode">Specifies the root node for layouts that require one</param>
        public void LayoutGraph(LayoutBase layout, bool isAnimated, string scope, NodeViewModelBase rootNode)
        {
            LayoutManager flyweight = LayoutManager.Instance;

            // Make sure we have a scope
            if (String.IsNullOrWhiteSpace(scope))
            {
                scope = this.defaultComponentInstanceScope;
            }

            // Get the graph as a GraphMapData object
            GraphMapData graphMapData = GetGraphComponents(scope).ExportGraph();

            // Execute the layout
            DispatcherHelper.UIDispatcher.BeginInvoke(() =>
                {
                    if (rootNode != null)
                    {
                        layout.CalculateLayout(graphMapData, rootNode.ParentNode);
                    }
                    else
                    {
                        layout.CalculateLayout(graphMapData);
                    }

                    System.Diagnostics.Debug.WriteLine("");
                    foreach (Delegate d in ContextMenuManager.Instance.GetContextMenuOpeningInvocationList())
                    {
                        System.Diagnostics.Debug.WriteLine((d.Target as GraphComponents).Scope);
                    }

                    layout.PositionNodes(isAnimated, graphMapData);
                });
        }
Exemplo n.º 3
0
 /// <summary>
 /// Redraws the graph with the specified layout type
 /// </summary>
 /// <param name="layout">Type of graph layout</param>
 public void LayoutGraph(LayoutBase layout, bool isAnimted)
 {
     LayoutGraph(layout, isAnimted, DefaultGraphComponentsInstance.Scope);
 }