Class ActivityDiagramLayouter

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

    @OpenApi
    public class ActivityDiagramLayouter
    extends HierarchicDiagramLayouter
    Automatic layouter specialized for activity diagram layouting. It is used as a default layouter for activity diagrams and diagrams, based on activity diagram.
    • Field Detail

      • DEFAULT_FIRST_SEGMENT_LENGTH

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

      • ActivityDiagramLayouter

        @OpenApi
        public ActivityDiagramLayouter()
      • ActivityDiagramLayouter

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

      • runActivityIHLLayoutSeries

        private void runActivityIHLLayoutSeries​(UMLGraph graph,
                                                ActivityLayouterOptionsGroup options,
                                                y.layout.hierarchic.IncrementalHierarchicLayouter layouter)
      • createSwimlanePartitions

        private void createSwimlanePartitions​(DiagramPresentationElement dpe,
                                              ActivityLayouterOptionsGroup options,
                                              UMLGraph graph)
        Creates information about swimlane and maps it to partition grid. Does that only if all diagram is layouted and it contains swimlanes, or if a swimlane is selected
        Parameters:
        dpe - diagram
        options - layout options
        graph - current graph
      • 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
        orientation - orientation
      • 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
      • calculateLayerSizeByChildren

        private static int calculateLayerSizeByChildren​(UMLGraph graph,
                                                        java.lang.String orientation,
                                                        int percentageToTrim)
        Finds a largest pin in graph after removing extreme values.
        Parameters:
        graph - full graph
        orientation - diagram orientation
        percentageToTrim - trims the defined percentage of longest pins
        Returns:
        the size of the largest pin, 0 if not found.
      • containsSelectedFromTheSameParent

        protected boolean containsSelectedFromTheSameParent​(DiagramPresentationElement dpe)
        Activity layouter should also consider when nodes in swimlanes are selected and layouted.
        Parameters:
        dpe - diagram
        Returns:
        true if selected in same cell(can also have elements that are owned by whole swimlane)
      • isInDifferentSwimlanes

        private static boolean isInDifferentSwimlanes​(java.lang.Iterable<PresentationElement> selectedRoots)
      • isInSameCell

        private static boolean isInSameCell​(java.lang.Iterable<PresentationElement> selectedRoots)