com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d
Class SceneGraphObjectState

java.lang.Object
  extended by com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.SceneGraphObjectState
Direct Known Subclasses:
BoundingLeafState, FogState, NodeComponentState, NodeState, NullSceneGraphObjectState

public abstract class SceneGraphObjectState
extends java.lang.Object


Field Summary
protected  Controller control
           
protected  SceneGraphObject node
           
protected  java.lang.String nodeClassName
           
protected  SymbolTableData symbol
           
 
Constructor Summary
SceneGraphObjectState(SymbolTableData symbol, Controller control)
          Create a new State object During Saveing SymbolTableData will have the nodeID and j3dNode fields set During loading SymbolTableData be null, symbol will be created and added to the symbol data during readObject()
 
Method Summary
 void buildGraph()
          Subclasses should processes their own buildGraph requirements BEFORE calling super.buildGraph().
 void cleanup()
           
protected  SceneGraphObject createNode()
          Create a new Java3D node for this object.
protected  SceneGraphObject createNode(java.lang.Class state)
          Create a new Java3D node from the supplied class using the parameterless constructor For Java3D nodes which do not have a default constructor you must overload this method and create the object using createNode( className, parameters ) This will correctly handle subclasses of Java3D classes
protected  SceneGraphObject createNode(java.lang.Class j3dClass, java.lang.Class[] parameterTypes, java.lang.Object[] parameters)
          Create a Java3D node which does not have a default constructor parameterTypes must contain the classes required by the constructor, use Interger.TYPE, Float.TYPE etc to specifiy primitive types paramters should contain the list of parameters for the constructor, primitive types should be wrapped in the appropriate class (ie Integer, Float )
protected  SceneGraphObject createNode(java.lang.String className)
          Create a new Java3D node from the supplied class name using the parameterless constructor For Java3D nodes which do not have a default constructor you must overload this method and create the object using createNode( className, parameters ) This will correctly handle subclasses of Java3D classes
private  SceneGraphObject createNode(java.lang.String className, java.lang.Class[] parameterTypes, java.lang.Object[] parameters)
          Create a Java3D node which does not have a default constructor parameterTypes must contain the classes required by the constructor, use Integer.TYPE, Float.TYPE etc to specifiy primitive types paramters should contain the list of parameters for the constructor, primitive types should be wrapped in the appropriate class (ie Integer, Float )
private  SceneGraphObject createNodeFromSuper(java.lang.String className)
          If createNode cannot locate the correct class to instantiate the node this method is called and will instantiate the node using it's Java3D Core superclass
private  SceneGraphObject createNodeFromSuper(java.lang.String className, java.lang.Class[] parameterTypes, java.lang.Object[] parameters)
          If createNode cannot locate the correct class to instantiate the node this method is called and will instantiate the node using it's Java3D Core superclass
protected  SceneGraphObjectState createState(SceneGraphObject obj, Controller control)
          Given a scene graph object instantiate the correct State class for that object
private  java.lang.String getClassName(java.lang.Class c)
          Return the class name of the Class, the fully qualified classname is stripped of all package information and returned
 SceneGraphObject getNode()
           
 int getNodeID()
           
 SymbolTableData getSymbol()
           
private  void readCapabilities(java.io.DataInput in)
           
protected  void readConstructorParams(java.io.DataInput in)
          Read the parameters required for the constructor of the Java3D object
 void readObject(java.io.DataInput in)
           
protected  java.lang.String readString(java.io.DataInput in)
          Read and return a possibly null string
private  void readUserData(java.io.DataInput in)
           
private  void writeCapabilities(java.io.DataOutput out)
           
protected  void writeConstructorParams(java.io.DataOutput out)
          Write the parameters required for the constructor of the Java3D object
 void writeObject(java.io.DataOutput out)
          DO NOT call symbolTable.addReference in writeObject as this (may) result in a concurrentModificationException.
protected  void writeString(java.lang.String str, java.io.DataOutput out)
          Write a possibly null string to the stream
