Beispiel #1
0
        public void ApplyLayout(object layout)
        {
            TreeLayout tl = layout as TreeLayout;

            if (tl != null)
            {
                tl.Arrange(flowchart);
                return;
            }

#if !FCNET_STD
            SpringLayout sl = layout as SpringLayout;
            if (sl != null)
            {
                sl.Arrange(flowchart);
                return;
            }

            LayeredLayout ll = layout as LayeredLayout;
            if (ll != null)
            {
                ll.Arrange(flowchart);
                return;
            }

            GridLayout gl = layout as GridLayout;
            if (gl != null)
            {
                gl.Arrange(flowchart);
                return;
            }
#endif
        }
Beispiel #2
0
        /// <summary>
        /// Arranges a tree on diagram to look pretty
        /// </summary>
        /// <param name="diagramView">DiagramView to arrange</param>
        private void Arrange(DiagramView diagramView)
        {
            var layout = new TreeLayout {
                KeepRootPosition = true, Direction = TreeLayoutDirections.TopToBottom
            };

            layout.Arrange(diagramView.Diagram);

            diagramView.Diagram.ResizeToFitItems(5);
            diagramView.ZoomToFit();
        }
        private void OnWindowLoaded(object sender, RoutedEventArgs e)
        {
            // still not sure if this is needed
            TreeLayout layout = new TreeLayout();

            layout.Type             = TreeLayoutType.Centered;
            layout.LinkStyle        = TreeLayoutLinkType.Cascading3;
            layout.Direction        = TreeLayoutDirections.TopToBottom;
            layout.KeepRootPosition = false;
            layout.LevelDistance    = 40;
            layout.Arrange(diagram);
        }
Beispiel #4
0
        private void rearrange(ShapeNode rootNode)
        {
            if (treeLayout == null)
            {
                treeLayout = new TreeLayout(rootNode,
                                            TreeLayoutType.Centered,
                                            false,
                                            TreeLayoutLinkType.Rounded,
                                            TreeLayoutDirections.TopToBottom,
                                            10, 5, true, new SizeF(10, 10));
            }

            treeLayout.Arrange(treeDiagram);
        }