javax.media.ding3d.utils.scenegraph.io
Class SceneGraphStreamReader

java.lang.Object
  extended by javax.media.ding3d.utils.scenegraph.io.SceneGraphStreamReader

public class SceneGraphStreamReader
extends java.lang.Object

Read and create a (set) of Java3D BranchGraphs or Universe from a Java Stream.


Constructor Summary
SceneGraphStreamReader(java.io.InputStream stream)
          Creates new SceneGraphStreamReader and reads the file header information
 
Method Summary
 void close()
          Close the SceneGraphStreamReader stream
 java.lang.ClassLoader getClassLoader()
          Get the ClassLoader used to load the scene graph objects and deserialize user data
 BranchGroup readBranchGraph(java.util.HashMap namedObjects)
          Read and return the graph from the stream.
 ConfiguredUniverse readUniverse()
          Read and create the universe.
 ConfiguredUniverse readUniverse(Canvas3D canvas)
          Read and create the universe.
 void setClassLoader(java.lang.ClassLoader classLoader)
          Set the ClassLoader used to load the scene graph objects and deserialize user data
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneGraphStreamReader

public SceneGraphStreamReader(java.io.InputStream stream)
                       throws java.io.IOException
Creates new SceneGraphStreamReader and reads the file header information

Throws:
java.io.IOException
Method Detail

readUniverse

public ConfiguredUniverse readUniverse()
                                throws java.io.IOException
Read and create the universe. If the BranchGraphs were written then they will be added to the universe before it is returned.

Throws:
java.io.IOException

readUniverse

public ConfiguredUniverse readUniverse(Canvas3D canvas)
                                throws java.io.IOException
Read and create the universe. If the BranchGraphs were written then they will be added to the universe before it is returned.

Parameters:
canvas - The Canvas3D to associate with the universe.
Throws:
java.io.IOException

readBranchGraph

public BranchGroup readBranchGraph(java.util.HashMap namedObjects)
                            throws java.io.IOException
Read and return the graph from the stream. namedObjects map will be updated with any objects that were named during the write process

Throws:
java.io.IOException

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Set the ClassLoader used to load the scene graph objects and deserialize user data


getClassLoader

public java.lang.ClassLoader getClassLoader()
Get the ClassLoader used to load the scene graph objects and deserialize user data


close

public void close()
           throws java.io.IOException
Close the SceneGraphStreamReader stream

Throws:
java.io.IOException
Since:
Java 3D 1.5.1