package jaist.css.covis.cls;

import edu.umd.cs.piccolo.PNode;
import edu.umd.cs.piccolo.util.PBounds;
import edu.umd.cs.piccolo.util.PNodeFilter;

/**
 * øÉ^¦½m[hÌÌæªCboundsÌÌæÉ®SÉüÁÄ¢é©Ç¤©ð²×étB^
 * 
 * @author miuramo
 *
 */
public class PNodeBoundsIntersectsFilter implements PNodeFilter {
	PBounds bounds; // »è·éÌæ

	public PNodeBoundsIntersectsFilter(PBounds r) {
		bounds = r;
	}

	public boolean accept(PNode aNode) {
		if (aNode instanceof Covis_Object){
			System.out.println(aNode.getGlobalFullBounds().toString());
			if (bounds.intersects(aNode.getGlobalFullBounds()) || bounds.contains(aNode.getGlobalFullBounds())) { // îboundsªCarpÆdÈéêÌÝ
				return true;
			}
		}
		return false;
	}

	public boolean acceptChildrenOf(PNode aNode) {
		return true;
	}
}
