Class ShapeRenderer
java.lang.Object
com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
com.nomagic.magicdraw.uml.symbols.shapes.ShapeRenderer
Shape element renderer allows to customize (change) the default
view of
ShapeElement
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateMinimumSize
(ShapeElement presentationElement, Dimension minimumSize) Calculate the minimum shape size of the given shape element.void
calculatePreferredSize
(ShapeElement shapeElement, Dimension prefSize) Calculate the shape element preferred size.createBoundingShape
(ShapeElement shapeElement, PathElement pathElement) Deprecated.createBoundingShape
(ShapeElement shapeElement, PathElement pathElement, BoundsTransformation data) Returns the shape element boundaries where the path will be connected.void
draw
(Graphics g, PresentationElement presentationElement) Draws the symbol using the predifined drawing pattern.getDefaultSize
(ShapeElement shapeElement) Return default shape element size used during symbol drawing.protected final void
updateText
(PresentationElement presentationElement) Update shape text.Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
afterUpdate, beforeUpdate, getCenterlinePoint, getColor, getFontProvider, getText, propertiesChanged
-
Constructor Details
-
ShapeRenderer
public ShapeRenderer()
-
-
Method Details
-
draw
Draws the symbol using the predifined drawing pattern. Override the method to add the custom drawing.- Parameters:
g
- graphics where shape is drawn.presentationElement
- presentation element to draw.
-
calculateMinimumSize
Calculate the minimum shape size of the given shape element. Override to change the shape element minimum size.- Parameters:
presentationElement
- minimum size of.minimumSize
- calculated minimum size.
-
calculatePreferredSize
Calculate the shape element preferred size. Override to change the shape element preferred size.- Parameters:
shapeElement
- preferred size of.prefSize
- calculated preferred size.
-
getDefaultSize
Return default shape element size used during symbol drawing. Override method to use custom default size.- Parameters:
shapeElement
- shape- Returns:
- custom default size, or null to use predefined default size.
-
createBoundingShape
@Deprecated public ContainerShape createBoundingShape(ShapeElement shapeElement, PathElement pathElement) Returns the shape element boundaries where the path will be connected. Override to add (calculate) the custom boundaries.- Parameters:
shapeElement
- shape to calculate boundaries of.pathElement
- path connecting.- Returns:
- bounding shape that defines the boundaries.
-
createBoundingShape
public ContainerShape createBoundingShape(ShapeElement shapeElement, PathElement pathElement, BoundsTransformation data) Returns the shape element boundaries where the path will be connected. Override to add (calculate) the custom boundaries.- Parameters:
shapeElement
- shape to calculate boundaries of.pathElement
- path connecting.data
- bounds transformation data- Returns:
- bounding shape that defines the boundaries.
-
updateText
Update shape text.- Specified by:
updateText
in classPresentationElementRenderer
- Parameters:
presentationElement
- element
-
createBoundingShape(ShapeElement, PathElement, BoundsTransformation)