Class PathElementRenderer
java.lang.Object
com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
com.nomagic.magicdraw.uml.symbols.paths.PathElementRenderer
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawPathAdornment
(Graphics g, PathElement pathElement, Point supplierPoint, Point clientPoint, List<Point> breakPoints, PresentationElement supplier, PresentationElement client) Draws the path adornment.protected int
getClientEndPreferredSize
(PathElement pathElement, PresentationElement client) The path client end preferred size.protected PathEndRenderer
getClientEndRenderer
(PathElement pathElement, PresentationElement client) Provides the path client end renderer.int
getLineWidth
(PathElement pathElement) Returns path line width Override to use the custom line widthprotected BasicStroke
getPathStroke
(PathElement pathElement) Stroke used to draw path.protected int
getSupplierEndPreferredSize
(PathElement pathElement, PresentationElement supplier) The path supplier end preferred size.protected PathEndRenderer
getSupplierEndRenderer
(PathElement pathElement, PresentationElement supplier) Provides the path supplier end renderer.protected final void
updateText
(PresentationElement presentationElement) Does nothing, should not be calledMethods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
afterUpdate, beforeUpdate, getCenterlinePoint, getColor, getFontProvider, getText, propertiesChanged
-
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 elementclient
- client end of the path element. It might not be actually connected to the path. Should be used instead ofPathElement.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 elementsupplier
- supplier end of the path. Might be null when the path is being newly created. Should be used instead ofPathElement.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 elementclient
- client end of the path element. It might not be actually connected to the path. Should be used instead ofPathElement.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 elementsupplier
- supplier end of the path. Might be null when the path is being newly created. Should be used instead ofPathElement.getSupplier()
- Returns:
- custom renderer, or null to use default end renderer
- See Also:
-
getPathStroke
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
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 drawnpathElement
- path to draw adornment forsupplierPoint
- point where the supplier end should be painted. Should be used instead ofPathElement.getSupplierDrawPoint()
clientPoint
- point where the client end should be painted. Should be used instead ofPathElement.getClientDrawPoint()
()}breakPoints
- breakpoints between the supplier and client points, in that order. Should be used instead ofPathElement.getBreakPoints()
supplier
- supplier end of the path. Might be null when the path is being newly created. Should be used instead ofPathElement.getSupplier()
client
- client end of the path element. It might not be actually connected to the path. Should be used instead ofPathElement.getClient()
-
updateText
Does nothing, should not be called- Specified by:
updateText
in classPresentationElementRenderer
- Parameters:
presentationElement
- presentation element
-