Class PolygonShape

All Implemented Interfaces:
IFigure

public class PolygonShape extends AbstractPointListShape
Renders a PointList as a polygonal shape. This class is similar to PolylineShape, except the PointList is closed and can be filled in as a solid shape.
Since:
3.5
See Also:
  • Constructor Details

    • PolygonShape

      public PolygonShape()
  • Method Details

    • shapeContainsPoint

      protected boolean shapeContainsPoint(int x, int y)
      Description copied from class: AbstractPointListShape
      Returns true if the point (x, y) is contained within this figure.
      Specified by:
      shapeContainsPoint in class AbstractPointListShape
      Parameters:
      x - The X coordinate
      y - The Y coordinate
      Returns:
      true if the point (x,y) is contained in this figure
    • 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
    • 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