public abstract class SceneGraphObjectState
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Controller |
control |
protected SceneGraphObject |
node |
protected java.lang.String |
nodeClassName |
protected SymbolTableData |
symbol |
Constructor and Description |
---|
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()
|
Modifier and Type | Method and Description |
---|---|
void |
buildGraph()
Subclasses should processes their own buildGraph requirements BEFORE
calling super.buildGraph().
|
void |
cleanup() |
protected SceneGraphObject |
createNode()
Create a new J3D node for this object.
|
protected SceneGraphObject |
createNode(java.lang.Class state)
Create a new J3D node from the supplied class using the parameterless constructor
For J3D 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 J3D classes
|
protected SceneGraphObject |
createNode(java.lang.Class j3dClass,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameters)
Create a J3D 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 J3D node from the supplied class name using the parameterless constructor
For J3D 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 J3D classes
|
protected SceneGraphObjectState |
createState(SceneGraphObject obj,
Controller control)
Given a scene graph object instantiate the correct State class
for that object
|
SceneGraphObject |
getNode() |
int |
getNodeID() |
SymbolTableData |
getSymbol() |
protected void |
readConstructorParams(java.io.DataInput in)
Read the parameters required for the constructor of the J3D object
|
void |
readObject(java.io.DataInput in) |
protected java.lang.String |
readString(java.io.DataInput in)
Read and return a possibly null string
|
protected void |
writeConstructorParams(java.io.DataOutput out)
Write the parameters required for the constructor of the J3D 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
|
protected SceneGraphObject node
protected SymbolTableData symbol
protected Controller control
protected java.lang.String nodeClassName
public SceneGraphObjectState(SymbolTableData symbol, Controller control)
public void writeObject(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public void readObject(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public SceneGraphObject getNode()
public int getNodeID()
public SymbolTableData getSymbol()
protected void writeConstructorParams(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
protected void readConstructorParams(java.io.DataInput in) throws java.io.IOException
java.io.IOException
protected SceneGraphObject createNode()
protected SceneGraphObject createNode(java.lang.Class state)
protected SceneGraphObject createNode(java.lang.String className)
protected SceneGraphObject createNode(java.lang.Class j3dClass, java.lang.Class[] parameterTypes, java.lang.Object[] parameters)
protected SceneGraphObjectState createState(SceneGraphObject obj, Controller control)
public void buildGraph()
public void cleanup()
protected java.lang.String readString(java.io.DataInput in) throws java.io.IOException
java.io.IOException
protected void writeString(java.lang.String str, java.io.DataOutput out) throws java.io.IOException
java.io.IOException