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 path kinds of symbols. Path is a symbol that connects two other symbols as a graphical path.
  • 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.
  • Constructor Details

    • PathElement

      public PathElement()
    • PathElement

      public PathElement(@CheckForNull PresentationElement parent)
  • Method Details

    • getOwnStyleDelegate

      public com.dassault_systemes.modeler.foundation.diagram.style.PathStylePropertyDelegate getOwnStyleDelegate()
      Overrides:
      getOwnStyleDelegate in class PresentationElement
      Returns:
      the own style property delegate
    • clearSupplierTranslation

      public void clearSupplierTranslation()
      Clears a supplier translated flag.
    • clearClientTranslation

      public void clearClientTranslation()
      Clears a client translated flag.
    • translateSupplierPoint

      public final Point translateSupplierPoint(Rectangle old, Rectangle newR)
    • translateClientPoint

      public final Point translateClientPoint(Rectangle old, Rectangle newR)
    • getNewPointByTheLink

      @CheckForNull public Point getNewPointByTheLink(List<Point> oldBreaks, List<Point> newBreaks, Point oldLocation)
    • hasSharedModelElement

      public boolean hasSharedModelElement()
      Description copied from class: PresentationElement
      Returns true if ModelElement of this symbol can represented with other symbol. If ModelElement is not shared, it can be deleted together with symbol deleting.
      Overrides:
      hasSharedModelElement in class PresentationElement
      Returns:
      true if element of this symbol can be represented with other symbol.
    • askDeleteDataConfirmation

      public boolean askDeleteDataConfirmation()
      Return true, because while deleting link view user must be prompt about deleting data
      Overrides:
      askDeleteDataConfirmation in class PresentationElement
      Returns:
      confirmation status -- true if asking is necessary, false otherwise
    • setBreakable

      public void setBreakable(boolean value)
      Sets a breakable flag on/off. If a flag is not set, a path cannot be broken. However, a path can have break points and be non-breakable. This means that path has fixed points that cannot be moved.
      Parameters:
      value - flag value
    • sSetBreakable

      public void sSetBreakable(boolean value)
      Sets a breakable flag on/off. If a flag is not set, a path cannot be broken. However, a path can have break points and be non-breakable. This means that path has fixed points that cannot be moved.
      Parameters:
      value - flag value
    • isBreakable

      public boolean isBreakable()
      Shows whether a path is breakable.
      Returns:
      true if a path can be broken
    • isFixed

      public boolean isFixed()
      If a path tied to its supplier and client (cannot be reconnected)
      Returns:
      true, if it can be reconnected, else false
    • 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. The List is unmodifiable.
      See Also:
    • getAllBreakPoints

      @OpenApi public final List<Point> getAllBreakPoints()
      Returns a break 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. The List is modifiable.
      See Also:
    • setBreakPoints

      public final void setBreakPoints(List<Point> vct)
      Sets break point vector.
      Parameters:
      vct - new break point vector.
    • sClearBreakPoints

      public final void sClearBreakPoints()
      Clear break points list.
    • sSetBreakPoints

      public final void sSetBreakPoints(List<Point> vct)
      Only sets break point vector.
      Parameters:
      vct - new break point vector.
    • sAddBreakPoint

      public final void sAddBreakPoint(Point pt)
      Adds new break point.
      Parameters:
      pt - point to be added.
    • sSetBreakPoint

      public final void sSetBreakPoint(Point pt, int pos)
      Sets break point at the given position.
      Parameters:
      pt - point to be set
      pos - position where it must be set
    • needsToMoveOtherEnd

      public boolean needsToMoveOtherEnd()
      Returns:
      true, if one end of links changed bounds and move link must be called for both ends.
    • getBreakPoint

      public Point getBreakPoint(int pos)
      Returns break point with given index.
      Parameters:
      pos - position where point resides.
      Returns:
      point at position pos.
    • getBreakPointCount

      public int getBreakPointCount()
      returns size of break point vector
      Returns:
      break point count
    • setBounds

      public void setBounds(Rectangle r)
      Moves link to new location.
      Specified by:
      setBounds in class PresentationElement
      Parameters:
      r - new location of a path
    • simpleSetBounds

      public void simpleSetBounds(Rectangle r)
      calls break point vector changed method.
      Overrides:
      simpleSetBounds in class PresentationElement
      Parameters:
      r - new bounding rectangle.
    • isToSelf

      public boolean isToSelf()
      Returns:
      true if this path is to self (client and supplier are the same).
    • isAlwaysToSelf

      public boolean isAlwaysToSelf()
    • sSetBounds

      public void sSetBounds(Rectangle r)
      Moves path to new location.
      Specified by:
      sSetBounds in class PresentationElement
      Parameters:
      r - new location of a path
    • removeUnnecessaryBreakPoints

      public void removeUnnecessaryBreakPoints()
      Removes unnecessary points from break point vector. Checks if break point vector has useless points (covered by shape or invisible). Does not do anything if a path cannot be breakable. If it has, remove them.
    • getPathIcon

      @CheckForNull public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon getPathIcon()
    • dynamicPathIcon

      @CheckForNull public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon dynamicPathIcon()
    • dynamicPathIcon

      public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon dynamicPathIcon(@CheckForNull com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon pathIcon)
    • getCustomStereotypeIcon

      @CheckForNull public static com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon getCustomStereotypeIcon(@CheckForNull Element element)
    • draw

      public void draw(Graphics2D g, Point supplierPoint, Point clientPoint, List<Point> breakPoints)
      Draws link from given point pt1 through break points to given point pt2.
      Parameters:
      g - graphics
      supplierPoint - first point
      clientPoint - second point
      breakPoints - points between supplier and client points, in that order
    • internalGetBoundsShape

      @CheckForNull public Shape internalGetBoundsShape(ConverterToShape converterToShape)
      Overrides:
      internalGetBoundsShape in class PresentationElement
    • setLineJumpPlace

      public void setLineJumpPlace(@CheckForNull com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace)
      Sets line jump place of the path element.
      NOTE: Only LineJumpManager can set jump place of the link. Since LineJumpManager will reset line jump place on every repaint of a diagram then other invocations of the method will not have an effect.
      Specified by:
      setLineJumpPlace in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Parameters:
      lineJumpPlace - new line jump place.
    • registerLineJumpInfos

      public void registerLineJumpInfos(int pathIndex, Point segmentStartPoint, @CheckForNull List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> lineJumps)
      Description copied from interface: com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Registers line jump info for specified path and specified segmentStartPoint in the path. Index of the path coincident with the index of the path which was returned by LineJumpDrawer.getPaths() method.
      Specified by:
      registerLineJumpInfos in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Parameters:
      pathIndex - index of the path.
      segmentStartPoint - start point of the segment.
      lineJumps - list of information about line jumps.
    • clearRegisteredLineJumpInfos

      public void clearRegisteredLineJumpInfos()
      Description copied from interface: com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Clears all registered LineJumpInfos.
      Specified by:
      clearRegisteredLineJumpInfos in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
    • registerLineJumpStartAngle

      public void registerLineJumpStartAngle(int pathIndex, Point point, double lineJumpStartAngle)
      Description copied from interface: com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Registers start angle for the specified path and specified start point of the path segment.
      Specified by:
      registerLineJumpStartAngle in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Parameters:
      pathIndex - index of the path.
      point - start point of the segment.
      lineJumpStartAngle - start angle of the line jump.
    • getLineJumpStartAngle

      public double getLineJumpStartAngle(Point point)
    • addLineJumps

      public void addLineJumps(GeneralPath path, Point segmentStartPoint, Point startPoint, @CheckForNull Point endPoint)
      Adds line jumps to the specified path.
      Specified by:
      addLineJumps in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Parameters:
      path - a path object.
      segmentStartPoint - segment start point.
      startPoint - start point from which to start adding the line jumps.
      endPoint - point until which line jumps should be added.
    • isDrawLineJumps

      public boolean isDrawLineJumps()
      Returns true if the path element wants to draw line jumps.
      Specified by:
      isDrawLineJumps in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Returns:
      true if line jumps should be drawn for the path element.
    • getPaths

      public List<List<Point>> getPaths()
      Returns only one path which consist of actual supplier draw point, break points of the path element and actual client draw point.
      Specified by:
      getPaths in interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
      Returns:
      paths.
    • setSupplierPoint

      public void setSupplierPoint(Point pt)
      Sets first point. Sets new location for text boxes if a point is changed, text boxes must be moved too.
      Parameters:
      pt - new 1st point
    • sSetSupplierPoint

      public void sSetSupplierPoint(Point pt)
      Sets supplier connection point.
      Parameters:
      pt - new supplier point.
    • sSetClientPoint

      public void sSetClientPoint(Point pt)
      Sets client connection Point.
      Parameters:
      pt - new client point.
    • setClientPoint

      public void setClientPoint(Point pt)
      Sets client point.
      Parameters:
      pt - new client point.
    • breakPointsChanged

      public final void breakPointsChanged(List<Point> oldPoints, List<Point> newPoints)
      Moves all connection point for the links that are attached to this link middle point.
      Parameters:
      oldPoints - old breakpoint vector.
      newPoints - new breakpoint vector.
    • notifyRepaintManager

      public void notifyRepaintManager(boolean boundsChanged)
      Description copied from class: PresentationElement
      Notifies the repaint manager about changes in bounds.
      Overrides:
      notifyRepaintManager in class PresentationElement
    • notifyRepaintManager

      protected final void notifyRepaintManager(List<Point> oldBreakpoints, List<Point> newBreakpoints)
    • notifyBreakPointsChanged

      public void notifyBreakPointsChanged(List<Point> oldPoints, List<Point> newPoints)
      Notifies about break point vector changes
      Parameters:
      oldPoints - old points
      newPoints - new points
    • getNearestLinkPart

      public final Line getNearestLinkPart(int x, int y)
      Returns the nearest link part to specified point.
      Parameters:
      x - x of point
      y - y of point
      Returns:
      line
    • removeBreakPoints

      public boolean removeBreakPoints()
      Removes break points if they do not really break the path (a path looks like without break points but really has them). Does nothing if a path is not breakable.
    • 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.
    • getClientDrawPoint

      public Point getClientDrawPoint()
      Returns point where path drawing should start
      Returns:
      point
    • getActualClientDrawPoint

      public Point getActualClientDrawPoint()
      Returns actual client side draw point.
      Returns:
      actual client draw point.
    • getActualSupplierDrawPoint

      public Point getActualSupplierDrawPoint()
      Returns actual supplier side draw point.
      Returns:
      actual supplier draw point.
    • getSupplierDrawPoint

      public Point getSupplierDrawPoint()
      Returns point where path drawing should start
      Returns:
      point
    • getNextPoint

      public final Point getNextPoint(Point pt)
      Returns next point to a given one. If given point does not belong to the link, returns parameter point.
      Parameters:
      pt - point for which next point is necessary
      Returns:
      next point(not cloned)
    • getPreviousPoint

      public final Point getPreviousPoint(Point pt)
      Returns previous point to given one. If given point does not belong to the link, returns parameter point.
      Parameters:
      pt - point for which previous point is necessary
      Returns:
      previous point(not cloned)
    • getNearestPoint

      public final Point getNearestPoint(Point pt)
      Returns first break point or client point if arg is supplier point. Or returns last break point or client point if arg is client point.
      Parameters:
      pt - given point
      Returns:
      nearest point(not cloned)
    • sSetClient

      public void sSetClient(@CheckForNull PresentationElement symbol)
      Sets client for this link.
      Parameters:
      symbol - new client.
    • sSetSupplier

      public void sSetSupplier(@CheckForNull PresentationElement symbol)
      Sets supplier for this link.
      Parameters:
      symbol - new supplier.
    • setSupplier

      public void setSupplier(PresentationElement shape)
      Sets supplier end for link. Removes this link from old shape. Inserts this link to new shape. Method also sets supplier point to the middle point of shape.
      Parameters:
      shape - new supplier.
    • 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.
    • getNextEnd

      public PresentationElement getNextEnd(PresentationElement obj)
      Returns other than given end. If given end is supplier method returns client of this path. If given end is not supplier method returns supplier of this path.
      Parameters:
      obj - given end
      Returns:
      other opposite end
    • movePathElement

      protected void movePathElement(PathElement link, @CheckForNull PathConnector requestor)
      Moves link. Link can connect more links ( such as note anchors in UML class diagrams ). After link was moved positions of connected links must be updated. Method checks if moving link supplier is this link recalculates supplier point moving link, otherwise it calculates client point of moving link. Point is calculated to middle point of this link.
      Specified by:
      movePathElement in class PathConnector
      Parameters:
      link - link to move.
      requestor - requestor
    • optimizeLoops

      public void optimizeLoops()
      Removes loops from paths for example: path | ----------+ | | ------

      will be changed to | -----

    • clone

      public PathElement clone()
      Specified by:
      clone in interface BaseElement
      Overrides:
      clone in class PathConnector
    • coversPoint

      public boolean coversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Checks if object covers provided point
      Specified by:
      coversPoint in class PresentationElement
      Returns:
      true if object covers this point
    • intersects

      public final boolean intersects(int x, int y, int width, int height, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Check if any line between breakpoints intersect with given points of rectangle
      Specified by:
      intersects in class PresentationElement
      Returns:
      true if object and rectangle intersects
    • intersectsInternal

      public boolean intersectsInternal(int x, int y, int width, int height)
      Check intersection with given rectangle. Intersection is counted by getting index of segment in path.
      Parameters:
      x - top left x point.
      y - top left y point.
      width - width of rectangle.
      height - height of rectangle.
      Returns:
      true if rectangle intersect with any line of path.
    • isBezierIntersects

      public boolean isBezierIntersects(int x, int y, int width, int height)
      Check if it is bezier path intersection with rectangle.
      Parameters:
      x - top left x point of rectangle.
      y - top left y point of rectangle.
      width - width of rectangle.
      height - height of rectangle.
      Returns:
      true if bezier path intersects with rectangle.
    • getIndexOfCoveredPathInternal

      public int getIndexOfCoveredPathInternal(int x, int y, int width, int height)
      This method is used to get segment of path with witch given rectangle has intersection. It will be returned index starting from 1 of segment. This segment is counted using all breakpoints (including client and supplier point). If anybody needs end points of segments, you must take all breakpoints and take point of return index minus 1 and point of segment's index. If there is no intersection, this method return -1. For example: this method returns value 2. segmentIndex = 2; Point start and end point of this segment will be: Point startPoint = getAllBreakPoints().get(segmentIndex-1); Point endPoint = getAllBreakPoints().get(segmentIndex);
      Parameters:
      x - top left x point of rectangle.
      y - top left y point of rectangle.
      width - width of rectangle.
      height - height of rectangle.
      Returns:
      index of segment in path with witch intersect given rectangle.
    • getIndexOfCoveredPath

      public final int getIndexOfCoveredPath(int x, int y)
      This method is used to get segment of path with witch given point has intersection. It will be returned index starting from 1 of segment. This segment is counted using all breakpoints (including client and supplier point). If anybody needs end points of segments, you must take all breakpoints and take point of return index minus 1 and point of segment's index. If there is no intersection, this method return -1. If renderer is set for path element, intersection will be counted depending on this renderer. For example: this method returns value 2. segmentIndex = 2; Point start and end point of this segment will be: Point startPoint = getAllBreakPoints().get(segmentIndex-1); Point endPoint = getAllBreakPoints().get(segmentIndex);
      Parameters:
      x - point x value.
      y - point y value.
      Returns:
      index of segment of path which intersects with the given point.
    • getNewBreakPointIndex

      public int getNewBreakPointIndex(Point point, List<Point> brk)
      Find the nearest breakpoints for new one and calculate the position of the new breakpoint in breakpoint vector. Used for new breakpoint calculation for Bézier curve.
      Parameters:
      point - the new point.
      brk - the breakpoint Vector.
      Returns:
      position in that the new point must be inserted in a breakpoint vector.
    • 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.
    • isConnectable

      public final boolean isConnectable(@CheckForNull PresentationElement supplier, @CheckForNull PresentationElement client, @CheckForNull Map<Object,Object> options)
      Checks if this path can connect given two elements.
      Parameters:
      supplier - candidate for path's supplier.
      client - candidate for path's client.
      options - options
      Returns:
      true, if path can connect given elements.
    • getMiddlePoint

      public Point getMiddlePoint()
      Calculates and returns middle point of link. For this link it is average between supplier's and client's points.
      Overrides:
      getMiddlePoint in class PresentationElement
      Returns:
      middle point.
    • 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
    • dispose

      public void dispose()
      Disconnect this link from shapes.
      Specified by:
      dispose in interface BaseElement
      Overrides:
      dispose in class PathConnector
    • atInsert

      public void atInsert()
      Inserts ends of link into shapes.
      Specified by:
      atInsert in interface BaseElement
      Overrides:
      atInsert in class PresentationElement
    • addConnectedPathElement

      public boolean addConnectedPathElement(PathElement link)
      Method to add sub link to this link. If link is note anchor it will be added to this link. If link is not note anchor, it will be added to generalization tree.
      Overrides:
      addConnectedPathElement in class PathConnector
      Parameters:
      link - link to be added.
      Returns:
      true if an element was added
    • getBounds

      public final Rectangle getBounds()
      Calculates bounds of this link. Returns minimal rectangle in which link can fit.
      Overrides:
      getBounds in class PresentationElement
      Returns:
      bounds of this link.
      See Also:
      • PresentationElementsManager.reshapeShapeElement
    • getNotCopyBounds

      public final Rectangle getNotCopyBounds()
      Description copied from class: PresentationElement
      get not copy bounds of object throws NoRectangleDefinedException
      Overrides:
      getNotCopyBounds in class PresentationElement
      Returns:
      rectangle of bounds
    • setCachedPathBounds

      protected void setCachedPathBounds(@CheckForNull Rectangle r)
    • calculatePathBounds

      public Rectangle calculatePathBounds(Point supplier, Point client, List<Point> breaks)
    • accept

      @OpenApi public void accept(Visitor visitor) throws Exception
      Description copied from interface: MDElement
      Method accepts a visitor, and calls method "visit<class name>(this)" of a 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
    • setRectilinear

      public void setRectilinear()
      Sets link rectilinear property value.
    • isRectilinear

      public boolean isRectilinear()
      Returns:
      true if link path style is rectilinear.
    • isOblique

      public boolean isOblique()
      Returns:
      true if link path style is oblique.
    • makeRectilinear

      public void makeRectilinear()
      Makes link rectilinear.
    • makeRectilinear

      public void makeRectilinear(boolean notify)
      Makes link rectilinear.
      Parameters:
      notify - notify about this change
    • removeRedundantBreakPoints

      public void removeRedundantBreakPoints(List<Point> vct)
      Removes redundant breakpoints from link. Remove breakpoints only from rectilinear link.
      Parameters:
      vct - points
    • isVertical

      public boolean isVertical()
      Indicates if path element is drawn in the diagram which has vertical orientation.
      Returns:
      true if diagram is vertical, false otherwise.
    • removeBreaks

      public void removeBreaks(List<Point> points)
      Removes all break points if they are covered by client or client bounds.
      Parameters:
      points - points
    • swapEnds

      public void swapEnds()
      Swaps ends of the link
    • setClient

      public void setClient(PresentationElement shape)
      Sets client for this link. Changes parent object to the parent of client. Client's parent will always contain incoming links.
      Parameters:
      shape - shape to check
    • moveLinkToClientParent

      public void moveLinkToClientParent(boolean simpleAdd)
    • internalSnapToGrid

      protected void internalSnapToGrid(float step)
      Overrides:
      internalSnapToGrid in class PresentationElement
    • isSnapToGrid

      protected boolean isSnapToGrid()
      Overrides:
      isSnapToGrid in class PresentationElement
    • canChangeSupplier

      public boolean canChangeSupplier()
      Returns:
      true, if view can change supplier.
    • canChangeClient

      public boolean canChangeClient()
      Returns:
      true, if view can change client
    • canClearBreakPoints

      public boolean canClearBreakPoints()
      Returns:
      true if link can be modified (all break points can be removed):
    • canChangeLineStyle

      public boolean canChangeLineStyle()
      Returns:
      true if this link can change line style.
    • internalApplyProperties

      public void internalApplyProperties(com.dassault_systemes.modeler.magic.diagram.styledelegates.PresentationElementStyleChanger changer)
      Applies properties
      Overrides:
      internalApplyProperties in class PresentationElement
      Parameters:
      changer - new properties
    • draw

      public void draw(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      abstract method for drawing ViewObject object used to draw object on graphics
      Overrides:
      draw in class PresentationElement
      Parameters:
      context - Graphics on which object should be drawn
    • getIntersection

      public Point getIntersection(int x, int y, @CheckForNull PathElement path)
      Overrides:
      getIntersection in class PresentationElement
    • useOtherExistingElement

      @CheckForNull public com.nomagic.utils.Pair<com.dassault_systemes.modeler.foundation.model.ModelElement,Consumer<com.dassault_systemes.modeler.foundation.model.ModelElement>> useOtherExistingElement()
      Finds and returns other model element which is semantically equivalent to this path model element. Found element can be modified. This method is invoked during new PathElement creation and purpose of it is to reuse existing model elements instead of creating new ones.
      Returns:
      element
    • getBezierPath

      public GeneralPath getBezierPath()
      Calculates path for bezier curve drawing.
      Returns:
      bezier path
    • isBezier

      public boolean isBezier()
      Returns:
      true if LINK_LINE_STYLE property value equals to BEZIER.
    • isLinkLineStyleDefined

      public boolean isLinkLineStyleDefined()
    • getLinkLineStyle

      public String getLinkLineStyle()
      Returns:
      LINK_LINE_STYLE property value
    • sSetLinkLineStyle

      public void sSetLinkLineStyle(String style)
      Change value of LINK_LINE_STYLE property.
      Parameters:
      style - the line style.
    • setLinkLineStyle

      public void setLinkLineStyle(String style)
      sets LINK_LINE_STYLE property value.
      Parameters:
      style - the line style.
    • internalSilentApply

      public void internalSilentApply()
      Description copied from class: PresentationElement
      Silently applies all properties after initialization
      Overrides:
      internalSilentApply in class PresentationElement
    • handleRemoveBreaksAction

      public com.dassault_systemes.modeler.foundation.editing.Command handleRemoveBreaksAction()
    • nextStyle

      public String nextStyle()
      Returns:
      link style for TOGGLE LINK STYLE command.
    • getBezierPath

      public GeneralPath getBezierPath(List<Point> points)
      Calculates path from breakpoints for bezier curve drawing.
      Parameters:
      points - points
      Returns:
      path
    • prepareForLineDrawing

      public boolean prepareForLineDrawing(Graphics2D g, boolean line)
      Prepares graphics for line drawing. Calls super prepareForLineDrawing and sets stroke.
      Parameters:
      g - graphics
      line - true if for line, false if for adornments also
      Returns:
      stroke
    • applyStrokeForLineDrawing

      public static void applyStrokeForLineDrawing(PresentationElement pathElement, Graphics2D g, boolean line, BasicStroke stroke)
    • internalGetPresentationElementStroke

      public BasicStroke internalGetPresentationElementStroke(boolean line, int width)
      This method must be overridden, if you need to use DASHED_STROKE or another one.
      Parameters:
      line - true if for line, false if for adornments also
      width - width
      Returns:
      the stroke for line drawing ( by default SOLID_STROKE).
    • internalGetPresentationElementStroke

      protected BasicStroke internalGetPresentationElementStroke(boolean line, int lineStyle, int width)
    • getBoundsToRepaint

      public Rectangle getBoundsToRepaint() throws NoRectangleDefinedException
      Description copied from class: PresentationElement
      Return bounds of the symbol that must be repainted. throws NoRectangleDefinedException
      Overrides:
      getBoundsToRepaint in class PresentationElement
      Returns:
      rectangle of bounds
      Throws:
      NoRectangleDefinedException
    • createFillStrategy

      public com.nomagic.magicdraw.uml.symbols.FillStrategy createFillStrategy()
      Overrides:
      createFillStrategy in class PresentationElement
    • internalGetPresentationElementStroke

      public BasicStroke internalGetPresentationElementStroke(int width)
      Description copied from class: PresentationElement
      Return a stroke used to paint symbol's main part
      Overrides:
      internalGetPresentationElementStroke in class PresentationElement
      Parameters:
      width - a custom stroke width. Other stroke parameters will be specific to symbol
      Returns:
      a stroke used to paint symbol's main part
    • paintSelf

      public void paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      Specified by:
      paintSelf in class PresentationElement
    • getPathPainter

      public com.nomagic.magicdraw.uml.symbols.paths.painters.PathPainter<PathElement> getPathPainter()
    • setPathPainter

      protected final void setPathPainter(com.nomagic.magicdraw.uml.symbols.paths.painters.PathPainter pathPainter)
    • getSupplierConnectionType

      public int getSupplierConnectionType()
    • getClientConnectionType

      public int getClientConnectionType()
    • getDefaultParentForData

      @CheckForNull public Element getDefaultParentForData()
      Presentation element could suggest parent, which would be more acceptable, than adding to the client If returning null, general mechanism will work
      Returns:
      parent for data
    • hasClientPoint

      protected boolean hasClientPoint()
      Check if client point is already not null
      Returns:
      true if client point is set
    • hasSupplierPoint

      protected boolean hasSupplierPoint()
      Check if supplier point is already not null
      Returns:
      true if supplier point is set
    • isRounded

      public boolean isRounded()
      Returns value of the "Is Rounded" path symbol property.
      Returns:
      value of the "Is Rounded" property.
    • setRounded

      public void setRounded(boolean rounded)
      Sets value of the "Is Rounded" path symbol property.
      Parameters:
      rounded - - value of the "Is Rounded" property.
    • sSetRounded

      public void sSetRounded(boolean rounded)
      Sets value of the "Is Rounded" path symbol property.
      Parameters:
      rounded - - value of the "Is Rounded" property.
    • isUseFlowLayoutLogic

      public boolean isUseFlowLayoutLogic()
      Indicates if smart path/shape edit should be used in this diagram.
      Returns:
      true if smart symbol editing should be used, false otherwise.
    • isSmartLayoutNeeded

      public boolean isSmartLayoutNeeded()
      Returns smart layout needed flag.
      Returns:
      value of smart layout needed flag.
    • setSmartLayoutNeeded

      public void setSmartLayoutNeeded(boolean smartLayoutNeeded)
      Sets smart layout needed flag.
      Parameters:
      smartLayoutNeeded - - smart layout needed flag value.
    • resetCache

      protected void resetCache()
    • cacheValues

      protected void cacheValues(Point cachedActualSupplierDrawPoint, Point cachedActualClientDrawPoint, Point cacheSupplierDrawPoint, Point cacheClientDrawPoint, List<Point> cacheBreakPoints)
    • cacheActualDrawPoints

      protected void cacheActualDrawPoints(Point supplierDrawPoint, Point clientDrawPoint, List<Point> breakPoints)
    • getCachedActualClientDrawPoint

      public Point getCachedActualClientDrawPoint()
    • getCachedActualSupplierDrawPoint

      public Point getCachedActualSupplierDrawPoint()
    • resizeParent

      public void resizeParent()
      Do nothing, because path does not affect parent size
      Overrides:
      resizeParent in class PresentationElement
    • getCustomSupplierPoint

      public Point getCustomSupplierPoint()
    • setCustomSupplierPoint

      public void setCustomSupplierPoint(Point point)
    • getCustomClientPoint

      public Point getCustomClientPoint()
    • setCustomClientPoint

      public void setCustomClientPoint(Point point)
    • preDisposeOnUpdate

      protected boolean preDisposeOnUpdate()
      Description copied from class: PresentationElement
      Validate symbol against model and try to fix it before actual symbol update. If symbol is not valid and can not be fixed, request symbol dispose by returning true. Check if symbol should be disposed, because model does not correspond to symbol. This may happen for example if path supplier or client in model is changed, but path still is connected to symbols of old ends.

      Method also can fix symbol if possible - for example reconnect path to other symbols in diagram and etc.

      Overrides:
      preDisposeOnUpdate in class PresentationElement
      Returns:
      true if symbol must be disposed
    • createSmartListenerConfig

      protected void createSmartListenerConfig(List<SmartListenerConfig> configurations)
      Overrides:
      createSmartListenerConfig in class PathConnector
    • internalMovedAsToSelf

      public void internalMovedAsToSelf(int dx, int dy)
      This is an internal method to notify a path that it was moved by connecting shape as the path "to self"
      Parameters:
      dx - delta x
      dy - delta y
    • sSetParent

      public void sSetParent(@CheckForNull PresentationElement parent)
      Description copied from class: PresentationElement
      Overrides:
      sSetParent in class PresentationElement
      Parameters:
      parent - parent view
    • hasManipulator

      public boolean hasManipulator()
      Description copied from class: PresentationElement
      Returns true, if view has manipulator (is selectable)
      Overrides:
      hasManipulator in class PresentationElement
    • getSuspendShapeAutoResizeMode

      public String getSuspendShapeAutoResizeMode()
      Specified by:
      getSuspendShapeAutoResizeMode in interface com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
    • sSetSuspendShapeAutoResizeMode

      public void sSetSuspendShapeAutoResizeMode(String mode)
    • setSuspendShapeAutoResizeMode

      public void setSuspendShapeAutoResizeMode(String mode)
    • findOwnerForElement

      @CheckForNull public final com.dassault_systemes.modeler.foundation.model.ModelElement findOwnerForElement(PresentationElement newParent, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext)
      Overrides:
      findOwnerForElement in class PresentationElement
    • findOwnerForElement

      @CheckForNull public com.dassault_systemes.modeler.foundation.model.ModelElement findOwnerForElement(PresentationElement newParent, PresentationElement client, PresentationElement supplier, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext)
    • connectModelElement

      public void connectModelElement(com.nomagic.magicdraw.uml.symbols.paths.ConnectModelElementParticipant participant)
      Connects ModelElement of this path to related elements of a given client and supplier
      Parameters:
      participant - participant of this operation