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 of ShapeElement.
See Also:
  • Constructor Details

    • ShapeRenderer

      public ShapeRenderer()
  • Method Details

    • draw

      public void draw(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, 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, 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 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 class PresentationElementRenderer
      Parameters:
      presentationElement - element