com.jme.scene.model.XMLparser
Class JmeBinaryWriter

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

public class JmeBinaryWriter
extends java.lang.Object

Started Date: Jun 25, 2004

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

Author:
Jack Lindamood

Constructor Summary
JmeBinaryWriter()
          Creates a new Binary Writer.
 
Method Summary
 void clearProperty(java.lang.String key)
          Removes a property.
 void setProperty(java.lang.String key, java.lang.Object property)
          Adds a property .
 void writeScene(Geometry geo, java.io.OutputStream bin)
          Converts a given Geometry to jME's binary format.
 void writeScene(Node scene, java.io.OutputStream bin)
          Converts a given node to jME's binary format.
 void writeScene(Spatial spatial, java.io.OutputStream jMEFormat)
          Writes a spatial to jME's binary format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmeBinaryWriter

public JmeBinaryWriter()
Creates a new Binary Writer.

Method Detail

writeScene

public void writeScene(Node scene,
                       java.io.OutputStream bin)
                throws java.io.IOException
Converts a given node to jME's binary format.

Parameters:
scene - The node to save
bin - The OutputStream that will store the binary format
Throws:
java.io.IOException - If anything wierd happens.

writeScene

public void writeScene(Spatial spatial,
                       java.io.OutputStream jMEFormat)
                throws java.io.IOException
Writes a spatial to jME's binary format.

Parameters:
spatial - The spatial to write.
jMEFormat - The OutputStream to write it too.
Throws:
java.io.IOException - If anything wierd happens.

writeScene

public void writeScene(Geometry geo,
                       java.io.OutputStream bin)
                throws java.io.IOException
Converts a given Geometry to jME's binary format.

Parameters:
geo - The Geometry to save
bin - The OutputStream that will store the binary format
Throws:
java.io.IOException - If anything wierd happens.

setProperty

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

The only keys currently used are:
key -> PropertyDataType

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.