public String appendDiagnostics(StringBuilder builder) { builder.append("\t"); if (!isActive()) { builder.append("*"); } builder.append(name == null ? "-" : name); builder.append("\n\tComponents ["); for (SceneNodeComponent component : components) { builder.append("\n\t\t"); if (!component.isActive()) { builder.append("*"); } builder.append(component.getClass().getSimpleName()); } builder.append("]"); builder.append("\n\tChildren ["); for (SceneNode child : _childNodes) { builder.append("\n\t\t"); builder.append(child.appendDiagnostics(builder)); } builder.append("]"); return builder.toString(); }
@Override protected final void childAdded(ManagedObject child) { if (child instanceof SceneNodeComponent) { SceneNodeComponent component = (SceneNodeComponent) child; int baseType = component.baseComponentType; if (_components.containsKey(baseType)) { throw new IllegalArgumentException( "Node already contains component: " + component.getClass().getName()); } component.scene = scene; _components.put(baseType, component); _componentBits.set(component.componentType); } else { SceneNode node = (SceneNode) child; node.scene = scene; _childNodes.add(node); } }