private  void writeUserData(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected SceneGraphObject node

symbol

protected SymbolTableData symbol

control

protected Controller control

nodeClassName

protected java.lang.String nodeClassName
Constructor Detail

SceneGraphObjectState

public SceneGraphObjectState(SymbolTableData symbol,
                             Controller control)
Create a new State object During Saveing SymbolTableData will have the nodeID and j3dNode fields set During loading SymbolTableData be null, symbol will be created and added to the symbol data during readObject()

Method Detail

writeObject

public void writeObject(java.io.DataOutput out)
                 throws java.io.IOException
DO NOT call symbolTable.addReference in writeObject as this (may) result in a concurrentModificationException. All references should be created in the constructor

Throws:
java.io.IOException

readObject

public void readObject(java.io.DataInput in)
                throws java.io.IOException
Throws:
java.io.IOException

getNode

public SceneGraphObject getNode()

getNodeID

public int getNodeID()

getSymbol

public SymbolTableData getSymbol()

readUserData

private void readUserData(java.io.DataInput in)
                   throws java.io.IOException
Throws:
java.io.IOException

writeUserData

private void writeUserData(java.io.DataOutput out)
                    throws java.io.IOException
Throws:
java.io.IOException

writeCapabilities

private void writeCapabilities(java.io.DataOutput out)
                        throws java.io.IOException
Throws:
java.io.IOException

readCapabilities

private void readCapabilities(java.io.DataInput in)
                       throws java.io.IOException
Throws:
java.io.IOException

writeConstructorParams

protected void writeConstructorParams(java.io.DataOutput out)
                               throws java.io.IOException
Write the parameters required for the constructor of the Java3D object

Throws:
java.io.IOException

readConstructorParams

protected void readConstructorParams(java.io.DataInput in)
                              throws java.io.IOException
Read the parameters required for the constructor of the Java3D object

Throws:
java.io.IOException

createNode

protected SceneGraphObject createNode()
Create a new Java3D node for this object. This method is ONLY used when the Java3D Class type matches the State type, ie this does NOT handle subclasses of Java3D. For Java3D subclasses use createNode( Class state) This method MUST be implemented by all State objects but is not abstract to allow for external subclassing


createNode

protected SceneGraphObject createNode(java.lang.Class state)
Create a new Java3D node from the supplied class using the parameterless constructor For Java3D nodes which do not have a default constructor you must overload this method and create the object using createNode( className, parameters ) This will correctly handle subclasses of Java3D classes


createNode

protected SceneGraphObject createNode(java.lang.String className)
Create a new Java3D node from the supplied class name using the parameterless constructor For Java3D nodes which do not have a default constructor you must overload this method and create the object using createNode( className, parameters ) This will correctly handle subclasses of Java3D classes


createNodeFromSuper

private SceneGraphObject createNodeFromSuper(java.lang.String className)
If createNode cannot locate the correct class to instantiate the node this method is called and will instantiate the node using it's Java3D Core superclass


createNode

private SceneGraphObject createNode(java.lang.String className,
                                    java.lang.Class[] parameterTypes,
                                    java.lang.Object[] parameters)
Create a Java3D node which does not have a default constructor parameterTypes must contain the classes required by the constructor, use Integer.TYPE, Float.TYPE etc to specifiy primitive types paramters should contain the list of parameters for the constructor, primitive types should be wrapped in the appropriate class (ie Integer, Float )


createNode

protected SceneGraphObject createNode(java.lang.Class j3dClass,
                                      java.lang.Class[] parameterTypes,
                                      java.lang.Object[] parameters)
Create a Java3D node which does not have a default constructor parameterTypes must contain the classes required by the constructor, use Interger.TYPE, Float.TYPE etc to specifiy primitive types paramters should contain the list of parameters for the constructor, primitive types should be wrapped in the appropriate class (ie Integer, Float )


createNodeFromSuper

private SceneGraphObject createNodeFromSuper(java.lang.String className,
                                             java.lang.Class[] parameterTypes,
                                             java.lang.Object[] parameters)
If createNode cannot locate the correct class to instantiate the node this method is called and will instantiate the node using it's Java3D Core superclass


createState

protected SceneGraphObjectState createState(SceneGraphObject obj,
                                            Controller control)
Given a scene graph object instantiate the correct State class for that object


getClassName

private java.lang.String getClassName(java.lang.Class c)
Return the class name of the Class, the fully qualified classname is stripped of all package information and returned


buildGraph

public void buildGraph()
Subclasses should processes their own buildGraph requirements BEFORE calling super.buildGraph(). This ensures that when restoreSceneGraphObjectReferences is called in user code our references have been resolved


cleanup

public void cleanup()

readString

protected java.lang.String readString(java.io.DataInput in)
                               throws java.io.IOException
Read and return a possibly null string

Throws:
java.io.IOException

writeString

protected void writeString(java.lang.String str,
                           java.io.DataOutput out)
                    throws java.io.IOException
Write a possibly null string to the stream

Throws:
java.io.IOException


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.