Class UMLGraph

  • All Implemented Interfaces:
    y.base.GraphInterface, y.layout.GraphLayout

    @OpenApi
    public class UMLGraph
    extends y.layout.DefaultLayoutGraph
    UML graph data.
    • Field Detail

      • SHRINKABLE_SHAPE_INSET_DP

        public static final java.lang.String SHRINKABLE_SHAPE_INSET_DP
        See Also:
        Constant Field Values
      • PROVIDERS

        private static final java.util.Collection<com.nomagic.magicdraw.uml.symbols.layout.LayoutableSymbolProvider> PROVIDERS
      • mFakeElementsMap

        private final java.util.Map<PresentationElement,​y.base.Edge> mFakeElementsMap
      • mReversedPaths

        private final java.util.Set<y.base.Edge> mReversedPaths
      • doNotRepaint

        private final java.util.Set<PathElement> doNotRepaint
      • mInsets

        private y.base.NodeMap mInsets
      • mShrinkableShapeInsets

        private y.base.NodeMap mShrinkableShapeInsets
      • mDataMap

        protected java.util.Map<PresentationElement,​java.lang.Object> mDataMap
        PresentationElement (path or shape) bind to yFiles edge or node.
      • mNodeMap

        protected y.base.NodeMap mNodeMap
      • mEdgeMap

        protected y.base.EdgeMap mEdgeMap
      • mNodeId

        protected y.base.NodeMap mNodeId
      • mParentNodeId

        private final y.base.NodeMap mParentNodeId
      • mGroupKey

        protected y.base.NodeMap mGroupKey
      • mMinimalGroupNodeKey

        private final y.base.NodeMap mMinimalGroupNodeKey
      • mContainsHierarchy

        private boolean mContainsHierarchy
      • mHNodeMap

        private y.base.NodeMap mHNodeMap
      • mHEdgeMap

        private y.base.EdgeMap mHEdgeMap
      • mStyle

        private java.lang.String mStyle
      • edgeLabelDataMap

        private final java.util.Map<y.base.Edge,​java.util.List<y.layout.EdgeLabelLayoutImpl>> edgeLabelDataMap
      • nodeLabelDataMap

        private final java.util.Map<y.base.Node,​java.util.List<y.layout.NodeLabelLayoutImpl>> nodeLabelDataMap
      • labelRectangles

        private final java.util.Map<com.nomagic.magicdraw.uml.symbols.layout.labels.LabelData,​java.awt.Rectangle> labelRectangles
      • partitionInfo

        private com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo partitionInfo
      • nodeToSwimlanePlacement

        private final java.util.Map<y.base.Node,​com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlaneAndCellStructure> nodeToSwimlanePlacement
      • currentSwimlane

        @CheckForNull
        protected SwimlaneView currentSwimlane
      • currentSwimlaneCellView

        @CheckForNull
        protected SwimlaneCellView currentSwimlaneCellView
      • grid

        private y.layout.grid.PartitionGrid grid
      • sphereRadius

        private int sphereRadius
      • sphereCenterPoint

        @CheckForNull
        private java.awt.Point sphereCenterPoint
      • edgeLabelFactory

        protected com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory edgeLabelFactory
      • resetLabelsAtInit

        private boolean resetLabelsAtInit
      • createNodeLabels

        private boolean createNodeLabels
      • placeNodeLabelsToCalculatedPositions

        private boolean placeNodeLabelsToCalculatedPositions
      • createEdgeLabels

        private int createEdgeLabels
      • placeEdgeLabelsTo

        private int placeEdgeLabelsTo
    • Method Detail

      • initializeData

        @OpenApi
        public void initializeData()
        Collects all data provided by diagram to nodes and edges.
      • createInsets

        private void createInsets()
      • getInsets

        public static y.geom.YInsets getInsets​(ShapeElement shape)
        Calculates insets for group nodes, applied only on group nodes
        Parameters:
        shape - the shape to calculate insets to
        Returns:
        insets
      • getInsets

        public static y.geom.YInsets getInsets​(ShapeElement shape,
                                               java.awt.Insets addAdditional)
        Calculates insets for shapes. Can add additional insets for group nodes.
        Parameters:
        shape - the shape to calculate insets to
        Returns:
        insets with additional insets
      • createStateShapeInsets

        @CheckForNull
        private static y.geom.YInsets createStateShapeInsets​(ShapeElement shape)
      • createPartShapeInsets

        private static y.geom.YInsets createPartShapeInsets​(ShapeElement shape)
      • getClassShapeInsets

        private static y.geom.YInsets getClassShapeInsets​(ShapeElement shape)
      • createNode

        protected y.base.Node createNode​(ShapeElement shape)
      • setNodeSizeEnsureNotZero

        protected void setNodeSizeEnsureNotZero​(java.awt.Rectangle bounds,
                                                y.base.Node node)
        Sets graph node size, ensures the node height or width is not 0
        Parameters:
        bounds - the bounds to set
        node - the node that should have the minimal size
      • createAllNodeLabels

        protected void createAllNodeLabels​(ShapeElement shape,
                                           y.base.Node node)
      • getBoundingBox

        public java.awt.Rectangle getBoundingBox()
        Specified by:
        getBoundingBox in interface y.layout.GraphLayout
        Overrides:
        getBoundingBox in class y.layout.LayoutGraph
      • createNode

        public y.base.Node createNode​(java.lang.Object id)
        Create new Node and set the given id to it.
        Parameters:
        id - The given id.
        Returns:
        Create node.
      • getID

        public java.lang.Object getID​(y.base.Node node)
        Get The given node ID.
        Parameters:
        node - The given node.
        Returns:
        Object.
      • createEdge

        @CheckForNull
        public y.base.Edge createEdge​(PathElement path)
        Creates an edge in a graph by provided path element.
        Parameters:
        path - the path that will correspond an edge
        Returns:
        created edge
      • createAssociationClassData

        private void createAssociationClassData​(AssociationClassView path,
                                                @CheckForNull
                                                y.base.Node clientNode,
                                                @CheckForNull
                                                y.base.Node supplierNode)
        Parameters:
        path - the association path
        clientNode - client
        supplierNode - supplier
      • createAllPathLabels

        protected void createAllPathLabels​(com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory factory)
      • getPathElement

        public PathElement getPathElement​(y.base.Edge edge)
        Get Path Element of the given edge.
        Parameters:
        edge - The given edge.
        Returns:
        PathElement.
      • getShapeElement

        public ShapeElement getShapeElement​(y.base.Node node)
        Get The given node 's Shape Element.
        Parameters:
        node - The given node.
        Returns:
        ShapeElement.
      • setParent

        public void setParent​(y.base.Node node,
                              java.lang.Object parentId)
        Set node 's parent.
        Parameters:
        node - The given node.
        parentId - The parent 's id.
      • getParentId

        public java.lang.Object getParentId​(y.base.Node node)
        Get Node 's parent id.
        Parameters:
        node - The given node.
        Returns:
        Object
      • createNodeData

        protected void createNodeData​(@CheckForNull
                                      java.lang.Object parentId,
                                      java.util.Collection<PresentationElement> presentationElements)
      • adjustFakeAtEndShapeLabelOrientation

        private void adjustFakeAtEndShapeLabelOrientation​(PresentationElement symbol)
      • addToPathList

        private void addToPathList​(PathElement path)
      • addToPathList

        private void addToPathList​(java.lang.Iterable<PathElement> paths)
      • doesNotHaveConnectedLayoutableEdges

        private boolean doesNotHaveConnectedLayoutableEdges​(ShapeElement e)
      • areParentToChildConnected

        public boolean areParentToChildConnected​(java.lang.Iterable<PathElement> connectedPathElements)
      • isAssocClsWithoutOtherRel

        private static boolean isAssocClsWithoutOtherRel​(PresentationElement view)
        Parameters:
        view - association class view
      • collectPathsRecursively

        protected void collectPathsRecursively​(ShapeElement element,
                                               y.base.Node node)
      • getNode

        @CheckForNull
        public y.base.Node getNode​(PresentationElement se)
        Get Node from the Presentation element.
        Parameters:
        se - PresentationElement.
        Returns:
        a node for presentation element, or null if not found
      • getEdge

        public y.base.Edge getEdge​(PathElement path)
        Get Edge of given path element.
        Parameters:
        path - The given path element.
        Returns:
        Edge.
      • isLayoutableByProviders

        public static boolean isLayoutableByProviders​(PresentationElement el)
        Checks if symbol is layoutable by providers
        Parameters:
        el - checked element
        Returns:
        true if symbol is layoutable, false otherwise
      • createCommands

        public void createCommands​(@CheckForNull
                                   com.nomagic.magicdraw.commands.MacroCommand mc,
                                   java.util.Map<java.lang.String,​java.lang.Object> layouterParameters)
        Create command with given parameter.
        Parameters:
        mc - MacroCommand.
        layouterParameters - layouter parameters
      • sortPEByNestingLevel

        private java.util.List<PresentationElement> sortPEByNestingLevel​(boolean bnodes)
      • placeShapes

        private void placeShapes​(java.util.Map<java.lang.String,​java.lang.Object> layouterParameters,
                                 y.layout.grouping.Grouping grouping,
                                 java.util.Set<PresentationElement> needsAutosize,
                                 java.util.Collection<PathElement> notInGraphPaths,
                                 java.lang.Iterable<PresentationElement> presentationElementList)
      • getNodeBoundsByHalos

        private java.awt.Rectangle getNodeBoundsByHalos​(@CheckForNull
                                                        y.base.Node node)
      • getEnclosingShapeHalo

        @CheckForNull
        private y.layout.NodeHalo getEnclosingShapeHalo​(@CheckForNull
                                                        y.base.Node forNode)
      • ignoreCenterlines

        protected void ignoreCenterlines​(PresentationElement shape)
        Ignores centerlines on shape bound changes for centerlineable shape.
        Parameters:
        shape - the shape to ignore centerlines on shape bound changes
      • placeNestedPorts

        private void placeNestedPorts​(boolean bnodes,
                                      java.util.Collection<PresentationElement> presentationElementList)
      • placePaths

        private void placePaths​(@CheckForNull
                                com.nomagic.magicdraw.commands.MacroCommand mc,
                                boolean bpaths,
                                com.nomagic.magicdraw.commands.MoveManager moveManager)
      • placeNonNestedPorts

        private void placeNonNestedPorts​(boolean bpaths)
      • isPathToEdgeDirectionDifferent

        private boolean isPathToEdgeDirectionDifferent​(y.base.Edge edge,
                                                       PathElement path)
      • resetUnhandledPaths

        private void resetUnhandledPaths​(boolean bnodes,
                                         boolean bpaths,
                                         com.nomagic.magicdraw.commands.MoveManager moveManager,
                                         java.lang.Iterable<PathElement> notInGraphPaths)
      • refreshParentSymbol

        private void refreshParentSymbol​(@CheckForNull
                                         com.nomagic.magicdraw.commands.MacroCommand mc)
      • placeNodeLabels

        private void placeNodeLabels​(@CheckForNull
                                     com.nomagic.magicdraw.commands.MacroCommand mc,
                                     java.lang.Iterable<PresentationElement> presentationElementList)
      • resetPath

        private void resetPath​(com.nomagic.magicdraw.commands.MoveManager moveManager,
                               PathElement path)
      • getPointsFromEdge

        public java.util.ArrayList<java.awt.Point> getPointsFromEdge​(y.base.Edge edge)
        Returns the points from an edge
        Parameters:
        edge - edge's point to return
        Returns:
        edge points excluding source and target
      • fixPathInterNodePoints

        private void fixPathInterNodePoints​(java.lang.Iterable<PresentationElement> presentationElements)
        Sorts and fixes inter nodes (paths that's one end(or both) goes inside a group node, but does not connect directly to the group node)
      • sortAndSetEdges

        private void sortAndSetEdges​(y.base.Node node,
                                     y.base.EdgeCursor edges,
                                     boolean vertical,
                                     boolean target,
                                     y.layout.grouping.Grouping grouping)
        Sorts all edges by flags.
        Parameters:
        node - node to search in
        edges - edges to sort
        vertical - determines the orientation
        target - if set to true, it will compare by source ends and sort target ends, if false the opposite.
      • setNotLayoutedChildLocation

        private static void setNotLayoutedChildLocation​(ShapeElement p,
                                                        java.awt.Point cp)
      • autosizeShapes

        private static void autosizeShapes​(java.util.Set<PresentationElement> shapes)
      • setPathBreakPoints

        private static void setPathBreakPoints​(PathElement path,
                                               java.util.List<java.awt.Point> points,
                                               java.awt.Point client,
                                               java.awt.Point supplier,
                                               @CheckForNull
                                               com.nomagic.magicdraw.commands.MacroCommand mc)
        Set Path break point.
        Parameters:
        path - Path Element.
        points - List of break point.
        client - Client point.
        supplier - Supplier point.
        mc - Macro command.
      • setPathBounds

        public static void setPathBounds​(PathElement path,
                                         java.util.List<java.awt.Point> points,
                                         java.awt.Point supplier,
                                         java.awt.Point client,
                                         @CheckForNull
                                         com.nomagic.magicdraw.commands.MacroCommand mc)
        Changes client point, supplier point and breakpoints and routes the path by layouted edge
        Parameters:
        path - current path
        points - new breakpoints
        supplier - supplier
        client - client
        mc - macro
      • handleAssociationClassPath

        private static void handleAssociationClassPath​(AssociationClassView acw)
      • savePathLabelData

        private void savePathLabelData​(boolean bpaths)
      • placeLayoutedPathLabel

        protected void placeLayoutedPathLabel​(PresentationElement pe,
                                              y.base.Edge edge,
                                              @CheckForNull
                                              com.nomagic.magicdraw.commands.MacroCommand mc)
      • getLabelDescriptorsNotAtEnd

        protected java.util.Map<y.base.Edge,​java.util.List<com.nomagic.magicdraw.uml.symbols.layout.labels.AbstractCompositeEdgeLabelDescriptor>> getLabelDescriptorsNotAtEnd()
      • placeLayoutedNodeLabel

        private void placeLayoutedNodeLabel​(PresentationElement pe,
                                            @CheckForNull
                                            com.nomagic.magicdraw.commands.MacroCommand mc)
      • resetLabel

        public void resetLabel​(PresentationElement pe)
        Resets label to their default position. This is done when collecting labels while creating graph.
        Parameters:
        pe - the element that labels will be reset
      • shouldResetLabelsAtInit

        @OpenApi
        public boolean shouldResetLabelsAtInit()
        Returns:
        if label positions should be reset before creating the graph
      • setResetLabelsAtInit

        @OpenApi
        public final void setResetLabelsAtInit​(boolean resetLabelsAtInit)
        Parameters:
        resetLabelsAtInit - true for label reset when creating the graph, false otherwise. Use true for layouting, false when graph is used as a reference for routing.
      • getEdgeLabelLocation

        public y.geom.YPoint getEdgeLabelLocation​(y.base.Edge e,
                                                  y.layout.EdgeLabelLayout ell)
        Get Location of the given edge label.
        Parameters:
        e - Edge
        ell - Edge Label Layout.
        Returns:
        Y - Point.
      • dispose

        public void dispose()
        Dispose the graph and graph related data.
      • setMinimalGroupNodeSize

        public void setMinimalGroupNodeSize​(y.base.Node node,
                                            y.geom.YDimension dim)
        Sets the minimal group node size that is obeyed by layouter.
        Parameters:
        node - the node that should have the minimal size
        dim - the size of node
      • isGroupNode

        public boolean isGroupNode​(y.base.Node node)
        Checks if a given node is a group node or not.
        Parameters:
        node - the node to check
        Returns:
        true if node is a group node, false otherwise.
      • getStyle

        @OpenApi
        public java.lang.String getStyle()
        Get String representation of Style.
        Returns:
        String.
      • setPathStyle

        @OpenApi
        public void setPathStyle​(java.lang.String style)
        Set path style
        Parameters:
        style - path style to set
      • makeSubTrees

        public void makeSubTrees​(com.nomagic.magicdraw.commands.MacroCommand mc)
        Make sub trees with the given Macrocommand.
        Parameters:
        mc - macro
      • makeSubTree

        public void makeSubTree​(y.base.Node node,
                                java.lang.Class<?> classType,
                                com.nomagic.magicdraw.commands.MacroCommand mc)
        Make sub tree.
        Parameters:
        node - The given node.
        classType - The given class type.
        mc - Macro Command.
      • isTreeOverlapping

        public static boolean isTreeOverlapping​(TreeView tree,
                                                int y,
                                                java.lang.Iterable<TreeView> trees)
        Check Is tree overlapping.
        Parameters:
        tree - The given tree view.
        y - y coordinate of the horizontal bar of the tree view.
        trees - Collection of trees.
        Returns:
        boolean.
      • removeSubTrees

        public static void removeSubTrees​(@CheckForNull
                                          com.nomagic.magicdraw.commands.MacroCommand mc,
                                          DiagramPresentationElement dpe,
                                          java.util.Set<PresentationElement> selection)
        Remove Sub Trees from the given presentation element.
        Parameters:
        mc - MacroCommand
        dpe - DiagramPresentation.
        selection - if not null or empty removes only trees that groups all selected paths or all path connectors.
      • isTreeInSelection

        private static boolean isTreeInSelection​(TreeView tree,
                                                 java.util.Collection<PresentationElement> selection)
        Tests if given tree is in selection. The tree is in selection if all paths are in selection or all paths ends are in selection.
        Parameters:
        tree - some tree view
        selection - selected elements in diagram
        Returns:
        true if given path is in selection, otherwise false.
      • belongsToHierarchy

        public boolean belongsToHierarchy​(y.base.Node node)
        Checks the given node belongs to Hierarchy.
        Parameters:
        node - The given node.
        Returns:
        true, if the node belongs to some hierarchy
      • belongsToHierarchy

        public boolean belongsToHierarchy​(y.base.Edge edge)
        Check The given Edge belongs to hierarchy.
        Parameters:
        edge - The given edge.
        Returns:
        boolean
      • containsHierarchy

        public boolean containsHierarchy()
        Check If contains hierarchy.
        Returns:
        boolean
      • createHierarchicInfo

        public void createHierarchicInfo​(@CheckForNull
                                         java.util.Collection<java.lang.Class<?>> classTypes)
        Create Hierarchy Information of path element.
        Parameters:
        classTypes - List of class type.
      • drawResults

        public void drawResults()
        Draw a result. You need to comment the graph.dispose() call in AbstractDiagramLayouter in order to see the results.
      • getSelected

        @OpenApi
        public java.util.Set<PresentationElement> getSelected()
        Get Set of the selected PresentationElement.
        Returns:
        Set set of selected presentation elements
      • addEdgeSelectionProvider

        public y.base.EdgeMap addEdgeSelectionProvider​(java.lang.Object provider,
                                                       java.util.Collection<y.base.Edge> c)
        Add Edge Selection Provider.
        Parameters:
        provider - The given provider.
        c - Collection of Edge.
        Returns:
        EdgeMap.
      • addEdgeSelectionProvider

        public y.base.EdgeMap addEdgeSelectionProvider​(java.lang.Object provider,
                                                       y.base.Edge edge)
        Add Edge Selection Provider.
        Parameters:
        provider - The given provider.
        edge - single edge
        Returns:
        EdgeMap.
      • addGroupNodeInsetsProvider

        public void addGroupNodeInsetsProvider()
        Add Group node inset provider.
      • removeGroupNodeInsetsProvider

        public void removeGroupNodeInsetsProvider()
        Remove The group node in sets of provider.
      • addShrinkableGroupNodeInsetsProvider

        private void addShrinkableGroupNodeInsetsProvider()
        Add shrinkable shape group node inset provider.
      • removeShrinkableGroupNodeInsetsProvider

        private void removeShrinkableGroupNodeInsetsProvider()
        Remove the shrinkable shpae group node in sets of provider.
      • createGroupBoundsCalculator

        public y.layout.grouping.GroupBoundsCalculator createGroupBoundsCalculator()
        Creates bounds calculator for group nodes
        Returns:
        calculator
      • getNodeMap

        public y.base.NodeMap getNodeMap()
        Returns:
        a node map associated with a data provider
      • getEdgeMap

        public y.base.EdgeMap getEdgeMap()
        Returns:
        an edge map associated with a data provider
      • getDataMap

        public java.util.Map<PresentationElement,​java.lang.Object> getDataMap()
        Returns:
        an edge map associated with a data provider
      • reverseAndAddToNoReverseList

        public void reverseAndAddToNoReverseList​(y.base.Edge edg)
        Reverses an edge in graph, does not reverse if path is already reversed. This method handles label sides also, but only if they are described by PreferredPlacementDescriptor. PreferredPlacementDescriptor.PLACE_AT_TARGET is changed to PreferredPlacementDescriptor.PLACE_AT_SOURCE
        Parameters:
        edg - the edge to reverse
      • reverseEdgeAndLabels

        public void reverseEdgeAndLabels​(y.base.Edge edg)
        Reverses the edge along with labels, but does not add them to no reverse list.
        Parameters:
        edg - edge to reverse
      • reverseEdge

        public void reverseEdge​(y.base.Edge edge)
        Reverses an edge. Note: does not reverse the labels if they are placed on edge ends. Check the reverseAndAddToNoReverseList method.
        Overrides:
        reverseEdge in class y.base.Graph
        Parameters:
        edge - edge to reverse
      • addToReversedList

        public void addToReversedList​(y.base.Edge edge)
        Parameters:
        edge - edge to add
      • getReversedList

        public java.util.Set<y.base.Edge> getReversedList()
        Returns:
        a list of reversed edges
      • setPlaceEdgeLabelsTo

        public void setPlaceEdgeLabelsTo​(int placeEdgeLabelsTo)
        Sets the calculated label placement for labels. Labels can be created for consideration only, but not placed at the calculated location. One of EDGE_LABEL_NONE, EDGE_LABEL_AT_ENDS, EDGE_LABEL_NON_ENDS , EDGE_LABEL_ALL. EDGE_LABEL_ALL by default.
        Parameters:
        placeEdgeLabelsTo - the edge placement mode
      • getPlaceEdgeLabelsPositions

        public int getPlaceEdgeLabelsPositions()
        Returns:
        the edge placement mode
      • setCreateEdgeLabels

        public void setCreateEdgeLabels​(int createEdgeLabels)
        Sets the label creation mode. One of EDGE_LABEL_NONE, EDGE_LABEL_AT_ENDS, EDGE_LABEL_NON_ENDS , EDGE_LABEL_ALL. EDGE_LABEL_ALL by default.
        Parameters:
        createEdgeLabels - edge placement mode
      • getCreateEdgeLabels

        public int getCreateEdgeLabels()
        Returns:
        the edge creation mode
      • setPlaceNodeLabels

        public void setPlaceNodeLabels​(boolean shouldPlaceNodeLabelsToCalculatedPositions)
        Parameters:
        shouldPlaceNodeLabelsToCalculatedPositions - determines if node labels should be placed at the calculated graph position
      • shouldPlaceNodeLabels

        public boolean shouldPlaceNodeLabels()
        Returns:
        true if node labels should be set at the calculated position, false for the default position
      • setCreateNodeLabels

        public void setCreateNodeLabels​(boolean shouldCreateNodeLabels)
        Parameters:
        shouldCreateNodeLabels - determines if node labels should be created and considered by the graph
      • shouldCreateNodeLabels

        public boolean shouldCreateNodeLabels()
        Returns:
        the node label creation mode
      • removeGroupNodeFlagFromNonGroups

        private void removeGroupNodeFlagFromNonGroups()
        Grouping flag can appear even if shape has pins/ports but nothing inside it. These invalid flags are removed here.
      • getPartitionGrid

        public y.layout.grid.PartitionGrid getPartitionGrid()
        Returns:
        instance of partition grid
      • getPartitionInfo

        public com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo getPartitionInfo()
        Returns:
        the constructed partition info.
      • setPartitionGrid

        public void setPartitionGrid​(y.layout.grid.PartitionGrid partitionGrid)
        Parameters:
        partitionGrid - sets to use this partition grid as grid
      • setPartitionInfo

        public void setPartitionInfo​(com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo info)
        Parameters:
        info - the information of partitions
      • getNodeToSwimlaneStructure

        public java.util.Map<y.base.Node,​com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlaneAndCellStructure> getNodeToSwimlaneStructure()
        Returns:
        the node belonging to a swimlane structure
      • setSphereRadius

        @OpenApi
        public void setSphereRadius​(int radius)
        Sets the sphere from the defined point. All element within this sphere will be collected and initiated. Shapes outside the sphere will be ignored.
        Parameters:
        radius - the radius that shapes are collected
      • getSphereRadius

        @OpenApi
        public int getSphereRadius()
        Returns:
        the sphere size for data initialization
      • setSphereCenterPoint

        @OpenApi
        public void setSphereCenterPoint​(@CheckForNull
                                         java.awt.Point point)
        Sets the center of the sphere that is used for node creation
        Parameters:
        point - new point of center, default is 0,0
      • getSphereCenterPoint

        @CheckForNull
        @OpenApi
        public java.awt.Point getSphereCenterPoint()
        Returns:
        the center of the sphere for node creation
      • isInSphereRadius

        protected boolean isInSphereRadius​(ShapeElement element)
        Returns:
        true, if shape is in sphere radius, or sphere radius is the default, false otherwise.
      • getNodeHaloAdjustedSourcePointAbs

        public y.geom.YPoint getNodeHaloAdjustedSourcePointAbs​(y.base.Edge edge)
        Get absolute location of edge source point on halo, not on the source node itself. As symbols themselves are adjusted by the halos, this is necessary for on edge shape placement to calculate a correct position. Currently only UMLGraphKeys.ENCLOSING_SHAPE_HALO_DP_KEY is considered.
        Parameters:
        edge - edge
        Returns:
        the source point on halo, rather than node
      • getNodeHaloAdjustedTargetPointAbs

        public y.geom.YPoint getNodeHaloAdjustedTargetPointAbs​(y.base.Edge edge)
        Get absolute location of edge target point on halo, not on the target node itself. As symbols themselves are adjusted by the halos, this is necessary for on edge shape placement to calculate a correct position. Currently only UMLGraphKeys.ENCLOSING_SHAPE_HALO_DP_KEY is considered.
        Parameters:
        edge - edge
        Returns:
        the target point on halo, rather than node
      • getNodeHaloAdjustedPoint

        @CheckForNull
        private y.geom.YPoint getNodeHaloAdjustedPoint​(y.base.Edge edge,
                                                       y.base.Node sourceNode,
                                                       y.geom.YPoint pointAtSourceOrTarget)
      • addProvider

        public static void addProvider​(com.nomagic.magicdraw.uml.symbols.layout.LayoutableSymbolProvider provider)
        Registers a new provider
        Parameters:
        provider - provider
      • setEdgeLabelFactory

        public void setEdgeLabelFactory​(com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory edgeLabelFactory)
      • getNonSupportedSymbols

        public java.util.Set<PresentationElement> getNonSupportedSymbols()
        Returns:
        set of symbols(shapes or paths) that are not supported by the graph and will not be included into layout and/or will be treated not as a part of the graph
      • getDoNotRepaintPaths

        public java.util.Set<PathElement> getDoNotRepaintPaths()
        Returns:
        set of collected paths that are included in the layout, but not repainted according to the graph result
      • getFakeElementsMap

        public java.util.Map<PresentationElement,​y.base.Edge> getFakeElementsMap()
      • getInsetMap

        public y.base.NodeMap getInsetMap()
      • getEdgeLabelDataMap

        public java.util.Map<y.base.Edge,​java.util.List<y.layout.EdgeLabelLayoutImpl>> getEdgeLabelDataMap()
      • getNodeLabelDataMap

        public java.util.Map<y.base.Node,​java.util.List<y.layout.NodeLabelLayoutImpl>> getNodeLabelDataMap()