|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwobs.scene3d.player.X3DField
public class X3DField
This class is used to represent a X3D/VRML field of any type. The Java type that an instance of this class contains depends on the X3D/VRML field
represented. For a particular field only one Java value access method will work, and calling other incompatible access methods will throw an exception.
Similarly, trying to set the field value to an incompatible java type will throw an exception.
The following table shows the X3D/VRML field type, its associated java value that is supported as parameter to the set()-methods , its corresponding getXX()-method, and the structure of the java data:
| X3D/VRML field type | Java type | Supported getXX()-method | The java data structure |
| SFBool | boolean | getBoolean() | - |
| SFString | String | getString() | - |
| SFInt32 | int | getInt() | - |
| SFNode | X3DNode | getNode() | - |
| SFRotation | float[4] | getFloatArray() | { Nx, Ny, Nz, angle } |
| SFColor | int | getInt() | 0xRRGGBB (hexadecimal) |
| SFImage | Texture3D | getImage() | - |
| SFFloat | float | getFloat() | - |
| SFTime | double | getDouble() | - |
| SFVec2f | float[2] | getFloatArray() | { s, t } |
| SFVec3f | float[3] | getFloatArray() | { x, y, z } |
| MFString | String[...] | getStringArray() | { string0, string1 ... } |
| MFInt32 | int[...] | getIntArray() | { int0, int1, ... } |
| MFNode | X3DNode[...] | getNodeArray() | { node0, node1, ...} |
| MFRotation | float[...] | getFloatArray() | { Nx0, Ny0, Nz0, angle0, Nx1, Ny1, Nz1, angle1, ... ] |
| MFColor | int[...] | getIntArray() | { 0xRRGGBB0, 0xRRGGBB1, ... } |
| MFFloat | float[...] | getFloatArray() | { float0, float1 ... } |
| MFVec2f | float[...] | getFloatArray() | { x0, y0, x1, y1, ... } |
| MFVec3f | float[...] | getFloatArray() | [ x0, y0, z0, x1, y1, z1, ... ] |
| Field Summary | |
|---|---|
X3DNode |
parent
Deprecated. should use getParent() instead |
byte |
type
Deprecated. should use getType() instead |
| Method Summary | |
|---|---|
void |
addFieldEventListener(X3DFieldEventListener listener)
Adds the specified field listener to receive field events from this field. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
getBoolean()
Retrieves the boolean value (if the field type is SFBool). |
boolean[] |
getBooleanArray()
Retrieves the boolean array value (if the field type is MFBool. |
double |
getDouble()
Retrieves the double value (if the field type is SFTime). |
double[] |
getDoubleArray()
Retrieves the double array value (if the field type is MFTime). |
float |
getFloat()
Retrieves the float value (if the field type is SFFloat). |
float[] |
getFloatArray()
Retrieves the float array value (if the field type is SFVec2f, SFVec3f, MFFloat, MFVec2f or MFVec3f). |
int |
getInt()
Retrieves the int value (if the field type is SFInt32 or SFColor). |
int[] |
getIntArray()
Retrieves the int array value (if the field type is MFInt32 or MFColor). |
X3DNode |
getNode()
Retrieves the X3DNode value (if the field type is SFNode or MFNode). |
X3DNode[] |
getNodeArray()
Retrieves the X3DNode array(if the field type is MFNode). |
java.lang.String |
getString()
Retrieves the String value (if the field type is SFString or MFString). |
java.lang.String[] |
getStringArray()
Retrieves the String array value (if the field type is MFString). |
int |
getType()
Returns the type of this field. |
void |
removeFieldEventListener(X3DFieldEventListener listener)
Removes the specified field listener so that it no longer receives field events from this field. |
void |
set()
Signals to the SceneGraph that this field has been set. |
void |
set(boolean newValue)
Sets the field value, (if the field type is SFBool). |
void |
set(double newValue)
Sets the field value (if the field type is SFTime). |
void |
set(float newValue)
Sets the field value (if the field type is SFFloat). |
void |
set(int newValue)
Sets the field value, (if the field type is SFInt32). |
void |
set(java.lang.Object newValue)
Sets the field value (if the field type is SFString, SFNode, SFImage or any Field.MFxxx type). |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final byte type
public X3DNode parent
| Method Detail |
|---|
public int getType()
public java.lang.Object clone()
clone in class java.lang.Objectpublic void addFieldEventListener(X3DFieldEventListener listener)
listener - - the field listener.public void removeFieldEventListener(X3DFieldEventListener listener)
listener - - the field listener.public void set()
public void set(java.lang.Object newValue)
newValue - The new value this field will contain.public void set(boolean newValue)
newValue - The new boolean value this field will contain.public void set(int newValue)
newValue - The new int value this field will contain.public void set(float newValue)
newValue - The new float value this field will contain.public void set(double newValue)
newValue - The new double value this field will contain.public boolean getBoolean()
public int getInt()
public float getFloat()
public double getDouble()
public java.lang.String getString()
public X3DNode getNode()
public boolean[] getBooleanArray()
public int[] getIntArray()
public float[] getFloatArray()
public double[] getDoubleArray()
public java.lang.String[] getStringArray()
public X3DNode[] getNodeArray()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||