Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.trapezium.vrml.grammar
Class VRML97  view VRML97 download VRML97.java

java.lang.Object
  extended bycom.trapezium.vrml.grammar.VRML97

public class VRML97
extends java.lang.Object

Static public methods about the VRML specification. This class contains information about all VRML 2.0 nodes, fields, and default field values. It has static public methods for accessing this information, and is used mainly by the parser.

Since:
1.1
Version:
1.12, 25 Feb 1998, added Table 7 base profile limits, added MFTime support, 1.1, 8 Jan 1998

Field Summary
(package private) static java.util.Hashtable actualTypesByField
          Some fields are only allowed to contain specific types.
(package private) static java.util.Hashtable anchorFields
           
(package private) static java.util.Hashtable appearanceFields
           
(package private) static java.util.Hashtable audioClipFields
           
(package private) static java.util.Hashtable backgroundFields
           
static int BboxSizeSFVec3f
          Vorlon data type indicating bboxSize conventions, all positive or all -1
(package private) static java.lang.String[] bgUrlFields
           
(package private) static java.util.Hashtable billboardFields
           
(package private) static java.util.Hashtable boxFields
           
(package private) static java.util.Hashtable builtInNodes
           
static java.util.Hashtable builtInTypes
           
(package private) static java.util.Hashtable collisionFields
           
(package private) static java.util.Hashtable colorFields
           
(package private) static java.util.Hashtable colorInterpolatorFields
           
(package private) static java.util.Hashtable coneFields
           
(package private) static java.util.Hashtable coordinateDeformerFields
           
(package private) static java.util.Hashtable coordinateFields
           
(package private) static java.util.Hashtable coordinateInterpolatorFields
           
(package private) static java.util.Hashtable cylinderFields
           
(package private) static java.util.Hashtable cylinderSensorFields
           
(package private) static java.util.Hashtable directionalLightFields
           
(package private) static java.util.Hashtable elevationGridFields
           
static int eventIn
          eventIn interface constant
static int eventOut
          eventOut interface constant
static int exposedField
          exposedField interface constant
(package private) static java.util.Hashtable extrusionFields
           
static int field
          field interface constant
(package private) static java.util.Hashtable fogFields
           
(package private) static java.util.Hashtable fontStyleFields
           
(package private) static java.util.Hashtable groupFields
           
(package private) static java.util.Hashtable imageTextureFields
           
(package private) static java.util.Hashtable indexedFaceSetFields
           
(package private) static java.util.Hashtable indexedLineSetFields
           
(package private) static java.util.Hashtable inlineFields
           
(package private) static java.util.Hashtable LODFields
           
(package private) static java.util.Hashtable materialFields
           
static int MFColor
          Built in VRML97 data type
static int MFFloat
          Built in VRML97 data type
static int MFInt32
          Built in VRML97 data type
static int MFNode
          Built in VRML97 data type
static int MFRotation
          Built in VRML97 data type
static int MFString
          Built in VRML97 data type
static int MFTime
          Built in VRML97 data type
static int MFVec2f
          Built in VRML97 data type
static int MFVec3f
          Built in VRML97 data type
(package private) static java.util.Hashtable movieTextureFields
           
(package private) static java.util.Hashtable navigationInfoFields
           
(package private) static java.util.Hashtable nodesWithUrls
           
(package private) static java.util.Hashtable normalFields
           
(package private) static java.util.Hashtable normalInterpolatorFields
           
(package private) static boolean nurbsAreEnabled
           
(package private) static java.util.Hashtable nurbsCurve2DFields
           
(package private) static java.util.Hashtable nurbsGroupFields
           
(package private) static java.util.Hashtable nurbsPositionInterpolatorFields
           
(package private) static java.util.Hashtable nurbsSurfaceFields
           
(package private) static java.util.Hashtable nurbsTextureSurfaceFields
           
(package private) static java.util.Hashtable orientationInterpolatorFields
           
(package private) static java.util.Hashtable pixelTextureFields
           
(package private) static java.util.Hashtable planeSensorFields
           
(package private) static java.util.Hashtable pointLightFields
           
(package private) static java.util.Hashtable pointSetFields
           
(package private) static java.util.Hashtable positionInterpolatorFields
           
