* @return a clone of the tree node with a clone of the scene graph object in
*/
public SceneGraphTreeNode cloneNode(boolean deepClone, AbstractNode parent){
SceneGraphObject o=(SceneGraphObject)getGraphObject();
Node n=getSceneGraphNode();
AttachDetach ad=null;
if(n!=null && n.isLive()){
ad=new AttachDetach(n);
ad.detach();
}
Object clone=null;
if(o instanceof Group){
clone=((Group)o).cloneTree(deepClone);
}
else if(o instanceof Node){
clone=((Node)o).cloneNode(deepClone);
}
else if(o instanceof NodeComponent){
clone=((NodeComponent)o).cloneNodeComponent(deepClone);
}
else{
if(ad!=null) ad.attach();
throw new RuntimeException("Can not clone "+o);
}
if(ad!=null) ad.attach();
return (SceneGraphTreeNode)parent.createNode(clone);
}