///<inheritdoc/>
        protected override void ConfigureLayout()
        {
            OptionGroup layoutGroup = (OptionGroup)Handler.GetGroupByName(LAYOUT_OPTIONS);

            router.MinimumDistance   = (int)layoutGroup[MINIMAL_NODE_DISTANCE].Value;
            router.KeepExistingBends = (bool)layoutGroup[USE_BENDS].Value;
            router.RouteAllEdges     = (bool)layoutGroup[ROUTE_ONLY_NECESSARY].Value;

            SequentialLayout sl = new SequentialLayout();

            if ((bool)layoutGroup[ALLOW_MOVING_NODES].Value)
            {
                //if we are allowed to move nodes, we can improve the routing results by temporarily enlarging nodes and removing overlaps
                //(this strategy ensures that there is enough space for the edges)
                CompositeLayoutStage cls = new CompositeLayoutStage();
                cls.AppendStage(router.CreateNodeEnlargementStage());
                cls.AppendStage(new RemoveOverlapsStage(0));
                sl.AppendLayout(cls);
            }
            if (router.KeepExistingBends)
            {
                //we want to keep the original bends
                BendConverter bendConverter = new BendConverter();
                bendConverter.AffectedEdgesDpKey = OrganicEdgeRouter.AffectedEdgesDpKey;
                bendConverter.AdoptAffectedEdges = (bool)layoutGroup[SELECTION_ONLY].Value;
                bendConverter.CoreLayout         = router;
                sl.AppendLayout(bendConverter);
            }
            else
            {
                sl.AppendLayout(router);
            }

            LayoutAlgorithm = new HideGroupsStage(sl);
        }
Exemplo n.º 2
0
        /// <summary>
        /// configures the layout algorithm according to the settings of the option handler.
        /// </summary>
        protected override void ConfigureLayout()
        {
            CompactOrthogonalLayout compactOrthogonal = new CompactOrthogonalLayout();

            compactOrthogonal.InterEdgeRouter = ConfigureInterEdgeRouter();
            compactOrthogonal.PartitionPlacer = ConfigurePartitionPlacer();

            ApplyOptions((OrthogonalLayout)compactOrthogonal.CoreLayout);

            ApplyOptions(compactOrthogonal);
            LayoutAlgorithm = new HideGroupsStage(compactOrthogonal)
            {
                HidingEmptyGroupNodes = false
            };
        }