static int PositiveSFVec3f
          Vorlon data type indicating SFVec3f with only positive values
(package private) static java.util.Hashtable proximitySensorFields
           
(package private) static java.util.Hashtable scalarInterpolatorFields
           
(package private) static java.util.Hashtable scriptFields
           
static int SFBool
          Built in VRML97 data type
static int SFColor
          Built in VRML97 data type
static int SFFloat
          Built in VRML97 data type
static int SFImage
          Built in VRML97 data type
static int SFInt32
          Built in VRML97 data type
static int SFNode
          Built in VRML97 data type
static int SFRotation
          Built in VRML97 data type
static int SFString
          Built in VRML97 data type
static int SFTime
          Built in VRML97 data type
static int SFVec2f
          Built in VRML97 data type
static int SFVec3f
          Built in VRML97 data type
(package private) static java.util.Hashtable shapeFields
           
(package private) static java.util.Hashtable soundFields
           
(package private) static java.util.Hashtable sphereFields
           
(package private) static java.util.Hashtable sphereSensorFields
           
(package private) static java.util.Hashtable spotLightFields
           
(package private) static java.util.Hashtable switchFields
           
(package private) static java.util.Hashtable textFields
           
(package private) static java.util.Hashtable textureCoordinateFields
           
(package private) static java.util.Hashtable textureTransformFields
           
(package private) static java.util.Hashtable timeSensorFields
           
(package private) static java.util.Hashtable touchSensorFields
           
(package private) static java.util.Hashtable transformFields
           
(package private) static java.util.Hashtable trimmedSurfaceFields
           
static int UnknownInterfaceType
          found an interface type that isn't field, exposedField, eventIn, or eventOut
static int UnknownType
          Constants representing built int field types
(package private) static java.util.Hashtable viewpointFields
           
(package private) static java.util.Hashtable visibilitySensorFields
           
(package private) static java.util.Hashtable worldInfoFields
           
 
Constructor Summary
VRML97()
           
 
Method Summary
static void addFunction(java.lang.String s, com.trapezium.vrml.node.Node parent)
          Add a ScriptFunction child to a Node.
(package private) static void checkISFieldTypes(com.trapezium.vrml.fields.ISField isField, com.trapezium.vrml.node.Node parentNode)
           
static void checkScript(com.trapezium.vrml.node.Node n, com.trapezium.vrml.ROUTE r, com.trapezium.vrml.RouteDestination rd, com.trapezium.parse.TokenEnumerator v)
           
static java.lang.String convertToVRML97(java.lang.String s)
          Convert a Vorlon type into VRML97 type.
static void disableNurbs()
           
static void enableNurbs()
           
static boolean fieldHasType(java.lang.String node, java.lang.String field, com.trapezium.util.ReturnInteger result)
          Does a field restrict its values to a specific type?
static boolean fieldIsDefault(java.lang.String nodeName, java.lang.String fieldId, int firstTokenOffset, int lastTokenOffset, com.trapezium.parse.TokenEnumerator v)
          Is a field value equivalent to the default field value?
static java.lang.String getClosestFieldId(java.lang.String nodeName, java.lang.String fieldId, com.trapezium.util.ReturnInteger matchScore)
          get the field id String that most closely mathces the unknown field type id
static java.lang.String getClosestMatch(java.lang.String fieldId, java.util.Hashtable hash, com.trapezium.util.ReturnInteger matchScore)
          get the field id String that most closely matches the unknown field id.
static java.lang.String getClosestNode(java.lang.String nodeType, com.trapezium.util.ReturnInteger matchScore)
          get the node String that most closely matches the unknown node string
static java.lang.String getClosestType(java.lang.String fieldType, com.trapezium.util.ReturnInteger matchScore)
          get the fieldType String that most closely matches the unknown field type string
static boolean getDefaultBoolValue(java.lang.String nodeName, java.lang.String fieldId)
          Get the default boolean value for a node and field.
static FieldDescriptor getFieldDescriptor(java.lang.String nodeName, java.lang.String fieldId)
          get the FieldDescriptor associated with a node and field id
static java.util.Hashtable getFieldTable(java.lang.String nodeName)
          Get a Hashtable with a FieldDescriptor entry for each field for a node
