Class PathConnector

  • All Implemented Interfaces:
    BaseElement, MDElement, ModelElementProvider, NameOwner, java.beans.PropertyChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener
    Direct Known Subclasses:
    PathElement, ShapeElement

    @OpenApi
    public abstract class PathConnector
    extends PresentationElement
    This class is base class for presentation elements connectible by some path element. This means that instance of this class can have incoming or outgoing path elements.
    • Field Detail

      • connectedPaths

        @CheckForNull
        private java.util.List<PathElement> connectedPaths
        List of connected path elements.
      • showsProxy

        @CheckForNull
        protected java.lang.Boolean showsProxy
    • Constructor Detail

      • PathConnector

        public PathConnector()
    • Method Detail

      • getConnectedPathElements

        @OpenApi
        public final java.util.List<PathElement> getConnectedPathElements()
        Returns connected path elements. If element has no path elements returns empty list.
        Returns:
        connected path elements. Collection is unmodifiable.
      • getConnectedPathElements

        @OpenApi
        public java.util.List<PathElement> getConnectedPathElements​(boolean incoming)
        Returns connected path elements by direction.
        Parameters:
        incoming - true if incoming paths should be selected, false if outgoing.
        Returns:
        connected path elements.
      • getConnectedPathElements

        @OpenApi
        public java.util.List<PathElement> getConnectedPathElements​(boolean incoming,
                                                                    boolean excludeToSelf)
        Returns connected path elements by direction with an option to exclude paths to self
        Parameters:
        incoming - true if incoming paths should be selected, false if outgoing.
        excludeToSelf - true if paths with source equal to target should not be added to the list, false to include them
        Returns:
        connected path elements.
      • getConnectedPathElementCount

        @OpenApi
        public final int getConnectedPathElementCount()
        Returns number of connected path elements.
        Returns:
        number of connected path elements.
      • sSetConnectedPathElements

        public void sSetConnectedPathElements​(java.util.List<PathElement> paths)
        Sets new path elements.
        Parameters:
        paths - list of path elements.
      • addConnectedPathElement

        public boolean addConnectedPathElement​(PathElement element)
        Adds new path element, and recalculates its position.
        Parameters:
        element - element to be added.
        Returns:
        true if element was added
      • sAddConnectedPathElement

        public boolean sAddConnectedPathElement​(PathElement element)
        Adds new path element.
        Parameters:
        element - element to be added.
        Returns:
        true if element was added
      • sRemoveConnectedPathElement

        public boolean sRemoveConnectedPathElement​(PathElement element)
        Removes path element.
        Parameters:
        element - element to remove.
        Returns:
        true if element was removed
      • removeConnectedPathElement

        public boolean removeConnectedPathElement​(PathElement link)
        Removes path element.
        Parameters:
        link - element to remove.
        Returns:
        true if element was removed
      • movePathElements

        public void movePathElements()
      • movePathElement

        protected abstract void movePathElement​(PathElement element,
                                                @CheckForNull
                                                PathConnector requestor)
        Calculates position of path element.
        Parameters:
        element - element which position will be calculated.
        requestor - the requestor of this path moving. Implementations may check in order to avoid endless loops.
      • movePathElement

        public final void movePathElement​(PathElement path,
                                          boolean notify)
        Calculates position of path element.
        Parameters:
        path - path element to calculate.
        notify - true if both ends of path element should be calculated.
      • disposeConnectedPaths

        protected void disposeConnectedPaths()
      • accept

        @OpenApi
        public void accept​(Visitor visitor)
                    throws java.lang.Exception
        Description copied from interface: MDElement
        Method accepts visitor, and calls method visit<class name>(this) of visitor . See Visitor pattern for more details.
        Specified by:
        accept in interface MDElement
        Overrides:
        accept in class com.nomagic.magicdraw.uml.MDElementImpl
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • sSetVisibility

        public void sSetVisibility​(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
        Description copied from class: PresentationElement
        Sets element visibility flag.
        Parameters:
        visibility - flag value
      • setVisibility

        public void setVisibility​(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
        Description copied from class: PresentationElement
        Sets element visibility flag.
        Parameters:
        visibility - flag value
      • getPreferredArrowLength

        public int getPreferredArrowLength()
      • selectPathsForMoving

        protected java.util.List<PathElement> selectPathsForMoving​(java.util.List<PresentationElement> subPresentationElements)
        Description copied from class: PresentationElement
        Select paths to move with current symbol from deep structure. Some paths can be connected to current symbol, but owned in some deep child of this symbol.
        Parameters:
        subPresentationElements - sub children of this symbol
        Returns:
        paths to move together with current symbol
      • getConnectedPathElement

        @CheckForNull
        public PathElement getConnectedPathElement​(Element element)
        Return connected path with given element
        Parameters:
        element - element
        Returns:
        connected path element of given element.
      • checkShowsProxy

        protected boolean checkShowsProxy()
      • isShowsProxy

        public final boolean isShowsProxy()
      • clearShowsProxy

        public void clearShowsProxy()
      • findSymbolForEnd

        @CheckForNull
        public PresentationElement findSymbolForEnd​(Element element,
                                                    java.lang.Class<? extends PresentationElement> preferredEndType,
                                                    boolean asClient)
        Find symbol for Path end (client or supplier)
        Parameters:
        element - path end element
        preferredEndType - preferred end type
        asClient - search for client element if true
        Returns:
        found symbol or null
      • createSmartListenerConfig

        protected void createSmartListenerConfig​(java.util.List<SmartListenerConfig> configurations)