Class PathElement

java.lang.Object
com.nomagic.magicdraw.uml.MDElementImpl
All Implemented Interfaces:
BaseElement, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.LineJumpDrawer, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, PropertyChangeListener, Cloneable, Comparable, 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 Details

    • RECTILINEAR

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

      @OpenApi public static final String OBLIQUE
      Polyline path line style.
      See Also:
    • BEZIER

      @OpenApi public static final String BEZIER
      Bezier path line style.
      See Also:
    • LINE_STYLE

      @OpenApi public static final List<String> LINE_STYLE
      All possible path line styles.
  • Method Details

    • getBreakPoints

      @OpenApi public final List<Point> getBreakPoints()
      Returns break points of the path. The order of break points is from supplier to the client path's end. Use PresentationElementsManager to change the break points for the path.
      Returns:
      break points list.Points in the list are not cloned, so do not modify them directly. List is unmodifiable.
      See Also:
    • getAllBreakPoints

      @OpenApi public final List<Point> getAllBreakPoints()
      Returns breaks points list with added supplier and client end point in the list as well. Use PresentationElementsManager to change the break points for the path.
      Returns:
      supplier point + break points + client point. Points in the list are not cloned, so do not modify them directly. List is modifiable.
      See Also:
    • getSupplierPoint

      @OpenApi public final 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 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 Point getPointOnPath(Point supplierPoint, Point clientPoint, List<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 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:
      Exception