/** * Determines whether the specified {@link Point} is inside this * <code>Polygon</code>. * @param p the specified <code>Point</code> to be tested * @return <code>true</code> if the <code>Polygon</code> contains the * <code>Point</code>; <code>false</code> otherwise. * @see #contains(double, double) */ public boolean contains(Point p) { return contains(p.x, p.y); }
/** * Determines whether the specified coordinates are inside this * <code>Polygon</code>. * <p> * @param x the specified x coordinate to be tested * @param y the specified y coordinate to be tested * @return <code>true</code> if this <code>Polygon</code> contains * the specified coordinates, (<i>x</i>, <i>y</i>); * <code>false</code> otherwise. */ public boolean contains(int x, int y) { return contains((double) x, (double) y); }
/** * Determines whether the specified {@link Point} is inside this * <code>Polygon</code>. * @param p the specified <code>Point</code> to be tested * @return <code>true</code> if the <code>Polygon</code> contains the * <code>Point</code>; <code>false</code> otherwise. * @see #contains(double, double) */ public boolean contains(Point p) { return contains(p.x, p.y); }
/** * Determines whether the specified coordinates are inside this * <code>Polygon</code>. * <p> * @param x the specified x coordinate to be tested * @param y the specified y coordinate to be tested * @return <code>true</code> if this <code>Polygon</code> contains * the specified coordinates, (<i>x</i>, <i>y</i>); * <code>false</code> otherwise. */ public boolean contains(int x, int y) { return contains((double) x, y); }
/** * Determines whether the specified {@link Point} is inside this * <code>Polygon</code>. * @param p the specified <code>Point</code> to be tested * @return <code>true</code> if the <code>Polygon</code> contains the * <code>Point</code>; <code>false</code> otherwise. * @see #contains(double, double) */ public boolean contains(Point p) { return contains(p.x, p.y); }
/** * Determines whether the specified coordinates are inside this * <code>Polygon</code>. * <p> * @param x the specified x coordinate to be tested * @param y the specified y coordinate to be tested * @return <code>true</code> if this <code>Polygon</code> contains * the specified coordinates, (<i>x</i>, <i>y</i>); * <code>false</code> otherwise. */ public boolean contains(int x, int y) { return contains((double) x, (double) y); }
/** * Tests if a specified {@link Point2D} is inside the boundary of this * <code>Polygon</code>. * @param p a specified <code>Point2D</code> * @return <code>true</code> if this <code>Polygon</code> contains the * specified <code>Point2D</code>; <code>false</code> * otherwise. * @see #contains(double, double) */ public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); }
/** * Tests if a specified {@link Point2D} is inside the boundary of this * <code>Polygon</code>. * @param p a specified <code>Point2D</code> * @return <code>true</code> if this <code>Polygon</code> contains the * specified <code>Point2D</code>; <code>false</code> * otherwise. * @see #contains(double, double) */ public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); }
/** * Tests if a specified {@link Point2D} is inside the boundary of this * <code>Polygon</code>. * @param p a specified <code>Point2D</code> * @return <code>true</code> if this <code>Polygon</code> contains the * specified <code>Point2D</code>; <code>false</code> * otherwise. * @see #contains(double, double) */ public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); }
/** * Tests if the interior of this <code>Polygon</code> entirely * contains the specified <code>Rectangle2D</code>. * @param r the specified <code>Rectangle2D</code> * @return <code>true</code> if this <code>Polygon</code> entirely * contains the specified <code>Rectangle2D</code>; * <code>false</code> otherwise. * @see #contains(double, double, double, double) */ public boolean contains(Rectangle2D r) { return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
/** * Tests if the interior of this <code>Polygon</code> entirely * contains the specified <code>Rectangle2D</code>. * @param r the specified <code>Rectangle2D</code> * @return <code>true</code> if this <code>Polygon</code> entirely * contains the specified <code>Rectangle2D</code>; * <code>false</code> otherwise. * @see #contains(double, double, double, double) */ public boolean contains(Rectangle2D r) { return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
/** * Tests if the interior of this <code>Polygon</code> entirely * contains the specified <code>Rectangle2D</code>. * @param r the specified <code>Rectangle2D</code> * @return <code>true</code> if this <code>Polygon</code> entirely * contains the specified <code>Rectangle2D</code>; * <code>false</code> otherwise. * @see #contains(double, double, double, double) */ public boolean contains(Rectangle2D r) { return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
for (y = minY; y <= maxY; y += stepSize) { for (x = minX; x <= maxX; x += stepSize) { if (c.region.contains(x,y)) {