public void addChild(Paintable p) {
		if (null == p) {
			throw new IllegalArgumentException("Please provide a paintable.");
		}
		if (this.equals(p)) {
			throw new IllegalArgumentException("Cannot add itself as a child.");
		}
		if (children.contains(p)) {
			return;
		} // nothing changes, no exception
		if (p instanceof Composite && ((Composite) p).contains(this)) {
			throw new IllegalArgumentException("Cannot add this Paintable (circular reference).");
		}

		children.add(p);
	}
public void addChild ( Paintable p ) { if ( null == p ) { throw new IllegalArgumentException ( "Please provide a paintable." ) ; } if ( this . equals ( p ) ) { throw new IllegalArgumentException ( "Cannot add itself as a child." ) ; } if ( children . contains ( p ) ) { return ; } if ( p instanceof Composite && ( ( Composite ) p ) . contains ( this ) ) { throw new IllegalArgumentException ( "Cannot add this Paintable (circular reference)." ) ; } children . add ( p ) ; }
Add a {@link Paintable} to this composite.

@param p
the <code>Paintable</code> to add to this composite