/** * Returns an iterator object that iterates along the boundary of this * <code>Polygon</code> and provides access to the geometry * of the outline of this <code>Polygon</code>. An optional * {@link AffineTransform} can be specified so that the coordinates * returned in the iteration are transformed accordingly. * @param at an optional <code>AffineTransform</code> to be applied to the * coordinates as they are returned in the iteration, or * <code>null</code> if untransformed coordinates are desired * @return a {@link PathIterator} object that provides access to the * geometry of this <code>Polygon</code>. */ public PathIterator getPathIterator(AffineTransform at) { updateComputingPath(); if (closedPath == null) return null; else return closedPath.getPathIterator(at); }
/** * Returns an iterator object that iterates along the boundary of this * <code>Polygon</code> and provides access to the geometry * of the outline of this <code>Polygon</code>. An optional * {@link AffineTransform} can be specified so that the coordinates * returned in the iteration are transformed accordingly. * @param at an optional <code>AffineTransform</code> to be applied to the * coordinates as they are returned in the iteration, or * <code>null</code> if untransformed coordinates are desired * @return a {@link PathIterator} object that provides access to the * geometry of this <code>Polygon</code>. */ public PathIterator getPathIterator(AffineTransform at) { updateComputingPath(); if (closedPath == null) return null; else return closedPath.getPathIterator(at); }
/** * Returns an iterator object that iterates along the boundary of this * <code>Polygon</code> and provides access to the geometry * of the outline of this <code>Polygon</code>. An optional * {@link AffineTransform} can be specified so that the coordinates * returned in the iteration are transformed accordingly. * @param at an optional <code>AffineTransform</code> to be applied to the * coordinates as they are returned in the iteration, or * <code>null</code> if untransformed coordinates are desired * @return a {@link PathIterator} object that provides access to the * geometry of this <code>Polygon</code>. */ public PathIterator getPathIterator(AffineTransform at) { updateComputingPath(); if (closedPath == null) return null; else return closedPath.getPathIterator(at); }
/** * Determines if the specified coordinates are inside this * <code>Polygon</code>. For the definition of * <i>insideness</i>, see the class comments of {@link Shape}. * @param x the specified x coordinate * @param y the specified y coordinate * @return <code>true</code> if the <code>Polygon</code> contains the * specified coordinates; <code>false</code> otherwise. */ public boolean contains(double x, double y) { if (npoints <= 2 || !bounds.contains(x, y)) { return false; } updateComputingPath(); return closedPath.contains(x, y); }
/** * Determines if the specified coordinates are inside this * <code>Polygon</code>. For the definition of * <i>insideness</i>, see the class comments of {@link Shape}. * @param x the specified x coordinate * @param y the specified y coordinate * @return <code>true</code> if the <code>Polygon</code> contains the * specified coordinates; <code>false</code> otherwise. */ public boolean contains(double x, double y) { if (npoints <= 2 || !bounds.contains(x, y)) { return false; } updateComputingPath(); return closedPath.contains(x, y); }
/** * Determines if the specified coordinates are inside this * <code>Polygon</code>. For the definition of * <i>insideness</i>, see the class comments of {@link Shape}. * @param x the specified x coordinate * @param y the specified y coordinate * @return <code>true</code> if the <code>Polygon</code> contains the * specified coordinates; <code>false</code> otherwise. */ public boolean contains(double x, double y) { if (npoints <= 2 || !bounds.contains(x, y)) { return false; } updateComputingPath(); return closedPath.contains(x, y); }
/** * Tests if the interior of this <code>Polygon</code> entirely * contains the specified set of rectangular coordinates. * @param x the x coordinate of the top-left corner of the * specified set of rectangular coordinates * @param y the y coordinate of the top-left corner of the * specified set of rectangular coordinates * @param w the width of the set of rectangular coordinates * @param h the height of the set of rectangular coordinates * @return <code>true</code> if this <code>Polygon</code> entirely * contains the specified set of rectangular * coordinates; <code>false</code> otherwise. */ public boolean contains(double x, double y, double w, double h) { if (npoints <= 0 || !bounds.intersects(x, y, w, h)) { return false; } updateComputingPath(); return closedPath.contains(x, y, w, h); }
/** * Tests if the interior of this <code>Polygon</code> entirely * contains the specified set of rectangular coordinates. * @param x the x coordinate of the top-left corner of the * specified set of rectangular coordinates * @param y the y coordinate of the top-left corner of the * specified set of rectangular coordinates * @param w the width of the set of rectangular coordinates * @param h the height of the set of rectangular coordinates * @return <code>true</code> if this <code>Polygon</code> entirely * contains the specified set of rectangular * coordinates; <code>false</code> otherwise. */ public boolean contains(double x, double y, double w, double h) { if (npoints <= 0 || !bounds.intersects(x, y, w, h)) { return false; } updateComputingPath(); return closedPath.contains(x, y, w, h); }
/** * Tests if the interior of this <code>Polygon</code> intersects the * interior of a specified set of rectangular coordinates. * @param x the x coordinate of the specified rectangular * shape's top-left corner * @param y the y coordinate of the specified rectangular * shape's top-left corner * @param w the width of the specified rectangular shape * @param h the height of the specified rectangular shape * @return <code>true</code> if the interior of this * <code>Polygon</code> and the interior of the * specified set of rectangular * coordinates intersect each other; * <code>false</code> otherwise. */ public boolean intersects(double x, double y, double w, double h) { if (npoints <= 0 || !bounds.intersects(x, y, w, h)) { return false; } updateComputingPath(); return closedPath.intersects(x, y, w, h); }
/** * Tests if the interior of this <code>Polygon</code> entirely * contains the specified set of rectangular coordinates. * @param x the x coordinate of the top-left corner of the * specified set of rectangular coordinates * @param y the y coordinate of the top-left corner of the * specified set of rectangular coordinates * @param w the width of the set of rectangular coordinates * @param h the height of the set of rectangular coordinates * @return <code>true</code> if this <code>Polygon</code> entirely * contains the specified set of rectangular * coordinates; <code>false</code> otherwise. */ public boolean contains(double x, double y, double w, double h) { if (npoints <= 0 || !bounds.intersects(x, y, w, h)) { return false; } updateComputingPath(); return closedPath.contains(x, y, w, h); }
/** * Tests if the interior of this <code>Polygon</code> intersects the * interior of a specified set of rectangular coordinates. * @param x the x coordinate of the specified rectangular * shape's top-left corner * @param y the y coordinate of the specified rectangular * shape's top-left corner * @param w the width of the specified rectangular shape * @param h the height of the specified rectangular shape * @return <code>true</code> if the interior of this * <code>Polygon</code> and the interior of the * specified set of rectangular * coordinates intersect each other; * <code>false</code> otherwise. */ public boolean intersects(double x, double y, double w, double h) { if (npoints <= 0 || !bounds.intersects(x, y, w, h)) { return false; } updateComputingPath(); return closedPath.intersects(x, y, w, h); }
/** * Tests if the interior of this <code>Polygon</code> intersects the * interior of a specified set of rectangular coordinates. * @param x the x coordinate of the specified rectangular * shape's top-left corner * @param y the y coordinate of the specified rectangular * shape's top-left corner * @param w the width of the specified rectangular shape * @param h the height of the specified rectangular shape * @return <code>true</code> if the interior of this * <code>Polygon</code> and the interior of the * specified set of rectangular * coordinates intersect each other; * <code>false</code> otherwise. */ public boolean intersects(double x, double y, double w, double h) { if (npoints <= 0 || !bounds.intersects(x, y, w, h)) { return false; } updateComputingPath(); return closedPath.intersects(x, y, w, h); }