Class X3DExecutionContext
java.lang.Object
org.web3d.vrml.scripting.ecmascript.builtin.AbstractScriptableObject
org.web3d.vrml.scripting.ecmascript.x3d.X3DExecutionContext
- All Implemented Interfaces:
org.mozilla.javascript.Scriptable
- Direct Known Subclasses:
Scene
X3DExecutionContext prototype object.
- Version:
- $Revision: 1.22 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ComponentInfoArray
The list of components in useprotected final String
The encoding type constantprotected org.j3d.util.ErrorReporter
Class that represents the external reporterprotected VRMLExecutionSpace
The execution space that this context works inprotected ExternProtoDeclarationArray
The list of extern protos declaredprotected static final org.j3d.util.HashSet
<String> Set of the valid function names for this objectmap containing imports infoListing of all the valid X3DNode wrappers.protected Map
<VRMLNodeType, SFNode> Mapping of the VRMLNodeType to its X3DNode wrapperprotected final ProfileInfo
The list of profiles in useprotected static final org.j3d.util.HashSet
<String> Set of the valid property names for this objectprotected ProtoDeclarationArray
The array of protos declaredprotected MFNode
Listing of root nodesprotected RouteManager
Route manager for handling user added/removed routesprotected BasicScene
The basic scene typeprotected boolean
Flag to indicate part of the scene infrastructure has changedprotected final String
The version of the specification representedprotected FrameStateManager
FrameState manager for creating nodesprotected final String
The world URLFields inherited from class org.web3d.vrml.scripting.ecmascript.builtin.AbstractScriptableObject
BAD_FORMAT_MSG, dataChanged, INVALID_TYPE_MSG, JS_FUNCTION_PREFIX, readOnly, READONLY_MSG
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorsConstructorDescriptionX3DExecutionContext
(VRMLExecutionSpace space, RouteManager rm, FrameStateManager fsm, ProfileInfo profile) Construct an execution context descriptor for the given information. -
Method Summary
Modifier and TypeMethodDescriptionGet the value of the named function.Get the list of fields that have changed.boolean
Check for the named property presence.jsFunction_addRoute
(org.mozilla.javascript.Scriptable fn, String fromField, org.mozilla.javascript.Scriptable tn, String toField) addRoute() function defined by From table 6.6.jsFunction_createNode
(String name) createNode() function defined by From table 6.6.jsFunction_createProto
(String name) createProto() function defined by From table 6.6.void
jsFunction_deleteRoute
(org.mozilla.javascript.Scriptable r) deleteRoute() function defined by From table 6.6jsFunction_getImportedNode
(String defName, String asName) getImportedNode() function defined by From table 7.8.getNamedNode() function defined by From table 6.6.void
getImportedNode() function defined by From table 7.8.void
removeNamedNode() function defined by From table 6.6.void
jsFunction_updateImportedNode
(String name, String newName) updateImportedNode() function defined by From table 7.8.void
jsFunction_updateNamedNode
(String name, org.mozilla.javascript.Scriptable node) updateNamedNode() function defined by From table 6.6.protected org.mozilla.javascript.FunctionObject
locateFunction
(String methodName) Convenience method to locate a function name for this object and create an appropriate Function instance to represent it.void
Sets the named property with a new value.protected void
registerFunction
(String name, Object value) Register a function object with this field typevoid
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the script code can be reported in a nice, pretty fashion.Methods inherited from class org.web3d.vrml.scripting.ecmascript.builtin.AbstractScriptableObject
delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, hasInstance, put, setParentScope, setPrototype, setReadOnly
-
Field Details
-
propertyNames
Set of the valid property names for this object -
functionNames
Set of the valid function names for this object -
specVersion
The version of the specification represented -
encoding
The encoding type constant -
profile
The list of profiles in use -
components
The list of components in use -
errorReporter
protected org.j3d.util.ErrorReporter errorReporterClass that represents the external reporter -
url
The world URL -
rootNodes
Listing of root nodes -
protos
The array of protos declared -
externprotos
The list of extern protos declared -
executionSpace
The execution space that this context works in -
scene
The basic scene type -
routeManager
Route manager for handling user added/removed routes -
stateManager
FrameState manager for creating nodes -
nodeWrapperList
-
nodeWrapperMap
Mapping of the VRMLNodeType to its X3DNode wrapper -
importMap
-
sceneChanged
protected boolean sceneChangedFlag to indicate part of the scene infrastructure has changed
-
-
Constructor Details
-
X3DExecutionContext
public X3DExecutionContext(VRMLExecutionSpace space, RouteManager rm, FrameStateManager fsm, ProfileInfo profile) Construct an execution context descriptor for the given information.- Parameters:
space
- The space to source information for this scenerm
- A route manager for users creating/removing routesfsm
-profile
- Instance of the ProfileInfo that describes this scene
-
-
Method Details
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old. Also changes the ErrorReporter used by the CommonBrowser instance.- Parameters:
reporter
- The instance to use or null
-
has
Check for the named property presence.- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classAbstractScriptableObject
- Parameters:
name
- name of the scriptstart
- the script corresponding to the given name- Returns:
- true if it is a defined eventOut or field
-
get
Get the value of the named function. If no function object is registered for this name, the method will return null.- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classAbstractScriptableObject
- Parameters:
name
- The variable namestart
- The object where the lookup began- Returns:
- the corresponding function object or null
-
put
Sets the named property with a new value. A put usually means changing the entire property. So, if the property has changed using an operation likee = new SFColor(0, 1, 0);
then a whole new object is passed to us.- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classAbstractScriptableObject
- Parameters:
name
- The name of the property to definestart
- The object who's property is being setvalue
- The value being requested
-
jsFunction_addRoute
-
jsFunction_deleteRoute
public void jsFunction_deleteRoute(org.mozilla.javascript.Scriptable r) deleteRoute() function defined by From table 6.6- Parameters:
r
-
-
jsFunction_createNode
-
jsFunction_createProto
-
jsFunction_getNamedNode
-
jsFunction_updateNamedNode
updateNamedNode() function defined by From table 6.6.- Parameters:
name
-node
-
-
jsFunction_removeNamedNode
removeNamedNode() function defined by From table 6.6.- Parameters:
name
-
-
jsFunction_getImportedNode
-
jsFunction_updateImportedNode
-
jsFunction_removeImportedNode
getImportedNode() function defined by From table 7.8.- Parameters:
name
-
-
getChangedData
Get the list of fields that have changed. The return value may be either a singleNodeFieldData
instance or anArrayList
of field data instances if more than one has changed. When called, this is recursive so that all fields and nodes referenced by this node field will be included. If no fields have changed, this will return null. However, that should never happen as the user should always checkFieldScriptableObject.hasChanged()
which would return false before calling this method.- Returns:
- A single
NodeFieldData
,ArrayList
or null
-
registerFunction
-
locateFunction
Convenience method to locate a function name for this object and create an appropriate Function instance to represent it. It assumes that the name you give it is the normal name and will add a "jsFunction_" prefix to locate that from the method details. There is also the implicit assumption that you have made a check for this name being a valid function for this object before you call this method. If a function object is found for this method, it will automatically be registered and you can also have a copy of it returned to use.- Parameters:
methodName
- The real method name to look for- Returns:
- The function object corresponding to the munged method name
-