List of utility methods to do Area Intersect
boolean | intersection(Area a1, Area a2) Check whether the two provided areas intersect one another. Area copy = new Area(a1); copy.intersect(a2); return !copy.isEmpty(); |
boolean | intersects(Area a, Area b) intersects Area a2 = (Area) a.clone();
a2.intersect(b);
return !a2.isEmpty();
|
boolean | intersects(Area lhs, Area rhs) intersects if (lhs == null || lhs.isEmpty() || rhs == null || rhs.isEmpty()) { return false; if (!lhs.getBounds().intersects(rhs.getBounds())) { return false; Area newArea = new Area(lhs); newArea.intersect(rhs); ... |