|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.utils.scenegraph.io.retained.Controller
public abstract class Controller
Provides code to control the reading and writing of Java3D objects to and from any Java IO mechanism.
Nested Class Summary | |
---|---|
(package private) class |
Controller.J3dIOObjectInputStream
An ObjectInputStream that uses a different classLoader |
Field Summary | |
---|---|
protected static long |
BG_DIR_PTR
|
protected static long |
BRANCH_GRAPH_COUNT
|
protected java.lang.ClassLoader |
classLoader
When running the application within webstart this may not be the correct ClassLoader. |
protected int |
currentFileVersion
The currentFileVersion being read |
protected static long |
FILE_DESCRIPTION
|
private int |
imageCompression
|
(package private) java.lang.Class[] |
j3dClasses
|
protected static long |
NAMES_OBJECTS_TABLE_PTR
|
protected static long |
NODE_TYPES_PTR
|
protected NullSceneGraphObjectState |
nullObject
|
protected int |
outputFileVersion
The File version which will be written 1 = Java3D 1.3 beta 1 2 = Java3D 1.3 FCS, 1) fix to allow skipping user data written via SceneGraphIO interface 2) Add missing duplicateOnCloneTree flag (bug 4690159) 3 = Java3D 1.5.1 1) Add support for SceneGraphObject Name field 4 = Java3D 1.5.2 issue 532, for saving Background Geometry |
protected static long |
SYMBOL_TABLE_PTR
|
protected SymbolTable |
symbolTable
|
protected static long |
UNIVERSE_CONFIG_PTR
|
private boolean |
useSuperClass
If true when loading a scenegraph that contains nodes who's classes are not in the classpath then use then first Java3D core superclass to instantiate the node. |
Constructor Summary | |
---|---|
Controller()
Creates new Controller |
Method Summary | |
---|---|
void |
addNamedObject(java.lang.String name,
SceneGraphObject object)
Associate the name with the scene graph object |
private SceneGraphObjectState |
checkSuperClasses(SymbolTableData symbol)
Check to see if any of the superclasses of obj are known to the Java3D IO package |
abstract void |
close()
|
private SceneGraphObjectState |
constructStateObj(SymbolTableData symbol,
java.lang.Class state,
java.lang.Class objClass)
|
private SceneGraphObjectState |
createCoreState(int classID)
'Core' classes (ie those hard coded in this API) are assigned a numerical value representing their class. |
SceneGraphObjectState |
createState(SceneGraphObject obj)
Create a new state object and check for a pre-existing symbol table entry |
SceneGraphObjectState |
createState(SceneGraphObject obj,
SymbolTableData symbol)
Given a scene graph object instantiate the correct State class for that object. |
SceneGraphObjectState |
createState(SymbolTableData symbol)
Return the state class for the SceneGraphObject, creating one if it does not already exist |
java.lang.ClassLoader |
getClassLoader()
Get the class loader used to load the Scene Graph Objects and the serialized user data. |
int |
getCurrentFileVersion()
Get the file version of the file we are reading |
abstract long |
getFilePointer()
Get the current file 'pointer' location. |
int |
getImageCompression()
Returns the imageCompression to be used IMAGE_COMPRESSION_NONE, IMAGE_COMPRESSION_GZIP, IMAGE_COMPRESSION_JPEG |
SceneGraphObject |
getNamedObject(java.lang.String name)
Return the SceneGraphObject associated with the name |
java.lang.String[] |
getNames()
Get all the names of the named objects |
java.lang.Class |
getNodeClassFromID(int classID)
|
int |
getNodeClassID(SceneGraphObject node)
|
int |
getOutputFileVersion()
Get the file version that we should write |
private int |
getStateID(SceneGraphObjectState state)
Return the id of the state class |
SymbolTable |
getSymbolTable()
|
Bounds |
readBounds(java.io.DataInput in)
|
protected abstract void |
readBranchGraphs(int[] graphs)
Read the set of branchgraps. |
Color3f |
readColor3f(java.io.DataInput in)
|
Color4f |
readColor4f(java.io.DataInput in)
|
Matrix4d |
readMatrix4d(java.io.DataInput in)
|
protected void |
readNodeComponents(java.io.DataInput in)
Read in all the node components in this block |
SceneGraphObjectState |
readObject(java.io.DataInput in)
|
Point3d |
readPoint3d(java.io.DataInput in)
|
Point3f |
readPoint3f(java.io.DataInput in)
|
Quat4f |
readQuat4f(java.io.DataInput in)
|
java.lang.Object |
readSerializedData(java.io.DataInput dataInput)
|
int |
readSharedGroup(java.io.DataInput in)
Read a Shared group and it's node components from the IO Stream |
Transform3D |
readTransform3D(java.io.DataInput in)
|
Tuple3d |
readTuple3d(java.io.DataInput in,
Tuple3d tuple)
|
Tuple3f |
readTuple3f(java.io.DataInput in,
Tuple3f tuple)
|
Tuple4d |
readTuple4d(java.io.DataInput in,
Tuple4d tuple)
|
Tuple4f |
readTuple4f(java.io.DataInput in,
Tuple4f tuple)
|
ConfiguredUniverse |
readUniverse(java.io.DataInput in,
boolean attachBranchGraphs,
Canvas3D canvas)
Read and create a new Universe matching the one used during save. |
Vector3f |
readVector3f(java.io.DataInput in)
|
Vector4d |
readVector4d(java.io.DataInput in)
|
Vector4f |
readVector4f(java.io.DataInput in)
|
void |
reset()
Reset the controller, ready to load/save data to a new file |
void |
setClassLoader(java.lang.ClassLoader classLoader)
Set the class loader used to load the Scene Graph Objects and the serialized user data. |
void |
skipUserData(java.io.DataInput dataInput)
Skip past the user data object |
boolean |
useSuperClassIfNoChildClass()
Indicates to SceneGraphObjectState that it should use the Java3D core superclass for any tree nodes whose classes are not in the classpath during a load. |
void |
writeBounds(java.io.DataOutput out,
Bounds bounds)
|
abstract void |
writeBranchGraph(BranchGroup bg,
java.io.Serializable userData)
|
void |
writeColor3f(java.io.DataOutput out,
Color3f color)
|
void |
writeColor4f(java.io.DataOutput out,
Color4f vec)
|
void |
writeMatrix4d(java.io.DataOutput out,
Matrix4d m)
|
protected void |
writeNodeComponents(java.io.DataOutput out)
Write all the unsaved NodeComponents and SharedGroups to DataOutput. |
void |
writeObject(java.io.DataOutput out,
SceneGraphObjectState obj)
|
void |
writePoint3d(java.io.DataOutput out,
Point3d pt)
|
void |
writePoint3f(java.io.DataOutput out,
Point3f pt)
|
void |
writeQuat4f(java.io.DataOutput out,
Quat4f vec)
|
void |
writeSerializedData(java.io.DataOutput dataOutput,
java.io.Serializable userData)
Write a serializable object to the current file position, proceeded by the size of the object |
void |
writeSharedGroup(java.io.DataOutput out,
SharedGroup sharedGroup,
SymbolTableData symbol)
Write the shared group and it's node components to the IO stream |
void |
writeTransform3D(java.io.DataOutput out,
Transform3D tran)
|
void |
writeTuple3d(java.io.DataOutput out,
Tuple3d tuple)
|
void |
writeTuple3f(java.io.DataOutput out,
Tuple3f tuple)
|
void |
writeTuple4d(java.io.DataOutput out,
Tuple4d tuple)
|
void |
writeTuple4f(java.io.DataOutput out,
Tuple4f tuple)
|
void |
writeUniverse(java.io.DataOutput out,
SimpleUniverse universe,
boolean writeUniverseContent)
Write out the Universe information. |
void |
writeVector3f(java.io.DataOutput out,
Vector3f vec)
|
void |
writeVector4d(java.io.DataOutput out,
Vector4d vec)
|
void |
writeVector4f(java.io.DataOutput out,
Vector4f vec)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final long SYMBOL_TABLE_PTR
protected static final long BG_DIR_PTR
protected static final long NAMES_OBJECTS_TABLE_PTR
protected static final long NODE_TYPES_PTR
protected static final long UNIVERSE_CONFIG_PTR
protected static final long BRANCH_GRAPH_COUNT
protected static final long FILE_DESCRIPTION
protected SymbolTable symbolTable
protected NullSceneGraphObjectState nullObject
protected int currentFileVersion
protected int outputFileVersion
protected java.lang.ClassLoader classLoader
private boolean useSuperClass
private int imageCompression
java.lang.Class[] j3dClasses
Constructor Detail |
---|
public Controller()
Method Detail |
---|
public final SymbolTable getSymbolTable()
public int getOutputFileVersion()
public int getCurrentFileVersion()
public SceneGraphObjectState createState(SceneGraphObject obj)
public SceneGraphObjectState createState(SceneGraphObject obj, SymbolTableData symbol)
public SceneGraphObjectState createState(SymbolTableData symbol)
private SceneGraphObjectState constructStateObj(SymbolTableData symbol, java.lang.Class state, java.lang.Class objClass)
private SceneGraphObjectState checkSuperClasses(SymbolTableData symbol)
public void writeObject(java.io.DataOutput out, SceneGraphObjectState obj) throws java.io.IOException
java.io.IOException
public SceneGraphObjectState readObject(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void setClassLoader(java.lang.ClassLoader classLoader)
public java.lang.ClassLoader getClassLoader()
protected void writeNodeComponents(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
protected void readNodeComponents(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeSharedGroup(java.io.DataOutput out, SharedGroup sharedGroup, SymbolTableData symbol) throws java.io.IOException
java.io.IOException
public int readSharedGroup(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeUniverse(java.io.DataOutput out, SimpleUniverse universe, boolean writeUniverseContent) throws java.io.IOException, UnsupportedUniverseException, CapabilityNotSetException
java.io.IOException
UnsupportedUniverseException
CapabilityNotSetException
public ConfiguredUniverse readUniverse(java.io.DataInput in, boolean attachBranchGraphs, Canvas3D canvas) throws java.io.IOException
attachBranchGraphs
- If true then all the branchGraph attached to
the universe when it was saved will be loaded and reattached.
java.io.IOException
protected abstract void readBranchGraphs(int[] graphs) throws java.io.IOException
java.io.IOException
public abstract void writeBranchGraph(BranchGroup bg, java.io.Serializable userData) throws java.io.IOException
java.io.IOException
public void reset()
private SceneGraphObjectState createCoreState(int classID)
private int getStateID(SceneGraphObjectState state)
public java.lang.Class getNodeClassFromID(int classID)
public int getNodeClassID(SceneGraphObject node)
public void addNamedObject(java.lang.String name, SceneGraphObject object)
public SceneGraphObject getNamedObject(java.lang.String name) throws NamedObjectException, ObjectNotLoadedException
NamedObjectException
ObjectNotLoadedException
public java.lang.String[] getNames()
public void writeSerializedData(java.io.DataOutput dataOutput, java.io.Serializable userData) throws java.io.IOException
java.io.IOException
public java.lang.Object readSerializedData(java.io.DataInput dataInput) throws java.io.IOException
java.io.IOException
public void skipUserData(java.io.DataInput dataInput) throws java.io.IOException
java.io.IOException
public void writeColor3f(java.io.DataOutput out, Color3f color) throws java.io.IOException
java.io.IOException
public Color3f readColor3f(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeColor4f(java.io.DataOutput out, Color4f vec) throws java.io.IOException
java.io.IOException
public Color4f readColor4f(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writePoint3f(java.io.DataOutput out, Point3f pt) throws java.io.IOException
java.io.IOException
public Point3f readPoint3f(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writePoint3d(java.io.DataOutput out, Point3d pt) throws java.io.IOException
java.io.IOException
public Point3d readPoint3d(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeVector3f(java.io.DataOutput out, Vector3f vec) throws java.io.IOException
java.io.IOException
public Vector3f readVector3f(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeVector4d(java.io.DataOutput out, Vector4d vec) throws java.io.IOException
java.io.IOException
public Vector4d readVector4d(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeVector4f(java.io.DataOutput out, Vector4f vec) throws java.io.IOException
java.io.IOException
public Vector4f readVector4f(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeQuat4f(java.io.DataOutput out, Quat4f vec) throws java.io.IOException
java.io.IOException
public Quat4f readQuat4f(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeMatrix4d(java.io.DataOutput out, Matrix4d m) throws java.io.IOException
java.io.IOException
public Matrix4d readMatrix4d(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeTuple3f(java.io.DataOutput out, Tuple3f tuple) throws java.io.IOException
java.io.IOException
public Tuple3f readTuple3f(java.io.DataInput in, Tuple3f tuple) throws java.io.IOException
java.io.IOException
public void writeTuple3d(java.io.DataOutput out, Tuple3d tuple) throws java.io.IOException
java.io.IOException
public Tuple3d readTuple3d(java.io.DataInput in, Tuple3d tuple) throws java.io.IOException
java.io.IOException
public void writeTuple4d(java.io.DataOutput out, Tuple4d tuple) throws java.io.IOException
java.io.IOException
public Tuple4d readTuple4d(java.io.DataInput in, Tuple4d tuple) throws java.io.IOException
java.io.IOException
public void writeTuple4f(java.io.DataOutput out, Tuple4f tuple) throws java.io.IOException
java.io.IOException
public Tuple4f readTuple4f(java.io.DataInput in, Tuple4f tuple) throws java.io.IOException
java.io.IOException
public void writeTransform3D(java.io.DataOutput out, Transform3D tran) throws java.io.IOException
java.io.IOException
public Transform3D readTransform3D(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void writeBounds(java.io.DataOutput out, Bounds bounds) throws java.io.IOException
java.io.IOException
public Bounds readBounds(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public abstract long getFilePointer()
public abstract void close() throws java.io.IOException
java.io.IOException
public boolean useSuperClassIfNoChildClass()
public int getImageCompression()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |