Class PathElement

  • All Implemented Interfaces:
    BaseElement, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.LineJumpDrawer, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, java.beans.PropertyChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener
    Direct Known Subclasses:
    com.nomagic.magicdraw.uml.symbols.paths.ContainerLinkView, ContainmentLinkView, LinkAttributeView, NoteAnchorView

    @OpenApi
    public abstract class PathElement
    extends PathConnector
    implements com.nomagic.magicdraw.uml.symbols.LineJumpDrawer, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
    Base class for all paths. Path is representation element which connects two other elements.
    • Field Detail

      • RECTILINEAR

        @OpenApi
        public static final java.lang.String RECTILINEAR
        Path line style with rectilinear (90 degrees) breakpoint corners.
        See Also:
        Constant Field Values
      • OBLIQUE

        @OpenApi
        public static final java.lang.String OBLIQUE
        Polyline path line style.
        See Also:
        Constant Field Values
      • BEZIER

        @OpenApi
        public static final java.lang.String BEZIER
        Bezier path line style.
        See Also:
        Constant Field Values
      • LINE_STYLE

        @OpenApi
        public static final java.util.List<java.lang.String> LINE_STYLE
        All possible path line styles.
    • Method Detail

      • getSupplierPoint

        @OpenApi
        public final java.awt.Point getSupplierPoint()
        Returns point where path connects supplier end's element.
        Returns:
        supplier connection point. This method returns not cloned point, so do not modify it directly.
      • getClientPoint

        @OpenApi
        public final java.awt.Point getClientPoint()
        Returns point where path connects client end's element.
        Returns:
        client point. This method returns not cloned point, so do not modify it directly.
      • getClient

        @OpenApi
        public PresentationElement getClient()
        Returns client of the path.
        Returns:
        client element.
      • getSupplier

        @OpenApi
        public PresentationElement getSupplier()
        Returns supplier of the path.
        Returns:
        supplier end element.
      • isConnectable

        @OpenApi
        public final boolean isConnectable​(@CheckForNull
                                           PresentationElement supplier,
                                           @CheckForNull
                                           PresentationElement client)
        Checks if this path can connect given two elements.
        Parameters:
        supplier - candidate for path's supplier.
        client - candidate for path's client.
        Returns:
        true, if path can connect given elements.
      • getPointOnPath

        @OpenApi
        public java.awt.Point getPointOnPath​(java.awt.Point supplierPoint,
                                             java.awt.Point clientPoint,
                                             java.util.List<java.awt.Point> breakpoints,
                                             double coefficient)
        Parameters:
        supplierPoint - supplier end point
        clientPoint - client end point
        breakpoints - list of breakpoints between supplier and client in that order
        coefficient - ratio between 0 and 1 describing position relative to the path length. Provide 0.5 for middle point.
        Returns:
        point on path
      • 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 PathConnector
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception