Class CompositeStructureDiagramLayouter

  • All Implemented Interfaces:
    DiagramLayouter, java.lang.Cloneable
    Direct Known Subclasses:
    ClassDiagramLayouter

    @OpenApi
    public class CompositeStructureDiagramLayouter
    extends HierarchicDiagramLayouter
    Specialized layouter for composite diagram. It is used as a default layouter for composite structure diagrams and diagrams based on it.
    • Field Detail

      • can

        @CheckForNull
        protected com.nomagic.magicdraw.uml.symbols.layout.AbstractCustomCandidates can
    • Constructor Detail

      • CompositeStructureDiagramLayouter

        @OpenApi
        public CompositeStructureDiagramLayouter()
      • CompositeStructureDiagramLayouter

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

      • moveToRight

        private static void moveToRight​(java.awt.Rectangle diagramFrameBounds,
                                        ShapeElement shape,
                                        java.awt.Rectangle bounds)
      • moveToLeft

        private static void moveToLeft​(ShapeElement shape,
                                       java.awt.Rectangle bounds)
      • moveToBottom

        private static void moveToBottom​(java.awt.Rectangle diagramFrameBounds,
                                         ShapeElement shape,
                                         java.awt.Rectangle bounds)
      • moveToTop

        private static void moveToTop​(ShapeElement shape,
                                      java.awt.Rectangle bounds)
      • moveElementsByFakeEdges

        private void moveElementsByFakeEdges​(UMLGraph graph,
                                             com.nomagic.magicdraw.commands.MacroCommand mc)
        Moves ports by fake edges. It considers if ports have outgoing connector deeper to the child part and can apply a according constraint.
        Parameters:
        graph - the graph
      • sortLayoutableByNesting

        private static void sortLayoutableByNesting​(UMLGraph graph,
                                                    y.base.NodeMap nodeMap,
                                                    java.util.List<ShapeElement> shapeElementList)
        Finsd all layoutable shape elements and sorts them by nesting level
        Parameters:
        graph - graph
        nodeMap - node map
        shapeElementList - layoutable shapes
      • collectPlacementData

        private java.util.List<com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData> collectPlacementData​(UMLGraph graph,
                                                                                                                                                            java.lang.Iterable<ShapeElement> shapeElementList)
        Collects the placement data by constraint maps from candidates and adds them to a placement
        Parameters:
        graph - graph
        shapeElementList - layoutable elements
      • swapsPortLocationsByCrossings

        private void swapsPortLocationsByCrossings​(UMLGraph graph,
                                                   java.util.List<com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData> placementData)
        Swaps ports location by possible crossings. Does this for each edge separately.
        Parameters:
        graph - graph
        placementData - the placement data
      • setPortLocation

        private static void setPortLocation​(java.util.Collection<com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData> placementData,
                                            com.nomagic.magicdraw.commands.MacroCommand mc)
      • getPossiblePathOverlapCount

        private int getPossiblePathOverlapCount​(UMLGraph graph,
                                                java.util.Collection<com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData> placementData,
                                                com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData first,
                                                com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData second)
      • getConstraintSide

        @CheckForNull
        private static java.lang.Byte getConstraintSide​(com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData first)
      • getDataByShapeOnEdge

        @CheckForNull
        private com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData getDataByShapeOnEdge​(UMLGraph graph,
                                                                                                                                            java.util.Collection<com.nomagic.magicdraw.uml.symbols.layout.composite.CompositeStructureDiagramLayouter.PortPlacementData> allData,
                                                                                                                                            @CheckForNull
                                                                                                                                            ShapeElement shapeOnEdge)