home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Examples / vrml / Script.java < prev    next >
Encoding:
Java Source  |  2001-06-19  |  1.0 KB  |  34 lines

  1. package vrml;
  2.  
  3. import vrml.Events;
  4. import vrml.Node;
  5. import vrml.Field;
  6. import vrml.fields.*;
  7. import vrml.exceptions.*;
  8.  
  9. //
  10. // This is the general Script class, to be subclassed by all scripts.
  11. // Note that the provided methods allow the script author to explicitly
  12. // throw tailored exceptions in case something goes wrong in the
  13. // script; thus, the exception codes for those exceptions are to be
  14. // determined by the script author.
  15. //
  16.  
  17. public abstract class Script implements Node {
  18.   public native void processEvents(Events [] events)
  19.     throws Exception; 
  20.   public abstract void eventsProcessed()
  21.     throws Exception; // Script:code is up to script author
  22.  
  23.   protected native Field getEventOut(String eventName)
  24.     throws InvalidEventOutException;
  25.   protected native Field getField(String fieldName)
  26.     throws InvalidFieldException;
  27.  
  28.   public native ConstField getValue(String fieldName)
  29.     throws InvalidFieldException;
  30.   public native void postEventIn(String eventName, Field eventValue)
  31.     throws InvalidEventInException;
  32.  
  33. }
  34.