Class PathElementRenderer

java.lang.Object
com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
com.nomagic.magicdraw.uml.symbols.paths.PathElementRenderer

@OpenApiAll public abstract class PathElementRenderer extends PresentationElementRenderer
Path element renderer allows to customize (change) the default view of PathElement. Path decoration methods are called even when the path is being drawn/created in a diagram, and supplier or client not yet connected, breakpoints are not yet set.
See Also:
  • Constructor Details

    • PathElementRenderer

      public PathElementRenderer()
  • Method Details

    • getClientEndPreferredSize

      protected int getClientEndPreferredSize(PathElement pathElement, @CheckForNull PresentationElement client)
      The path client end preferred size. End size is used when drawing adornment on path end (e.g. arrow on the end). Override to change the client end size.
      Parameters:
      pathElement - path element
      client - client end of the path element. It might not be actually connected to the path. Should be used instead of PathElement.getClient()
      Returns:
      end size, or 0 to use default end size
    • getSupplierEndPreferredSize

      protected int getSupplierEndPreferredSize(PathElement pathElement, @CheckForNull PresentationElement supplier)
      The path supplier end preferred size. End size is used when drawing adornment on path end (e.g. arrow on the end). Override to change the supplier end size.
      Parameters:
      pathElement - path element
      supplier - supplier end of the path. Might be null when the path is being newly created. Should be used instead of PathElement.getSupplier()
      Returns:
      end size, or 0 to use default end size
    • getClientEndRenderer

      @CheckForNull protected PathEndRenderer getClientEndRenderer(PathElement pathElement, @CheckForNull PresentationElement client)
      Provides the path client end renderer. Override the method to return the custom path end renderer.
      Parameters:
      pathElement - path element
      client - client end of the path element. It might not be actually connected to the path. Should be used instead of PathElement.getClient()
      Returns:
      custom renderer, or null to use default end renderer
      See Also:
    • getSupplierEndRenderer

      @CheckForNull protected PathEndRenderer getSupplierEndRenderer(PathElement pathElement, @CheckForNull PresentationElement supplier)
      Provides the path supplier end renderer. Override the method to return the custom path end renderer.
      Parameters:
      pathElement - path element
      supplier - supplier end of the path. Might be null when the path is being newly created. Should be used instead of PathElement.getSupplier()
      Returns:
      custom renderer, or null to use default end renderer
      See Also:
    • getPathStroke

      @CheckForNull protected BasicStroke getPathStroke(PathElement pathElement)
      Stroke used to draw path. Override to change the stroke for path drawing.
      Parameters:
      pathElement - drawing path
      Returns:
      custom stroke, or null to use the default stroke
      See Also:
    • getLineWidth

      public int getLineWidth(PathElement pathElement)
      Returns path line width Override to use the custom line width
      Parameters:
      pathElement - path to draw.
      Returns:
      line width, or 0 to use default line width.
    • drawPathAdornment

      @OpenApi protected void drawPathAdornment(Graphics g, PathElement pathElement, Point supplierPoint, Point clientPoint, List<Point> breakPoints, @CheckForNull PresentationElement supplier, @CheckForNull PresentationElement client)
      Draws the path adornment. By default draws no adornment. Override the method to add the custom adornment drawing.
      Parameters:
      g - graphics where path is drawn
      pathElement - path to draw adornment for
      supplierPoint - point where the supplier end should be painted. Should be used instead of PathElement.getSupplierDrawPoint()
      clientPoint - point where the client end should be painted. Should be used instead of PathElement.getClientDrawPoint() ()}
      breakPoints - breakpoints between the supplier and client points, in that order. Should be used instead of PathElement.getBreakPoints()
      supplier - supplier end of the path. Might be null when the path is being newly created. Should be used instead of PathElement.getSupplier()
      client - client end of the path element. It might not be actually connected to the path. Should be used instead of PathElement.getClient()
    • updateText

      protected final void updateText(PresentationElement presentationElement)
      Does nothing, should not be called
      Specified by:
      updateText in class PresentationElementRenderer
      Parameters:
      presentationElement - presentation element