Class AbstractLinkDiagramLayouter

    • Constructor Detail

      • AbstractLinkDiagramLayouter

        @OpenApi
        public AbstractLinkDiagramLayouter​(java.lang.String optionId,
                                           boolean nodes,
                                           boolean paths)
        Construct AbstractLinkDiagramLayouter with the given argument.
        Parameters:
        optionId - String.
        nodes - boolean.
        paths - boolean.
      • AbstractLinkDiagramLayouter

        @OpenApi
        @Deprecated
        public AbstractLinkDiagramLayouter​(java.lang.String optionId,
                                           boolean nodes,
                                           boolean paths,
                                           boolean supportsSubgraph)
        Deprecated.
        supportsSubgraph has no effect
        Construct AbstractLinkDiagramLayouter with the given argument.
        Parameters:
        optionId - String.
        nodes - boolean.
        paths - boolean.
        supportsSubgraph - boolean.
    • Method Detail

      • resizeFrameIfNecessary

        protected void resizeFrameIfNecessary​(DiagramPresentationElement dpe,
                                              UMLGraph graph,
                                              com.nomagic.magicdraw.commands.MacroCommand mc)
        Description copied from class: AbstractDiagramLayouter
        Resizes diagram frame if there are no elements selected.
        Parameters:
        dpe - diagram
        mc - macro command
      • postprocessing

        protected void postprocessing​(UMLGraph graph,
                                      com.nomagic.magicdraw.commands.MacroCommand mc)
        Description copied from class: AbstractDiagramLayouter
        Does some post processing after layout. Moves the graph, layouts swimlanes.
        Parameters:
        graph - the graph data for post processing
      • containsSelectedFromTheSameParent

        protected boolean containsSelectedFromTheSameParent​(DiagramPresentationElement dpe)
        Description copied from class: AbstractDiagramLayouter
        Checks if selected elements have the same parent. if nothing is selected return true
      • getSelected

        @OpenApi
        protected java.util.Set<PresentationElement> getSelected​(DiagramPresentationElement diagramView)
        Description copied from class: AbstractDiagramLayouter
        Collects a set of selected layoutable presentation elements in a diagram
        Overrides:
        getSelected in class AbstractDiagramLayouter
        Parameters:
        diagramView - the diagram that elements were selected in
        Returns:
        the selected paths and any paths that are connected to selected shapes. Paths connected by other shape element on shape edge are also included
      • getConnectedPaths

        public static java.util.Set<PresentationElement> getConnectedPaths​(DiagramPresentationElement diagramView)
        Gets the selected paths and any paths that are connected to selected shapes. Paths connected by other shape element on shape edge are also included
        Parameters:
        diagramView - diagram
        Returns:
        a set of path elements that should be processed
      • getAllPaths

        private static java.util.List<PathElement> getAllPaths​(PresentationElement next)
        Parameters:
        next - the element to collect all paths from(collects from on edge shapes also)
      • collectShapesOnEdgeRecursively

        private static void collectShapesOnEdgeRecursively​(PresentationElement next,
                                                           java.util.List<PresentationElement> allShapes)
        Parameters:
        next - the object to search in
        allShapes - stores all objects collected recursively
      • addIfNotPresent

        private static void addIfNotPresent​(java.util.Collection<PresentationElement> pathsToLayout,
                                            PresentationElement el)
        Adds element el to the list, if it does not exist there already
        Parameters:
        pathsToLayout - the list to add to
        el - the element to add
      • clearOldRectangles

        protected void clearOldRectangles​(UMLGraph graph)
        Description copied from class: AbstractDiagramLayouter
        Clears old rectangles for shapes. The old rectangle is used for link placement in movePath, MoveManager.
        Parameters:
        graph - layouted graph