FilterGusMy Homepage
(c)  Mauro Marinilli September 1998
 

Scene Graph Viewer 0.1

for Java3D 1.1 beta01

  Java3D, the 3D API for Java enables 3D applications with new features like 3D on the Web, and a high level approach to 3D programming. This package is one of the first developed for this API and represents the core of a library of classes aimed at developing a fully Java-implemented Java3D editor facility. This is anyway an early release and most of its functionalities are just sketched or even not yet fully available from Javasoft. Future releases will come as soon as new features will be provided.
Here is a screenshot from the Viewer class, as you can see nodes by now are tagged laconically with their toString() method.
 
figure 1. a screenshot from the Viewer
 

What it is

    A Java package for visualizing VirtualUniverse instances with a tree-like interface using the Swing JTree class. A set of classes that build a tree model out of a Java3D scene graph. This not just for looking at it, but also for editing, building and generating full working scenes (The model is bidirectional).
This current release anyway has not editing features because of not yet resolved problems with the 1.1_beta01 Java3D API.
 
 

Installing

 
    Unzip the file in a new directory and be sure to have Java1.2beta4 with Java3D 1.1 beta01 working and launch Viewer for a GUI front end.
 
Using it with existing  scenes
 
    When you use it pay attention to obtain all the needed capabilities from every node, otherwise it won't work; for instance, just after a objNode object statement, write also:
objNode.setCapability(objNode.ALLOW_CHILDREN_READ);

    That is unpractical in this early release, because you need to code it for every Node instance in your code! As soon as serialization and robust cloning will be available (and documented) this boundary will be overcome.

    As a simple procedure, following these steps to see the SceneGraph from your Java3D scene:

  1. make sure every node has its property set for being readable from the tree model
  2. call one of the classes described below, the one that better matches your needs, or even MainFrame as well, giving as the constructor parameter your VirtualUniverse instance, fully readable or editable as you need.
    In the package is also shipped a HelloTree class modified, so just launch it.
 
 
a brief class description
  To summarize, TreeModelSupport handles the Listeners, those classes responsible for handling specialized events in the Swing architecture model (a modified MVC ).It's just a matter of visiting each of them, stored in a list and fire their notification methods. Its work is general and could be used and reused for different tree model needs.
Then comes  SceneTreeModel that implements all the remaining methods needed for carving out a tree of any object, in Swing's programmer's view:
getRoot, getChild, getChildCount, isLeaf, indexOfChild, valueForPathChanged

After you have had a tree model of your data structure (here the VirtualUniverse class, any VirtualUniverse) it's just a layering exercise, to make from it a JTree , and with the JTree a JPanel, and with the JPanel a JFrame, each class providing more and more accessory methods suited for their respective levels. Of course you can get rid of all this proliferation and make it out with one or two classes, but you know...
 
 

Release notes

 
First Release
 

  1. Sept.1998 written the essential classes and the UI fully working.

  2. the I/O operations (loading especially) are not working due to unresolved problems
    (Finally, thanks to Professor Marco Schaerf for its kind attention & patience with this clumsy first release)
 
Known Problems
 
 
(c)  Mauro Marinilli September 1998
Java, Java3D, etc. are trademarks of SUN Microsystems inc.