|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vrml.BaseNode vrml.node.Script
public abstract class Script
This is the general Script class, to be subclassed by all scripts. Note that the provided methods allow the script author to explicitly throw tailored exceptions in case something goes wrong in the script.
Constructor Summary | |
---|---|
Script()
|
Method Summary | |
---|---|
void |
eventsProcessed()
eventsProcessed() is called after every invocation of processEvents(). |
protected Field |
getEventIn(java.lang.String eventInName)
Get an EventIn by name. |
protected Field |
getEventOut(java.lang.String eventOutName)
Get an EventOut by name. |
protected Field |
getField(java.lang.String fieldName)
Get a Field by name. |
void |
initialize()
The initialize() method is called before any event is generated. |
void |
processEvent(Event event)
processEvent() is called automatically when the script receives an event. |
void |
processEvents(int count,
Event[] events)
processEvents() is called automatically when the script receives some set of events. |
void |
shutdown()
shutdown() is called when this Script node is deleted. |
java.lang.String |
toString()
toString() overrides a utility method in Object, allowing run-time inspection of class name. |
Methods inherited from class vrml.BaseNode |
---|
getBrowser, getType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Script()
Method Detail |
---|
public void initialize()
The initialize() method is called before any event is generated.
Authors may define an initialize() method within the Script class that is called before the browser presents the world to the user and before any events are processed by any nodes in the same VRML file as the Script node containing this script (see 4.12.3, Initialize() and shutdown()). The various methods of the Script class such as getEventIn(), getEventOut(), getExposedField(), and getField() are not guaranteed to return correct values before the initialize() method has been executed. The initialize() method is called once during the life of the Script object.
Reference: http://www.web3D.org/technicalinfo/specifications/vrml97/part1/java.html#B.4.6
Its default behaviour is no operation. See Example2.java in http://www.web3D.org/technicalinfo/specifications/vrml97/part1/java.html#B.5.1 for an example of a user-specified initialize() method.
protected final Field getField(java.lang.String fieldName)
InvalidFieldException
- if fieldName isn't a valid field name for a node of this type.protected final Field getEventOut(java.lang.String eventOutName)
protected final Field getEventIn(java.lang.String eventInName)
public void processEvents(int count, Event[] events)
count
- indicates the number of events delivered.events
- provides the event(s) ROUTEd to the script.public void processEvent(Event event)
event
- provides the event ROUTEd to the script.public void eventsProcessed()
public void shutdown()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |