com.sun.j3d.utils.universe
Class ConfigSexpression

java.lang.Object
  extended by com.sun.j3d.utils.universe.ConfigSexpression

 class ConfigSexpression
extends java.lang.Object


Field Summary
private  java.util.ArrayList elements
           
 
Constructor Summary
ConfigSexpression()
           
 
Method Summary
private  Matrix4d concatenate(java.util.ArrayList elements)
          Processes the (RotateTranslate m1 m2), (TranslateRotate m1 m2), and (Concatenate m1 m2) built-in commands.
private  java.lang.Object evaluateBuiltIn(ConfigContainer configContainer, java.util.ArrayList elements, int lineNumber)
          This method gets called from the s-expression parser to evaluate a built-in command.
private  BoundingSphere makeBoundingSphere(java.util.ArrayList elements)
          Processes the built-in command (BoundingSphere center radius).
private  Matrix4d makeRotate(java.util.ArrayList elements)
          Processes the (Rotate x y z) built-in command.
private  Matrix4d makeTranslate(java.util.ArrayList elements)
          Processes the built-in command (Translate x y z).
private  int myNextToken(java.io.StreamTokenizer st, java.lang.String file)
           
(package private)  java.lang.Object parseAndEval(ConfigContainer configContainer, java.io.StreamTokenizer st, int level)
           
(package private)  void print()
           
private  java.lang.String scanJavaProperties(java.io.StreamTokenizer st, java.lang.String f, java.lang.String s)
          Scan for Java properties in the specified string.
private  void syntaxError(java.io.StreamTokenizer st, java.lang.String file, java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

private java.util.ArrayList elements
Constructor Detail

ConfigSexpression

ConfigSexpression()
Method Detail

syntaxError

private void syntaxError(java.io.StreamTokenizer st,
                         java.lang.String file,
                         java.lang.String s)

myNextToken

private int myNextToken(java.io.StreamTokenizer st,
                        java.lang.String file)

parseAndEval

java.lang.Object parseAndEval(ConfigContainer configContainer,
                              java.io.StreamTokenizer st,
                              int level)

scanJavaProperties

private java.lang.String scanJavaProperties(java.io.StreamTokenizer st,
                                            java.lang.String f,
                                            java.lang.String s)
Scan for Java properties in the specified string. Nested properties are not supported.

Parameters:
st - stream tokenizer in use
f - current file name
s - string containing non-nested Java properties possibly interspersed with arbitrary text.
Returns:
scanned string with Java properties replaced with values

evaluateBuiltIn

private java.lang.Object evaluateBuiltIn(ConfigContainer configContainer,
                                         java.util.ArrayList elements,
                                         int lineNumber)
This method gets called from the s-expression parser to evaluate a built-in command.

Parameters:
elements - tokenized list of sexp elements
Returns:
object representing result of evaluation

makeTranslate

private Matrix4d makeTranslate(java.util.ArrayList elements)
Processes the built-in command (Translate x y z).

Parameters:
elements - ArrayList containing Doubles wrapping x, y, and z translation components at indices 1, 2, and 3 respectively
Returns:
matrix that translates by the given x, y, and z components

makeRotate

private Matrix4d makeRotate(java.util.ArrayList elements)
Processes the (Rotate x y z) built-in command.

Parameters:
elements - ArrayList containing Doubles wrapping x, y, and z Euler angles at indices 1, 2, and 3 respectively
Returns:
matrix that rotates by the given Euler angles around static X, Y, and Z basis vectors: first about X, then Y, and then Z
See Also:
Transform3D#setEuler()

concatenate

private Matrix4d concatenate(java.util.ArrayList elements)
Processes the (RotateTranslate m1 m2), (TranslateRotate m1 m2), and (Concatenate m1 m2) built-in commands. Although these do exactly the same thing, using the appropriate command is recommended in order to explicitly describe the sequence of transforms and their intent.

Parameters:
elements - ArrayList containing Matrix4d objects m1 and m2 at indices 1 and 2 respectively
Returns:
matrix that concatenates m1 and m2 in that order: if a point is transformed by the resulting matrix, then in effect the points are first transformed by m1 and then m2

makeBoundingSphere

private BoundingSphere makeBoundingSphere(java.util.ArrayList elements)
Processes the built-in command (BoundingSphere center radius). This is used when configuring behaviors.

Parameters:
elements - ArrayList containing Point3d at index 1 for the sphere center and Double at index 2 wrapping the sphere radius, or the String "infinite" at index 2.
Returns:
BoundingSphere with the given center and radius

print

void print()


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