public static boolean containsAllPoints(Area areaOutside, Area areaInside) { Area clone = (Area) areaOutside.clone(); IfcTools2D.enlargeSlightlyInPlace(clone); PathIterator iterator = areaInside.getPathIterator(null); double[] coords = new double[6]; boolean allInside = true; while (!iterator.isDone()) { iterator.currentSegment(coords); if (!clone.contains(new Point2D.Double(coords[0], coords[1]))) { allInside = false; break; } iterator.next(); } return allInside; }
Area clip = (Area)getGraphicsState().getCurrentClippingPath().clone(); clip.intersect(new Area(transformedBox)); Rectangle2D clipRect = clip.getBounds2D();
/** * Return a copy of the area backing this area node. * * @return a copy of the area backing this area node */ public Area getArea() { return (Area) area.clone(); }
/** * Return a copy of the area backing this area node. * * @return a copy of the area backing this area node */ public Area getArea() { return (Area) area.clone(); }
/** * Returns the absolute (ie transformed if needed) clip area for this box. * Cached as this will be needed on every box to check if the clip area is inside a page. */ public Area getAbsoluteClipBox(CssContext c) { if (!_clipBoxCalculated) { _absoluteClipBox = calcAbsoluteClipBox(c); _clipBoxCalculated = true; } return _absoluteClipBox != null ? (Area) _absoluteClipBox.clone() : null; }
@Override public com.himamis.retex.renderer.share.platform.geom.Area duplicate() { java.awt.geom.Area clone = (Area) super.clone(); java.awt.Shape s = clone; return new AreaD(s); }
/** For each area that ali contains, add it to the corresponding area here.*/ private void add(final AreaList ali) { for (final Map.Entry<Long,Area> entry : ali.ht_areas.entrySet()) { Area ob_area = entry.getValue(); final long lid = entry.getKey(); if (UNLOADED == ob_area) ob_area = ali.loadLayer(lid); Area area = (Area)ob_area; area = area.createTransformedArea(ali.at); // now need to inverse transform it by this.at try { area = area.createTransformedArea(this.at.createInverse()); } catch (final NoninvertibleTransformException nte) { IJError.print(nte); // do what? } Object this_area = this.ht_areas.get(entry.getKey()); if (UNLOADED == this_area) { this_area = loadLayer(lid); } if (null == this_area) this.ht_areas.put(entry.getKey(), (Area)area.clone()); else ((Area)this_area).add(area); updateInDatabase("points=" + ((Long)entry.getKey()).intValue()); } }
/** * Removes all of the geometry from this area node and restores it to an empty area. */ public void reset() { Area oldArea = (Area) area.clone(); area.reset(); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Removes all of the geometry from this area node and restores it to an empty area. */ public void reset() { Area oldArea = (Area) area.clone(); area.reset(); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Subtract the shape of the specified area from the shape of this area node. * The resulting shape of this area node will include areas that were contained * only in this area node and not in the specified area. * * @param area area to subtract, must not be null * @throws NullPointerException if area is null */ public void subtract(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.subtract(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Add the shape of the specified area to the shape of this area node. * The resulting shape of this area node will include the union of both shapes, * or all areas that were contained in either this or the specified area. * * @param area area to add, must not be null * @throws NullPointerException if area is null */ public void add(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.add(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Subtract the shape of the specified area from the shape of this area node. * The resulting shape of this area node will include areas that were contained * only in this area node and not in the specified area. * * @param area area to subtract, must not be null * @throws NullPointerException if area is null */ public void subtract(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.subtract(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Set the shape of this area node to be the combined area of its current * shape and the shape of the specified area, minus their intersection. The * resulting shape of this area node will include only areas that were contained * in either this area node or in the specified area, but not in both. * * @param area area to exclusive or, must not be null * @throws NullPointerException if area is null */ public void exclusiveOr(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.exclusiveOr(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Set the shape of this area node to the intersection of its current shape * and the shape of the specified area. The resulting shape of this area node * will include only areas that were contained in both this area node and also * in the specified area. * * @param area area to intersect, must not be null * @throws NullPointerException if area is null */ public void intersect(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.intersect(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Add the shape of the specified area to the shape of this area node. * The resulting shape of this area node will include the union of both shapes, * or all areas that were contained in either this or the specified area. * * @param area area to add, must not be null * @throws NullPointerException if area is null */ public void add(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.add(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Set the shape of this area node to the intersection of its current shape * and the shape of the specified area. The resulting shape of this area node * will include only areas that were contained in both this area node and also * in the specified area. * * @param area area to intersect, must not be null * @throws NullPointerException if area is null */ public void intersect(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.intersect(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
/** * Set the shape of this area node to be the combined area of its current * shape and the shape of the specified area, minus their intersection. The * resulting shape of this area node will include only areas that were contained * in either this area node or in the specified area, but not in both. * * @param area area to exclusive or, must not be null * @throws NullPointerException if area is null */ public void exclusiveOr(final Area area) { Area oldArea = (Area) this.area.clone(); this.area.exclusiveOr(area); updateBoundsFromShape(); firePropertyChange(-1, "area", oldArea, getArea()); }
copy.textArea = (Area) this.textArea.clone();
Area a2 = (Area) area.clone(); // make a copy so we don't disturb the original