Class ShapeRenderer
- java.lang.Object
-
- com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
-
- com.nomagic.magicdraw.uml.symbols.shapes.ShapeRenderer
-
@OpenApiAll public class ShapeRenderer extends PresentationElementRenderer
Shape element renderer allows to customize (change) the default view ofShapeElement
.- See Also:
PresentationElementRenderer
,PathElementRenderer
-
-
Constructor Summary
Constructors Constructor Description ShapeRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
calculateMinimumSize(ShapeElement presentationElement, java.awt.Dimension minimumSize)
Calculate the minimum shape size of the given shape element.void
calculatePreferredSize(ShapeElement shapeElement, java.awt.Dimension prefSize)
Calculate the shape element preferred size.ContainerShape
createBoundingShape(ShapeElement shapeElement, PathElement pathElement)
ContainerShape
createBoundingShape(ShapeElement shapeElement, PathElement pathElement, BoundsTransformation data)
Returns the shape element boundaries where the path will be connected.void
draw(java.awt.Graphics g, PresentationElement presentationElement)
Draws the symbol using the predifined drawing pattern.java.awt.Dimension
getDefaultSize(ShapeElement shapeElement)
Return default shape element size used during symbol drawing.protected void
updateText(PresentationElement presentationElement)
Update shape text.-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElementRenderer
afterUpdate, beforeUpdate, getCenterlinePoint, getColor, getFontProvider, getText, propertiesChanged
-
-
-
-
Method Detail
-
draw
public void draw(java.awt.Graphics g, PresentationElement presentationElement)
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
public void calculateMinimumSize(ShapeElement presentationElement, java.awt.Dimension minimumSize)
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
public void calculatePreferredSize(ShapeElement shapeElement, java.awt.Dimension prefSize)
Calculate the shape element preferred size. Override to change the shape element preferred size.- Parameters:
shapeElement
- preferred size of.prefSize
- calculated preferred size.
-
getDefaultSize
@CheckForNull public java.awt.Dimension getDefaultSize(ShapeElement shapeElement)
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
protected final void updateText(PresentationElement presentationElement)
Update shape text.- Specified by:
updateText
in classPresentationElementRenderer
- Parameters:
presentationElement
- element
-
-