Class PolygonShape

  • All Implemented Interfaces:
    Shape


    public class PolygonShape
    extends Object
    implements Shape
    A Shape which represents a polygon which may contain holes. Provided because the standard AWT Polygon class does not support holes.
    • Constructor Detail

      • PolygonShape

        public PolygonShape(Coordinate[] shellVertices,
                            Collection holeVerticesCollection)
        Creates a new polygon Shape.
        Parameters:
        shellVertices - the vertices of the shell
        holeVerticesCollection - a collection of Coordinate[] for each hole
      • PolygonShape

        public PolygonShape()
    • Method Detail

      • contains

        public boolean contains(double x,
                                double y)
      • contains

        public boolean contains(Point2D p)
      • intersects

        public boolean intersects(double x,
                                  double y,
                                  double w,
                                  double h)
      • intersects

        public boolean intersects(Rectangle2D r)
      • contains

        public boolean contains(double x,
                                double y,
                                double w,
                                double h)