Package org.web3d.vrml.scripting
Interface ScriptWrapper
- All Known Implementing Classes:
JavaSAIScriptWrapper
,VRML97ScriptWrapper
public interface ScriptWrapper
A wrapper abstract interface used to convert between the Xj3D
implementation specific details and the spec requirements for a script.
- Version:
- $Revision: 1.5 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Notification that the eventsProcessed() functionality should be called on the script code now.void
initialize
(VRMLScriptNodeType node) Initialise the underlying script, based on the surrounding node's details.boolean
Call the prepareEvents() method on the script, if it has one.void
queueEvent
(int type, String name, boolean value) Queue a changed SFBool event value ready for processing by the script.void
queueEvent
(int type, String name, boolean[] value, int numValid) Queue a changed MFBool event value ready for processing by the script.void
queueEvent
(int type, String name, double value) Queue a changed SFTime or SFDouble event value ready for processing by the script.void
queueEvent
(int type, String name, double[] value, int numValid) Queue a changed MFTime or MFDouble event value ready for processing by the script.void
queueEvent
(int type, String name, float value) Queue a changed SFFloat event value ready for processing by the script.void
queueEvent
(int type, String name, float[] value, int numValid) Queue a changed event value ready for processing by the script.void
queueEvent
(int type, String name, int value) Queue a changed SFInt32 event value ready for processing by the script.void
queueEvent
(int type, String name, int[] value, int numValid) Queue a changed MFInt32 event value ready for processing by the script.void
queueEvent
(int type, String name, long value) Queue a changed SFLong event value ready for processing by the script.void
queueEvent
(int type, String name, long[] value, int numValid) Queue a changed MFLong event value ready for processing by the script.void
queueEvent
(int type, String name, String value) Queue a changed SFString event value ready for processing by the script.void
queueEvent
(int type, String name, String[] value, int numValid) Queue a changed MFString event value ready for processing by the script.void
queueEvent
(int type, String name, VRMLNodeType value) Queue a changed SFNode event value ready for processing by the script.void
queueEvent
(int type, String name, VRMLNodeType[] value, int numValid) Queue a changed MFNode event value ready for processing by the script.boolean
Send the events to the real script now.void
setTimestamp
(double time) Set the timestamp that we shall start the next queue with.void
shutdown()
Called when the Script node is deleted.void
Process the eventOuts of the script now.
-
Method Details
-
initialize
Initialise the underlying script, based on the surrounding node's details.- Parameters:
node
- The implementation node describing the script
-
setTimestamp
void setTimestamp(double time) Set the timestamp that we shall start the next queue with.- Parameters:
time
- The timestamp to use (in seconds)
-
prepareEvents
boolean prepareEvents()Call the prepareEvents() method on the script, if it has one. If it does not, this becomes a no-op. Return true if something executed and therefore we need to check on further events being sent.- Returns:
- true if something executed
-
queueEvent
Queue a changed SFInt32 event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the field
-
queueEvent
Queue a changed MFInt32 event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
queueEvent
Queue a changed SFLong event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the field
-
queueEvent
Queue a changed MFLong event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
queueEvent
Queue a changed SFBool event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the field
-
queueEvent
Queue a changed MFBool event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
queueEvent
Queue a changed SFFloat event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the field
-
queueEvent
Queue a changed event value ready for processing by the script. Used to set SFColor, SFRotation, SFVec2f, SFVec3f or MFFloat fields- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
queueEvent
Queue a changed SFTime or SFDouble event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the field
-
queueEvent
Queue a changed MFTime or MFDouble event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
queueEvent
-
queueEvent
Queue a changed MFString event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
queueEvent
Queue a changed SFNode event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the field
-
queueEvent
Queue a changed MFNode event value ready for processing by the script.- Parameters:
type
- The type of field to processname
- The field name to processvalue
- The new value of the fieldnumValid
- The number of valid values to copy from the array
-
sendEvents
boolean sendEvents()Send the events to the real script now. The return value indicates if any eventOuts of the script have changed. It is assumed that in this period the directOutputs have changed (if the flag is set), but eventOuts are not processed.- Returns:
- true One or more output events nee to be sent
-
updateEventOuts
void updateEventOuts()Process the eventOuts of the script now. It should do that by calling setValue() on the script node instance passed in as part of the the initialize() method. -
eventsProcessed
void eventsProcessed()Notification that the eventsProcessed() functionality should be called on the script code now. -
shutdown
void shutdown()Called when the Script node is deleted. We free everything here to allow the GC to do its magic.
-