com.jme.scene.model.XMLparser
Class JmeBinaryReader

java.lang.Object
  extended bycom.jme.scene.model.XMLparser.JmeBinaryReader

public class JmeBinaryReader
extends java.lang.Object

Started Date: Jun 23, 2004

This class converts jME's binary format to a scenegraph. Even though this class's name ends with Reader, it does not extend Reader

Author:
Jack Lindamood

Constructor Summary
JmeBinaryReader()
          Constructs a new JmeBinaryReader.
 
Method Summary
 void clearProperty(java.lang.String key)
          Removes a property.
 Node loadBinaryFormat(java.io.InputStream binaryJme)
          Reads the binaryJme InputStream to convert jME's binary format to a Node.
 Node loadBinaryFormat(Node storeNode, java.io.InputStream binaryJme)
          Reads the binaryJme InputStream and saves it to storeNode
 void setProperty(java.lang.String key, java.lang.Object property)
          Adds a property .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmeBinaryReader

public JmeBinaryReader()
Constructs a new JmeBinaryReader. This must be called after a DisplaySystem has been initialized.

Method Detail

loadBinaryFormat

public Node loadBinaryFormat(Node storeNode,
                             java.io.InputStream binaryJme)
                      throws java.io.IOException
Reads the binaryJme InputStream and saves it to storeNode

Parameters:
storeNode - Place to save the jME Scene
binaryJme - InputStream with the jME Scene
Returns:
The given storeNode
Throws:
java.io.IOException - If anything wierd goes on while reading.

loadBinaryFormat

public Node loadBinaryFormat(java.io.InputStream binaryJme)
                      throws java.io.IOException
Reads the binaryJme InputStream to convert jME's binary format to a Node.

Parameters:
binaryJme - The binary format jME scene
Returns:
A Node representing the binary file
Throws:
java.io.IOException - If anything wierd goes on while reading

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object property)
Adds a property . Properties can tell this how to process the binary file.

The only keys currently used are:
key -> PropertyDataType
"texurl" --> (URL) When loading a texture, will use this directory as the base texture directory
"bound" --> "box","sphere","obb" ; Type of bounding Volume. "sphere" is default

Parameters:
key - Key to add (For example "texdir")
property - Property for that key to have (For example "c:\\blarg\\")

clearProperty

public void clearProperty(java.lang.String key)
Removes a property. This is equivalent to setProperty(key,null)

Parameters:
key - The property to remove