static int getFieldType(java.lang.String nodeName, java.lang.String fieldId)
          Get the field data type constant associated with a node & field.
static java.lang.String getFieldTypeString(int fieldType)
          Convert a field data type constant into its corresponding String.
static java.lang.String getFieldTypeString(java.lang.String nodeName, java.lang.String fieldId)
          Get the field type string for a node and field
static int getInterfaceType(java.lang.String nodeName, java.lang.String fieldId)
          Get the interface type constant for a node and field.
static java.lang.String getInterfaceTypeStr(int itype)
          Convert an interface type constant into a String
static java.lang.Object getUrlFieldList(java.lang.String nodeName)
           
static boolean hasLetters(java.lang.String s)
           
static boolean isBuiltInNode(java.lang.String nodeName)
          is the node part of the VRML97 spec?
static boolean isBuiltInType(java.lang.String typeName)
          is the type part of the VRML97 spec?
static boolean isNurbsEnabled()
           
static boolean isValidFieldId(java.lang.String nodeName, java.lang.String fieldId)
          Is the node & field combination valid?
static com.trapezium.vrml.node.Node NodeFactory(java.lang.String nodeName)
          create a node by name
static boolean scriptFileParsed(com.trapezium.vrml.node.Node n)
           
static int typeStrToInt(java.lang.String typeStr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UnknownInterfaceType

public static int UnknownInterfaceType
found an interface type that isn't field, exposedField, eventIn, or eventOut


field

public static int field
field interface constant


exposedField

public static int exposedField
exposedField interface constant


eventIn

public static int eventIn
eventIn interface constant


eventOut

public static int eventOut
eventOut interface constant


UnknownType

public static int UnknownType
Constants representing built int field types


SFBool

public static int SFBool
Built in VRML97 data type


SFColor

public static int SFColor
Built in VRML97 data type


MFColor

public static int MFColor
Built in VRML97 data type


SFFloat

public static int SFFloat
Built in VRML97 data type


MFFloat

public static int MFFloat
Built in VRML97 data type


SFImage

public static int SFImage
Built in VRML97 data type


SFInt32

public static int SFInt32
Built in VRML97 data type


MFInt32

public static int MFInt32
Built in VRML97 data type


SFNode

public static int SFNode
Built in VRML97 data type


MFNode

public static int MFNode
Built in VRML97 data type


SFRotation

public static int SFRotation
Built in VRML97 data type


MFRotation

public static int MFRotation
Built in VRML97 data type


SFString

public static int SFString
Built in VRML97 data type


MFString

public static int MFString
Built in VRML97 data type


SFTime

public static int SFTime
Built in VRML97 data type


MFTime

public static int MFTime
Built in VRML97 data type


SFVec2f

public static int SFVec2f
Built in VRML97 data type


MFVec2f

public static int MFVec2f
Built in VRML97 data type


SFVec3f

public static int SFVec3f
Built in VRML97 data type


MFVec3f

public static int MFVec3f
Built in VRML97 data type


PositiveSFVec3f

public static int PositiveSFVec3f
Vorlon data type indicating SFVec3f with only positive values


BboxSizeSFVec3f

public static int BboxSizeSFVec3f
Vorlon data type indicating bboxSize conventions, all positive or all -1


bgUrlFields

static java.lang.String[] bgUrlFields

nodesWithUrls

static java.util.Hashtable nodesWithUrls

anchorFields

static java.util.Hashtable anchorFields

appearanceFields

static java.util.Hashtable appearanceFields

audioClipFields

static java.util.Hashtable audioClipFields

backgroundFields

static java.util.Hashtable backgroundFields

billboardFields

static java.util.Hashtable billboardFields

boxFields

static java.util.Hashtable boxFields

collisionFields

static java.util.Hashtable collisionFields

colorFields

static java.util.Hashtable colorFields

colorInterpolatorFields

static java.util.Hashtable colorInterpolatorFields

coneFields

static java.util.Hashtable coneFields

coordinateFields

static java.util.Hashtable coordinateFields

coordinateInterpolatorFields

static java.util.Hashtable coordinateInterpolatorFields

cylinderFields

static java.util.Hashtable cylinderFields

cylinderSensorFields

static java.util.Hashtable cylinderSensorFields

directionalLightFields

static java.util.Hashtable directionalLightFields

elevationGridFields

static java.util.Hashtable elevationGridFields

extrusionFields

static java.util.Hashtable extrusionFields

fogFields

static java.util.Hashtable fogFields

fontStyleFields

static java.util.Hashtable fontStyleFields

groupFields

static java.util.Hashtable groupFields

imageTextureFields

static java.util.Hashtable imageTextureFields

indexedFaceSetFields

static java.util.Hashtable indexedFaceSetFields

indexedLineSetFields

static java.util.Hashtable indexedLineSetFields

inlineFields

static java.util.Hashtable inlineFields

LODFields

static java.util.Hashtable LODFields

materialFields

static java.util.Hashtable materialFields

movieTextureFields

static java.util.Hashtable movieTextureFields

navigationInfoFields

static java.util.Hashtable navigationInfoFields

normalFields

static java.util.Hashtable normalFields

normalInterpolatorFields

static java.util.Hashtable normalInterpolatorFields

orientationInterpolatorFields

static java.util.Hashtable orientationInterpolatorFields

pixelTextureFields

static java.util.Hashtable pixelTextureFields

planeSensorFields

static java.util.Hashtable planeSensorFields

pointLightFields

static java.util.Hashtable pointLightFields

pointSetFields

static java.util.Hashtable pointSetFields

positionInterpolatorFields

static java.util.Hashtable positionInterpolatorFields

proximitySensorFields

static java.util.Hashtable proximitySensorFields

scalarInterpolatorFields

static java.util.Hashtable scalarInterpolatorFields

scriptFields

static java.util.Hashtable scriptFields

shapeFields

static java.util.Hashtable shapeFields

soundFields

static java.util.Hashtable soundFields

sphereFields

static java.util.Hashtable sphereFields

sphereSensorFields

static java.util.Hashtable sphereSensorFields

spotLightFields

static java.util.Hashtable spotLightFields

switchFields

static java.util.Hashtable switchFields

textFields

static java.util.Hashtable textFields

textureCoordinateFields

static java.util.Hashtable textureCoordinateFields

textureTransformFields

static java.util.Hashtable textureTransformFields

timeSensorFields

static java.util.Hashtable timeSensorFields

touchSensorFields

static java.util.Hashtable touchSensorFields

transformFields

static java.util.Hashtable transformFields

viewpointFields

static java.util.Hashtable viewpointFields

visibilitySensorFields

static java.util.Hashtable visibilitySensorFields

worldInfoFields

static java.util.Hashtable worldInfoFields

nurbsSurfaceFields

static java.util.Hashtable nurbsSurfaceFields

nurbsGroupFields

static java.util.Hashtable nurbsGroupFields

nurbsTextureSurfaceFields

static java.util.Hashtable nurbsTextureSurfaceFields

nurbsCurve2DFields

static java.util.Hashtable nurbsCurve2DFields

trimmedSurfaceFields

static java.util.Hashtable trimmedSurfaceFields

nurbsPositionInterpolatorFields

static java.util.Hashtable nurbsPositionInterpolatorFields

coordinateDeformerFields

static java.util.Hashtable coordinateDeformerFields

builtInNodes

static java.util.Hashtable builtInNodes

nurbsAreEnabled

static boolean nurbsAreEnabled

builtInTypes

public static java.util.Hashtable builtInTypes

actualTypesByField

static java.util.Hashtable actualTypesByField
Some fields are only allowed to contain specific types.

Constructor Detail

VRML97

public VRML97()
Method Detail

getInterfaceTypeStr

public static java.lang.String getInterfaceTypeStr(int itype)
Convert an interface type constant into a String


getFieldTypeString

public static java.lang.String getFieldTypeString(int fieldType)
Convert a field data type constant into its corresponding String.


getUrlFieldList

public static java.lang.Object getUrlFieldList(java.lang.String nodeName)

enableNurbs

public static void enableNurbs()

disableNurbs

public static void disableNurbs()

isNurbsEnabled

public static boolean isNurbsEnabled()

typeStrToInt

public static int typeStrToInt(java.lang.String typeStr)

fieldHasType

public static boolean fieldHasType(java.lang.String node,
                                   java.lang.String field,
                                   com.trapezium.util.ReturnInteger result)
Does a field restrict its values to a specific type?


NodeFactory

public static com.trapezium.vrml.node.Node NodeFactory(java.lang.String nodeName)
                                                throws java.lang.InstantiationException,
                                                       java.lang.IllegalAccessException,
                                                       java.lang.ClassNotFoundException,
                                                       java.lang.IllegalArgumentException
create a node by name


isBuiltInNode

public static boolean isBuiltInNode(java.lang.String nodeName)
is the node part of the VRML97 spec?


isBuiltInType

public static boolean isBuiltInType(java.lang.String typeName)
is the type part of the VRML97 spec?


isValidFieldId

public static boolean isValidFieldId(java.lang.String nodeName,
                                     java.lang.String fieldId)
Is the node & field combination valid?


getFieldType

public static int getFieldType(java.lang.String nodeName,
                               java.lang.String fieldId)
Get the field data type constant associated with a node & field.


getFieldTypeString

public static java.lang.String getFieldTypeString(java.lang.String nodeName,
                                                  java.lang.String fieldId)
Get the field type string for a node and field


getInterfaceType

public static int getInterfaceType(java.lang.String nodeName,
                                   java.lang.String fieldId)
Get the interface type constant for a node and field.


getDefaultBoolValue

public static boolean getDefaultBoolValue(java.lang.String nodeName,
                                          java.lang.String fieldId)
Get the default boolean value for a node and field.


getFieldDescriptor

public static FieldDescriptor getFieldDescriptor(java.lang.String nodeName,
                                                 java.lang.String fieldId)
get the FieldDescriptor associated with a node and field id


getFieldTable

public static java.util.Hashtable getFieldTable(java.lang.String nodeName)
Get a Hashtable with a FieldDescriptor entry for each field for a node


fieldIsDefault

public static boolean fieldIsDefault(java.lang.String nodeName,
                                     java.lang.String fieldId,
                                     int firstTokenOffset,
                                     int lastTokenOffset,
                                     com.trapezium.parse.TokenEnumerator v)
Is a field value equivalent to the default field value?


getClosestNode

public static java.lang.String getClosestNode(java.lang.String nodeType,
                                              com.trapezium.util.ReturnInteger matchScore)
get the node String that most closely matches the unknown node string


getClosestType

public static java.lang.String getClosestType(java.lang.String fieldType,
                                              com.trapezium.util.ReturnInteger matchScore)
get the fieldType String that most closely matches the unknown field type string


getClosestFieldId

public static java.lang.String getClosestFieldId(java.lang.String nodeName,
                                                 java.lang.String fieldId,
                                                 com.trapezium.util.ReturnInteger matchScore)
get the field id String that most closely mathces the unknown field type id


getClosestMatch

public static java.lang.String getClosestMatch(java.lang.String fieldId,
                                               java.util.Hashtable hash,
                                               com.trapezium.util.ReturnInteger matchScore)
get the field id String that most closely matches the unknown field id.


hasLetters

public static boolean hasLetters(java.lang.String s)

addFunction

public static void addFunction(java.lang.String s,
                               com.trapezium.vrml.node.Node parent)
Add a ScriptFunction child to a Node. This is used during processing of the embedded quoted string in a Javascript url, or an inline ".js" url. It can be much improved, at the moment, it only locates the name of the function. May find more than one function on javascript line


scriptFileParsed

public static boolean scriptFileParsed(com.trapezium.vrml.node.Node n)

checkScript

public static void checkScript(com.trapezium.vrml.node.Node n,
                               com.trapezium.vrml.ROUTE r,
                               com.trapezium.vrml.RouteDestination rd,
                               com.trapezium.parse.TokenEnumerator v)

checkISFieldTypes

static void checkISFieldTypes(com.trapezium.vrml.fields.ISField isField,
                              com.trapezium.vrml.node.Node parentNode)

convertToVRML97

public static java.lang.String convertToVRML97(java.lang.String s)
Convert a Vorlon type into VRML97 type. This convention is used specify field type value restrictions that are indicated in the text of the VRML97 specification, but not in the data type of fields. For example, a Transform "scale" value is restricted to positive values, but its data type is SFVec3f. Vorlon defines the type as a PositiveSFVec3f to implement this restriction.