Class StateDiagramLayouter

  • All Implemented Interfaces:
    DiagramLayouter, java.lang.Cloneable

    @OpenApi
    public class StateDiagramLayouter
    extends HierarchicDiagramLayouter
    A specialized layouter for state and protocol state diagrams. It is also used as a default layouter for diagrams that are based on them.
    • Field Detail

      • predefinedType

        private com.nomagic.magicdraw.uml.symbols.layout.state.StateDiagramLayouter.Type predefinedType
      • DEFAULT_FIRST_SEGMENT_LENGTH

        private static final int DEFAULT_FIRST_SEGMENT_LENGTH
        See Also:
        Constant Field Values
    • Constructor Detail

      • StateDiagramLayouter

        @OpenApi
        public StateDiagramLayouter()
    • Method Detail

      • determineDirection

        private static void determineDirection​(UMLGraph graph)
      • requiresDirectedEdge

        private static boolean requiresDirectedEdge​(PathElement pathElement)
      • hasConstraintRequiringShapes

        private static boolean hasConstraintRequiringShapes​(UMLGraph graph)
      • isChoice

        private static boolean isChoice​(ShapeElement shape)
      • moveToAppropriateFrameEdge

        private static void moveToAppropriateFrameEdge​(DiagramPresentationElement dpe,
                                                       UMLGraph graph,
                                                       java.lang.String orientation)
        Moves shapes on diagram frame to appropriate frame. If shape has outgoing relations and orientation is set to top to bottom, then it should be placed on top and etc.
        Parameters:
        dpe - diagram
        graph - layouted graph
        orientation - layout orientation
      • findLargestEntryExit

        private static int findLargestEntryExit​(UMLGraph graph,
                                                java.lang.String orientation)
        Finds the largest entry or exit state, also include transition guard labels, trims the extremes.
        Parameters:
        graph - layouted graph
        orientation - layout orientation
        Returns:
        a largest entry/exit with extremes trimmed
      • moveElementsByFakeEdges

        private static void moveElementsByFakeEdges​(UMLGraph graph,
                                                    java.lang.String orientation)
        Moves elements like pins according to the fake edges that are connected to them. Input pin is put where fake target edge connects etc.
        Parameters:
        graph - the graph
      • getPredefinedLayouterType

        public com.nomagic.magicdraw.uml.symbols.layout.state.StateDiagramLayouter.Type getPredefinedLayouterType()
      • setPredefinedLayouterType

        public void setPredefinedLayouterType​(com.nomagic.magicdraw.uml.symbols.layout.state.StateDiagramLayouter.Type type)