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 ofPathElement
. 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:
PresentationElementRenderer
,ShapeRenderer
-
-
Constructor Summary
Constructors Constructor Description PathElementRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
drawPathAdornment(java.awt.Graphics g, PathElement pathElement, java.awt.Point supplierPoint, java.awt.Point clientPoint, java.util.List<java.awt.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 java.awt.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 void
updateText(PresentationElement presentationElement)
Does nothing, should not be called-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
afterUpdate, beforeUpdate, getCenterlinePoint, getColor, getFontProvider, getText, propertiesChanged
-
-
-
-
Method Detail
-
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:
PathEndRenderer
-
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:
PathEndRenderer
-
getPathStroke
@CheckForNull protected java.awt.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:
PresentationElement.getStroke(int)
,PresentationElement.getStroke(int, int)
,PresentationElement.getStroke(BasicStroke, int)
,PresentationElement.getStroke(int, int, int)
,PresentationElement.getStroke(float, int, int, float, float[], float)
-
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(java.awt.Graphics g, PathElement pathElement, java.awt.Point supplierPoint, java.awt.Point clientPoint, java.util.List<java.awt.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
protected final void updateText(PresentationElement presentationElement)
Does nothing, should not be called- Specified by:
updateText
in classPresentationElementRenderer
- Parameters:
presentationElement
- presentation element
-
-