Class RoundedRectangle

All Implemented Interfaces:
IFigure

public class RoundedRectangle extends Shape
Draws a Rectangle whose corners are rounded in appearance. The size of the rectangle is determined by the bounds set to it.
  • Field Details

  • Constructor Details

    • RoundedRectangle

      public RoundedRectangle()
      Constructs a round cornered rectangle.
  • Method Details

    • fillShape

      protected void fillShape(Graphics graphics)
      Description copied from class: Shape
      Fills the interior of the shape with the background color.
      Specified by:
      fillShape in class Shape
      Parameters:
      graphics - the graphics object
      See Also:
    • outlineShape

      protected void outlineShape(Graphics graphics)
      Description copied from class: Shape
      Outlines this shape using the foreground color.
      Specified by:
      outlineShape in class Shape
      Parameters:
      graphics - the graphics object
      See Also:
    • setCornerDimensions

      public void setCornerDimensions(Dimension d)
      Sets the dimensions of each corner. This will form the radii of the arcs which form the corners.
      Parameters:
      d - the dimensions of the corner
      Since:
      2.0
    • getCornerDimensions

      public Dimension getCornerDimensions()
      Returns the dimensions used for each corner.
      Returns:
      the dimensions of the corner.
      Since:
      3.7