if (r2d == null) {
Rectangle2D paoi = aoi;
AffineTransform at = gn.getTransform();
if (at != null)
paoi = at.createTransformedShape(aoi).getBounds2D();
Filter f = getBackground(gn.getParent(), gn, paoi);
// Don't add the nodes unless they will contribute.
if ((f != null) && f.getBounds2D().intersects(aoi)) {
srcs.add(f);
}
}
if (child != null) {
CompositeGraphicsNode cgn = (CompositeGraphicsNode)gn;
List children = cgn.getChildren();
Iterator i = children.iterator();
while (i.hasNext()) {
GraphicsNode childGN = (GraphicsNode)i.next();
// System.out.println("Parent: " + cgn +
// "\n Child: " + child +
// "\n ChildGN: " + childGN);
if (childGN == child)
break;
Rectangle2D cbounds = childGN.getBounds();
// System.out.println("Child : " + childGN);
// System.out.println("Bounds: " + cbounds);
// System.out.println(" : " + aoi);
AffineTransform at = childGN.getTransform();
if (at != null)
cbounds = at.createTransformedShape(cbounds).getBounds2D();
if (aoi.intersects(cbounds)) {
srcs.add(childGN.getEnableBackgroundGraphicsNodeRable
(true));
}
}
}
if (srcs.size() == 0)
return null;
Filter ret = null;
if (srcs.size() == 1)
ret = (Filter)srcs.get(0);
else
ret = new CompositeRable8Bit(srcs, CompositeRule.OVER, false);