public boolean addAll(Collection c) { if (c instanceof RectListManager) { add((RectListManager)c); } else { add(new RectListManager(c)); } return (c.size() != 0); }
public void dispose() { rootGN = null; currImg = null; workImg = null; renderingHints = null; usr2dev = null; if ( damagedAreas != null ){ damagedAreas.clear(); } damagedAreas = null; } /**
/** * Returns true if this collection contains all of the elements in * the specified collection. */ public boolean containsAll(Collection c) { if (c instanceof RectListManager) return containsAll((RectListManager)c); return containsAll(new RectListManager(c)); }
public boolean removeAll(Collection c) { if (c instanceof RectListManager) return removeAll((RectListManager)c); return removeAll(new RectListManager(c)); }
public boolean retainAll(Collection c) { if (c instanceof RectListManager) return retainAll((RectListManager)c); return retainAll(new RectListManager(c)); } public boolean retainAll(RectListManager rlm) {
splitRect(cr, r, splits); int splitCost=0; int l=0; add(splits[3], j, size-1); continue; insertRects(splits, 1, j+1, l-1); if (splits[3] != null) add(splits[3], j, size-1); r = getBounds(); if (r == null) return; if (overhead + (r.height*lineOverhead) + (r.height*r.width) < area) {
(damagedAreas != null)) { damagedAreas.subtract(devRLM, COPY_OVERHEAD, COPY_LINE_OVERHEAD); damagedAreas.mergeRects(COPY_OVERHEAD, COPY_LINE_OVERHEAD); Iterator iter = damagedAreas.iterator(); g2d.setComposite(AlphaComposite.Src); while (iter.hasNext()) { Iterator iter = devRLM.iterator(); while (iter.hasNext()) { Rectangle r = (Rectangle)iter.next();
devRLM = new RectListManager(rects); devRLM.mergeRects(COPY_OVERHEAD, COPY_LINE_OVERHEAD); } catch(Exception e) { e.printStackTrace();
splitRect(r, sr, splits); add(splits[3], i, size-1); break; insertRects(splits, 1, i+1, l-1); add(splits[3], i+l, size-1);
/** * Construct a <code>RectListManager</code> with one rectangle * @param rect The rectangle to put in this rlm. */ public RectListManager(Rectangle rect) { this(); add(rect); }
(currentRaster != null) && (damagedAreas != null)) { damagedAreas.subtract(devRLM, COPY_OVERHEAD, COPY_LINE_OVERHEAD); damagedAreas.mergeRects(COPY_OVERHEAD, COPY_LINE_OVERHEAD);
/** * Similar to clone only strongly typed * TODO Java 5: The use of covariant return types on clone() can eliminate * this method. */ public RectListManager copy() { return new RectListManager(rects); }
protected void insertRects(Rectangle[] rects, int srcPos, int dstPos, int len) { if (len == 0) return; // Make sure we have room. ensureCapacity(size+len); // Move everything after pos up... for (int i=size-1; i>=dstPos; i--) this.rects[i+len] = this.rects[i]; // Put the new rects in. System.arraycopy( rects, srcPos, this.rects, dstPos, len ); size += len; }
/** * Standard <code>Object</code> clone method. */ public Object clone() throws CloneNotSupportedException { return copy(); }
public void dump() { System.err.println("RLM: " + this + " Sz: " + size); System.err.println("Bounds: " + getBounds()); for (int i=0; i<size; i++) { Rectangle r = rects[i]; System.err.println(" [" + r.x + ", " + r.y + ", " + r.width + ", " + r.height + ']' ); } }
splitRect(cr, r, splits); int splitCost=0; int l=0; add(splits[3], j, size-1); continue; insertRects(splits, 1, j+1, l-1); if (splits[3] != null) add(splits[3], j, size-1); r = getBounds(); if (r == null) return; if (overhead + (r.height*lineOverhead) + (r.height*r.width) < area) {
(damagedAreas != null)) { damagedAreas.subtract(devRLM, COPY_OVERHEAD, COPY_LINE_OVERHEAD); damagedAreas.mergeRects(COPY_OVERHEAD, COPY_LINE_OVERHEAD); Iterator iter = damagedAreas.iterator(); g2d.setComposite(AlphaComposite.Src); while (iter.hasNext()) {
devRLM = new RectListManager(rects); devRLM.mergeRects(COPY_OVERHEAD, COPY_LINE_OVERHEAD); } catch(Exception e) { e.printStackTrace();
splitRect(r, sr, splits); add(splits[3], i, size-1); break; insertRects(splits, 1, i+1, l-1); add(splits[3], i+l, size-1);
public boolean removeAll(Collection c) { if (c instanceof RectListManager) return removeAll((RectListManager)c); return removeAll(new RectListManager(c)); }