Here's a quick hack we use for debugging. It's pretty low level.
//------------------------------------------------------------
import javax.swing.*;
import javax.media.j3d.*;
public void displayTree (String title, Node top)
{
final JFrame popup = new JFrame(title);
popup.setSize(TREE_POPUP_WIDTH, TREE_POPUP_HEIGHT);
final Container pane = popup.getContentPane();
final JTree tree = new JTree(getTreeBranches(top));
final JScrollPane scrollPane = new JScrollPane(tree);
pane.add(scrollPane);
popup.show();
}
public DefaultMutableTreeNode getTreeBranches(Node node)
{
if (node == null) return null;
String name = node.getClass().getName();
DefaultMutableTreeNode treeNode =
new DefaultMutableTreeNode(name.substring(name.lastIndexOf('.') + 1));
if (node instanceof Group)
{
Group group = (Group)node;
final int n = group.numChildren();
for (int i = 0; i < n; i++)
treeNode.add(getTreeBranches(group.getChild(i)));
}
return treeNode;
}
//------------------------------------------------------------
Shawn Kendall wrote:
>
> I could swear that I saw someone post on this list about a scene graph
> browset/viewer GUI component that they built but I can find it in the
> list.
> Am I dreaming? Did I read about it somewhere else?
>
> Anyway...
> Does anyone know of such a thing out there?
>
> To clarify, I mean a Swing or AWT based component that takes a Java3D
> scene and allows the user to browser the scene/tree like a file browser.
>
> Not a renderer or Canvas3d.
> Thanks.
>
> --
> TTFN
>
> __________________________________________________________
>
> Shawn Kendall Full Sail Real World Education
> Course Instructor 3300 University BLVD
> Virtual Reality Winter Park FL 32792
> [EMAIL PROTECTED] http://www.fullsail.com
> __________________________________________________________
>
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
--
Ellery Chan <[EMAIL PROTECTED]>
Harris ISD, Melbourne, FL 32904
Voice: 407-984-6506, Fax: 407-984-6353
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/