public abstract class SceneGraphObjectState extends Object
Modifier and Type | Field and Description |
---|---|
protected Controller |
control |
protected SceneGraphObject |
node |
protected 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 Java3D node for this object.
|
protected SceneGraphObject |
createNode(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(Class j3dClass,
Class[] parameterTypes,
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(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
|
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(DataInput in)
Read the parameters required for the constructor of the Java3D object
|
void |
readObject(DataInput in) |
protected String |
readString(DataInput in)
Read and return a possibly null string
|
protected void |
writeConstructorParams(DataOutput out)
Write the parameters required for the constructor of the Java3D object
|
void |
writeObject(DataOutput out)
DO NOT call symbolTable.addReference in writeObject as this (may)
result in a concurrentModificationException.
|
protected void |
writeString(String str,
DataOutput out)
Write a possibly null string to the stream
|
protected SceneGraphObject node
protected SymbolTableData symbol
protected Controller control
protected String nodeClassName
public SceneGraphObjectState(SymbolTableData symbol, Controller control)
public void writeObject(DataOutput out) throws IOException
IOException
public void readObject(DataInput in) throws IOException
IOException
public SceneGraphObject getNode()
public int getNodeID()
public SymbolTableData getSymbol()
protected void writeConstructorParams(DataOutput out) throws IOException
IOException
protected void readConstructorParams(DataInput in) throws IOException
IOException
protected SceneGraphObject createNode()
protected SceneGraphObject createNode(Class state)
protected SceneGraphObject createNode(String className)
protected SceneGraphObject createNode(Class j3dClass, Class[] parameterTypes, Object[] parameters)
protected SceneGraphObjectState createState(SceneGraphObject obj, Controller control)
public void buildGraph()
public void cleanup()
protected String readString(DataInput in) throws IOException
IOException
protected void writeString(String str, DataOutput out) throws IOException
IOException
Copyright © 2016–2022 SciJava. All rights reserved.