package NET.worlds.scape; public class SubclumpShape extends Shape implements ShapeLoaderListener { private Material pendingMaterial = null; private static final boolean debug = false; @Override public void setMaterial(Material m) { SuperRoot parentObj = this.getOwner(); if (!(parentObj instanceof Shape)) { super.setMaterial(m); } else { Shape parent = (Shape)parentObj; if (!parent.isFullyLoaded()) { parent.addLoadListener(this); this.pendingMaterial = m; } else { super.setMaterial(m); } } } @Override protected synchronized void addRwChildren(WObject container) { SuperRoot o = this.getOwner(); if (o instanceof Shape) { Shape parent = (Shape)o; if (!parent.isFullyLoaded()) { this.setState(LOADING, null); parent.addLoadListener(this); } } super.addRwChildren(container); } @Override public void notifyShapeLoaded(Shape s) { this.setState(NORMAL, null); this.shapeRedraw(); if (this.pendingMaterial != null) { super.setMaterial(this.pendingMaterial); } this.pendingMaterial = null; } }