Class PresentationElementRenderer
java.lang.Object
com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
- Direct Known Subclasses:
PathElementRenderer
,PathRenderer
,ShapeRenderer
Base class for presentation element renderer.
Presentation element renderer allows to customize (change) the default view of element.
E.g. change the displayed text, font, color.
There two types of renderers -
ShapeRenderer
, and
PathElementRenderer
.
Renderers are registered by PresentationElementRendererManager
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterUpdate
(PresentationElement presentationElement) Invoked right after presentation element update.void
beforeUpdate
(PresentationElement presentationElement) Invoked right before presentation element update.getCenterlinePoint
(PresentationElement presentationElement) Returns a point for centerline drawing.getColor
(PresentationElement presentationElement, PresentationElementColorEnum colorEnum) Provides the color used to draw presentation element.getFontProvider
(PresentationElement presentationElement) Returns the font provider.getText
(PresentationElement presentationElement, PresentationElementTextEnum textEnum) Provides the displayable text for the given presentation element.void
propertiesChanged
(PresentationElement presentationElement) Invoked when presentation element properties were changed.protected abstract void
updateText
(PresentationElement presentationElement) Update the given presentation element text.
-
Constructor Details
-
PresentationElementRenderer
public PresentationElementRenderer()
-
-
Method Details
-
beforeUpdate
Invoked right before presentation element update.- Parameters:
presentationElement
- updating element.
-
afterUpdate
Invoked right after presentation element update.- Parameters:
presentationElement
- updating element.
-
propertiesChanged
Invoked when presentation element properties were changed.- Parameters:
presentationElement
- properties of this element were updated.
-
getText
public String getText(PresentationElement presentationElement, PresentationElementTextEnum textEnum) Provides the displayable text for the given presentation element. Override the method to display the custom text.- Parameters:
presentationElement
- element to display text for.textEnum
- describes the displayable text purpose (text is displayed as name, stereotypes, tags, or constraints).- Returns:
- displayble text, or null to use the predefined text.
- See Also:
-
getColor
public Color getColor(PresentationElement presentationElement, PresentationElementColorEnum colorEnum) Provides the color used to draw presentation element. Override the method to use the custom color.- Parameters:
presentationElement
- element to draw.colorEnum
- describes the color purpose (color is used to draw lines, text, or fill shape).- Returns:
- color, or null to use the predefined color.
- See Also:
-
getFontProvider
Returns the font provider. Provided font is used to display text. Override the method to use custom font.- Parameters:
presentationElement
- presentation element to use font for.- Returns:
- custom font provider, or null to use predefined font.
- See Also:
-
getCenterlinePoint
Returns a point for centerline drawing. Override the method to use custom centerline point.- Parameters:
presentationElement
- - element for which centerline point has to be retrieved.- Returns:
- centerline point, or null to use predefined point.
-
updateText
Update the given presentation element text.- Parameters:
presentationElement
-
-