コード例 #1
0
        private void ApplyOptions(CompactOrthogonalLayout layout)
        {
            OptionGroup topLevelGroup = Handler.GetGroupByName(TOP_LEVEL);
            IOptionItem gridItem      = topLevelGroup.GetItemByName(GRID);

            layout.GridSpacing = (int)gridItem.Value;

            double ar = (double)topLevelGroup.GetItemByName(ASPECT_RATIO).Value;

            // this needs to be done as a final step since it will reconfigure
            // layout stages which support aspect ratio accordingly
            layout.AspectRatio = ar;
        }
コード例 #2
0
        private void ApplyOptions(OrthogonalLayout layout)
        {
            OptionGroup topLevelGroup = Handler.GetGroupByName(TOP_LEVEL);
            IOptionItem styleItem     = topLevelGroup.GetItemByName(ORTHOGONAL_LAYOUT_STYLE);

            layout.LayoutStyle = styles[(string)styleItem.Value];
        }
コード例 #3
0
        private PartitionLayout.IPartitionPlacer ConfigurePartitionPlacer()
        {
            OptionGroup topLevelGroup = Handler.GetGroupByName(TOP_LEVEL);
            IOptionItem placementItem = topLevelGroup.GetItemByName(PLACEMENT_STRATEGY);

            return
                (PartitionLayout.CreateComponentPartitionPlacer(new ComponentLayout
            {
                Style = componentStyles[(string)placementItem.Value]
            }));
        }
コード例 #4
0
        private PartitionLayout.IInterEdgeRouter ConfigureInterEdgeRouter()
        {
            OptionGroup topLevelGroup = Handler.GetGroupByName(TOP_LEVEL);

            PartitionLayout.IInterEdgeRouter interEdgeRouter;
            if (topLevelGroup[PATH_FINDER].Value.Equals(ORTHOGONAL_PATTERN_PATH_FINDER))
            {
                OrthogonalPatternEdgeRouter oper = new OrthogonalPatternEdgeRouter();
                oper.MinimumDistance  = (double)topLevelGroup[MINIMUM_DISTANCE].Value;
                oper.EdgeCrossingCost = (double)topLevelGroup[EDGE_CROSSING_COST].Value;
                oper.NodeCrossingCost = (double)topLevelGroup[NODE_CROSSING_COST].Value;
                oper.BendCost         = (double)topLevelGroup[BEND_COST].Value;
                var channelEdgeRouter = new ChannelEdgeRouter();
                channelEdgeRouter.PathFinderStrategy = oper;
                interEdgeRouter = PartitionLayout.CreateChannelInterEdgeRouter(channelEdgeRouter);
            }
            else
            {
                interEdgeRouter = PartitionLayout.CreateChannelInterEdgeRouter();
            }
            interEdgeRouter.RouteInterEdgesOnly = !(bool)(topLevelGroup.GetItemByName(ROUTE_ALL_EDGES).Value);
            return(interEdgeRouter);
        }