Class HierarchicDiagramLayouter

    • Field Detail

      • pathRerouteCollectors

        private java.util.Collection<com.nomagic.magicdraw.uml.symbols.layout.PathRerouteCollector> pathRerouteCollectors
    • Constructor Detail

      • HierarchicDiagramLayouter

        @OpenApi
        public HierarchicDiagramLayouter()
        Construct HierarchicDiagramLayouter
      • HierarchicDiagramLayouter

        @OpenApi
        public HierarchicDiagramLayouter​(java.lang.String optionId)
        Construct HierarchicDiagramLayouter
        Parameters:
        optionId - hierarchic diagram layouter options id
    • Method Detail

      • initDefaultHierarchicSettings

        protected y.layout.hierarchic.IncrementalHierarchicLayouter initDefaultHierarchicSettings​(HierarchicLayouterOptionsGroup opt,
                                                                                                  UMLGraph graph)
        Initializes hierarchic layouter settings: - Enables backlooping - Sets group compaction enabled - Aligns groups in center - Sets routing style to orthogonal - Adds group node insets - Enables label layout - Sets the node sequence within layer.
        Parameters:
        opt - options
        graph - current graph that should be layouted
      • wrapToAccordingGroupLayouter

        protected y.layout.Layouter wrapToAccordingGroupLayouter​(UMLGraph graph,
                                                                 y.layout.hierarchic.IncrementalHierarchicLayouter layouter,
                                                                 HierarchicLayouterOptionsGroup opt,
                                                                 boolean fromSketch)
      • createComponentLayouter

        @CheckForNull
        protected y.layout.ComponentLayouter createComponentLayouter​(UMLGraph graph,
                                                                     y.layout.grouping.RecursiveGroupLayouter coreLayouter,
                                                                     HierarchicLayouterOptionsGroup opt)
        Creates a component layouter if possible. Sub-graphs that can be identified as separate components will be processed and placed to a more convenient location. It may not be possible to create component layouter if sequencing, swimlane partitions etc. are used
        Parameters:
        graph - layouted graph
        coreLayouter - the core layouter for component layouter
        opt - hierarchic options
        Returns:
        a component layouter if possible.
      • initUndirectedEdges

        private static void initUndirectedEdges​(UMLGraph graph)
        Initializes non direct edges. If a data key EDGE_DIRECTEDNESS_DPKEY is registered, all of the edges must contain some value. e.g. the non directed ones should contain 0.0 while all the others 1.0(directed).
        Parameters:
        graph - graph edges to init
      • collectNonDirectedEdges

        private static java.util.List<y.base.Edge> collectNonDirectedEdges​(UMLGraph graph)
      • isLayoutAsGrid

        private static boolean isLayoutAsGrid​(UMLGraph graph)
        Checks if the graph should be layouted as grid
        Parameters:
        graph - graph to check
        Returns:
        true if should layout the graph as grid, false otherwise
      • resizeOnEdgeElements

        protected void resizeOnEdgeElements​(UMLGraph graph,
                                            AbstractDiagramLayouterOptionsGroup options)
        Resizes elements on edge to the minimal size.
        Parameters:
        graph - layouted graph
        options - options that may be regarded while adjusting
      • collectOnEdgeElementsRecursively

        private static void collectOnEdgeElementsRecursively​(java.util.Collection<ShapeElement> collectTo,
                                                             ShapeElement collectFrom)
      • moveOverlappingPorts

        private void moveOverlappingPorts​(java.util.List<PresentationElement> elementsOnFrameEdge)
      • moveShapeBy

        private static void moveShapeBy​(int moveBy,
                                        PresentationElement oneShape)
        Moves shape by X coordinate, by provided moveBy
        Parameters:
        moveBy - move element delta
        oneShape - the shape to move
      • registerPathRerouteCollector

        public final void registerPathRerouteCollector​(com.nomagic.magicdraw.uml.symbols.layout.PathRerouteCollector collector)
      • getPathRerouteCollectors

        public java.util.Collection<com.nomagic.magicdraw.uml.symbols.layout.PathRerouteCollector> getPathRerouteCollectors()