The Moving Worlds VRML 2.0 Specification

Java Reference

Draft 3, July 8, 1996

This appendix describes the Java classes and methods that allow scripts to interact with associated scenes. It contains links to various Java pages as well as to certain sections of the Moving Worlds VRML 2.0 Specification (including the general description of scripting and the API).

The Reference includes the following sections:



Language

Java(TM) is a portable, interpreted, object-oriented programming language developed at Sun Microsystems. It's likely to be the most common language supported by VRML browsers in Script nodes. A full description of Java is far beyond the scope of this appendix; see the Java web site for more information. This appendix describes only the Java bindings of the VRML API (the calls that allow the script in a VRML Script node to interact with the scene in the VRML file).

Implementing this API in VRML browsers and following examples in .wrl source files enables VRML world scenes to be animated by Java code.

Supported Protocol in the Script Node's url field

The url field of the Script node contains the URL of a file containing the Java byte code("http://foo.co.jp/Example.class").

File Extension

The file extension for Java byte code is .class.

MIME type

The MIME type for Java byte code is defined as follows:

        application/octet-stream




EventIn Handling

Events to the Script node are passed to the corresponding Java method in the script. It is necessary to specify the script in the url field of the Script node.

If a Java byte code or source code file is specified in the url field, the following two conditions must hold:

Additionally a method must be defined which meets the following the three conditions:

If there isn't a corresponding Java method in the script, a browser's behavior is unspecified.

For example, the following Script node has one eventIn field whose name is 'start'.

    Script { 
           url "Example.class"
           eventIn SFBool start
    }

This node points to the script file 'Example.class'. Its source('Example.java') looks like this:

    import vrml;
    class Example extends Script {
        ...
        public void start (ConstSFBool eventIn_value, ConstSFTime timestamp) {
            // ... perform some operation ...
        }
    }


In the above example, when the start eventIn is sent the start() method is executed.

Parameter passing and the EventIn Field/Method

When a Script node receives an eventIn. A corresponding method in the file specified in url field of the Script node is called, which has two arguments. The value of the eventIn is passed to the first argument and timestamp of the eventIn is passed to the second argument of the called method.

Suppose that the eventIn type is SFXXX and eventIn name is eventInYYY, then the method prototype should be

    public void eventInYYY(ConstSFXXX eventIn_value, ConstSFTime timestamp)

Arbitrary names can be used for the arguments.

If the prototype of the method is incorrect, the browser's behavior is unspecified. The recommended behavior is that the browser should warn the incompatibility of the prototype and then stop loading.

In the above example this would be an SFBool type. Also, the time each eventIn was received is available as an SFTime value. These are passed as parameters to the Java method:

    public void start (ConstSFBool eventIn_value, ConstSFTime timestamp)

EventsProcessed method

Authors can define an eventsProcessed method within a class that is called after some set of events has been received. It allows Scripts that do not rely on the order of events received to generate fewer events than an equivalent Script that generates events whenever events are received. If it is used in some other way, eventsProcessed can be nondeterministic, since different implementations may call eventsProcessed at different times.

Events generated from an eventsProcessed routine are given the timestamp of the last event processed.

The prototype of eventsProcessed method is

    public void eventsProcessed()
        throws Exception;

Shutdown method

Authors can define a shutdown method within a class that is called when the corresponding Script node is deleted. Its default behavior is no operation.


Accessing Fields

The fields, eventIns and eventOuts of a Script node are accessible from its corresponding Java class.

Accessing Fields and EventOuts of the Script

Fields defined in the Script node are available to the script by using its name. Its value can be read or written. This value is persistent across function calls. EventOuts defined in the script node can also be read.

To access fields of Script node can be done by using Script class methods. Script class has two methods to do that: getField() and getEventOut().

The Java Field class and its subclasses have several methods to get and set values: getValue(), setValue() or set1Value().

When you call setValue() or set1Value() methods on a 'field' object obtained by getField() method, the value specified as an argument is stored in the corresponding VRML node's field.

When you call setValue() or set1Value() methods on a 'field' object obtained by getEventOut() method, the value specified as an argument generates an event in VRML scene. The effect of this event is as specified by the associated Route in the VRML scene.

Example:

    Script {
        url "Example.class"
        eventIn   SFBool start
        eventOut  SFBool on
        field SFBool state TRUE
    }

    import vrml;
    class Example extends Script {
        private SFBool state = (SFBool) getField("state");
        private SFBool on = (SFBool) getEventOut("on");

        public void start (ConstSFBool eventIn_value, ConstSFTime timestamp) {
            if(state.getValue()==true){
                on.setValue(true); // set true to eventOut 'on'
                state.setValue(false);
            } else {
                on.setValue(false); // set false to eventOut 'on'
                state.setValue(true);
            }
        }
    }



Accessing Fields and EventOuts of Other Nodes

If a script program has an access to a previously DEF'ed VRML node, any field or eventOut of that node is accessible by using the getValue() method defined on the node's class (see Exposed Classes and Methods for Nodes and Fields).

The typical way for a script program to have an access to another VRML node is to have an SFNode field which provides a reference to the other DEF'ed node. The following example shows how this is done.

    DEF SomeNode Transform { }
    Script {
         field SFNode node USE SomeNode
         eventIn SFVec3f pos
         url "Example.class"
    }

    import vrml;
    class Example extends Script {
        private SFNode node = (SFNode) getField("node");
        private SFVec3 trans;

        public void pos (ConstSFVec3 vec, ConstSFTime timestamp){
		// gets the reference to the 'translation' field of Transfrom node
                trans = (SFVec3)(node.getValue()).getValue("translation");
                trans.setValue(vec.getValue());
        }
    }



Sending EventOuts

Sending eventouts is done by setting value to the reference to the 'eventOut' by setValue() or set1Value() method.


Exposed Classes and Methods for Nodes and Fields

Java classes for VRML are defined in the package vrml.

The Field class extends Java's Object class by default; thus, Field has the full functionality of the Object class, including the getClass() method. The rest of the package defines a "Const" read-only class for each VRML field type, with a getValue() method for each class; and another read/write class for each VRML field type, with both getValue() and setValue() methods for each class. A getValue() method converts a VRML-type value into a Java-type value. A setValue() method converts a Java-type value into a VRML-type value and sets it to the VRML field.

Most of the setValue() methods and set1Value() methods are listed as "throws exception," meaning that errors are possible -- you may need to write exception handlers (using Java's catch() method) when you use those methods. Any method not listed as "throws exception" is guaranteed to generate no exceptions. Each method that throws an exception is followed by a comment indicating what type of exception will be thrown.

Field Class

All VRML data types have an equivalent classes in Java. The 'Field' class is the root class of all field classes.

    class Field {
    }

Field classes have two class types: read-only(constant)classes and writeable classes for each field types.

See 'vrml package' for each classes' methods definition.

Browser class

This section lists the public Java interfaces to the Browser class, which allows scripts to get and set browser information. For descriptions of the methods, see the "Browser Interface" section of the "Scripting" section of the spec.

Return value Method name
String getName()
String getVersion()
float getCurrentSpeed()
float getCurrentFrameRate()
String getWorldURL()
void loadWorld(String [] url)
void replaceWorld(Node[] nodes)
Node createVrmlFromString(String vrmlSyntax)
Node createVrmlFromURL(String[] url, Node node, String event)
String getNavigationType()
void setNavigationType(String type)
float getNavigationSpeed()
void setNavigationSpeed(float speed)
float getNavigationScale()
void setNavigationScale(float scale)
boolean getHeadlight()
void setHeadlight(boolean onOff)
String getWorldTitle()
void setWorldTitle(String title)
void addRoute(Node fromNode, String fromEventOut, Node toNode, String toEventIn)
void deleteRoute(Node fromNode, String fromEventOut, Node toNode, String toEventIn)

See 'vrml package' for each methods definition.

Conversion table from the types used in browser class to Java type.
VRML type Java type
SFString String
SFFloat float
MSString String[]
MFNode Node[]


User-defined classes and packages

The Java classes defined by a user can be used in the Java program. They are searched from the directory where the Java program is placed.

If the Java class is in a package, this package is searched for with the relative path from the URL the world was loaded from.


Exceptions

Java methods may generate the following exceptions:

If exceptions are not redefined by authors, a browser's behavior is unspecified.

See 'Example of exception class' section.


Example

Here's an example of a Script node which determines whether a given color contains a lot of red. The Script node exposes a color field, an eventIn, and an eventOut:

Script {
  field    SFColor currentColor 0 0 0
  eventIn  SFColor colorIn
  eventOut SFBool  isRed

  url "ExampleScript.class"
}

And here's the source code for the "ExampleScript.java" file that gets called every time an eventIn is routed to the above Script node:

import vrml;

class ExampleScript extends Script {

  // Declare field(s)
  private SFColor currentColor = (SFColor) getField("currentColor");

  // Declare eventOut field(s)
  private SFBool isRed = (SFBool) getEventOut("isRed");

  public void colorIn(ConstSFColor newColor, ConstSFTime ts) {
    // This method is called when a colorIn event is received
    currentColor.setValue(newColor.getValue());
  }

  public void eventsProcessed() {
    if (currentColor.getValue()[0] >= 0.5) // if red is at or above 50%
      isRed.setValue(TRUE);
  }
}

For details on when the methods defined in ExampleScript are called, see the "Execution Model" section of the "Concepts" document.

Browser class example


Class definitions

The vrml package class hierarchy looks like this:
vrml package 
     |
     +- Field -+- ConstSFBool
     |         +- ConstSFColor
     |         +- ConstMFColor
     |         +- ConstSFFloat
     |         +- ConstMFFloat
     |         +- ConstSFImage
     |         +- ConstSFInt32
     |         +- ConstMFInt32
     |         +- ConstSFNode
     |         +- ConstMFNode
     |         +- ConstSFRotation
     |         +- ConstMFRotation
     |         +- ConstSFString
     |         +- ConstMFString
     |         +- ConstSFVec2f
     |         +- ConstMFVec2f
     |         +- ConstSFVec3f
     |         +- ConstMFVec3f
     |         +- ConstSFTime
     |         |
     |         +- SFBool
     |         +- SFColor
     |         +- MFColor
     |         +- SFFloat
     |         +- MFFloat
     |         +- SFImage
     |         +- SFInt32
     |         +- MFInt32
     |         +- SFNode
     |         +- MFNode
     |         +- SFRotation
     |         +- MFRotation
     |         +- SFString
     |         +- MFString
     |         +- SFVec2f
     |         +- MFVec2f
     |         +- SFVec3f
     |         +- MFVec3f
     |         +- SFTime 
     +- Browser
     +- Node(interface) -+- Script
			 +- Anchor
			 +- Billboard
			 +- Collision
			 +- Group
			 +- Inline
			 +- LOD
			 +- Switch
			 +- Transform
			 |
			 +- DirectionalLight
			 +- Fog
			 +- PointLight
			 +- Shape
			 +- Sound
			 +- SpotLight
			 |
			 +- CylinderSensor
			 +- PlaneSensor
			 +- ProximitySensor
			 +- SphereSensor
			 +- TimeSensor
			 +- TouchSensor
			 +- VisibilitySensor
			 +- Background
			 +- NavigationInfo
			 +- Viewpoint
			 |
			 +- Box
			 +- Cone
			 +- Cylinder
			 +- ElevationGrid
			 +- Extrusion
			 |
			 +- Color
			 +- Coordinate
			 +- Normal
			 +- TextureCoordinate
			 +- IndexedFaceSet
			 +- IndexedLineSet
			 +- PointSet
			 +- Sphere
			 +- Text
			 |
			 +- Appearance
			 +- FontStyle
			 +- ImageTexture
			 +- Material
			 +- MovieTexture
			 +- PixelTexture
			 +- TextureTransform
			 |
			 +- ColorInterpolator
			 +- CoordinateInterpolator
			 +- NormalInterpolator
			 +- OrientationInterpolator
			 +- PositionInterpolator
			 +- ScalarInterpolator
			 |
			 +- WorldInfo
			 |
			 +- AudioClip

vrml package

package vrml;

public class Field {
}

//
// Read-only (constant) classes, one for each field type:
//

public class ConstSFBool extends Field {
  public boolean getValue();
}

public class ConstSFColor extends Field {
  public float[] getValue();
}

public class ConstMFColor extends Field {
  public float[][] getValue();
}

public class ConstSFFloat extends Field {
  public float getValue();
}

public class ConstMFFloat extends Field {
  public float[] getValue();
}

public class ConstSFImage extends Field {
  public byte[] getValue(int[] dims);
}

public class ConstSFInt32 extends Field {
  public int getValue();
}

public class ConstMFInt32 extends Field {
  public int[] getValue();
}

public class ConstSFNode extends Field {
  public Node getValue();
}

public class ConstMFNode extends Field {
  public Node[] getValue();
}

public class ConstSFRotation extends Field {
  public float[] getValue();
}

public class ConstMFRotation extends Field {
  public float[][] getValue();
}

public class ConstSFString extends Field {
  public String getValue();
}

public class ConstMFString extends Field {
  public String[] getValue();
}

public class ConstSFVec2f extends Field {
  public float[] getValue();
}

public class ConstMFVec2f extends Field {
  public float[][] getValue();
}

public class ConstSFVec3f extends Field {
  public float[] getValue();
}

public class ConstMFVec3f extends Field {
  public float[][] getValue();
}

public class ConstSFTime extends Field {
  public double getValue();
}

//
// And now the writeable versions of the above classes:
//

public class SFBool extends Field {
  public boolean getValue();
  public void setValue(boolean value);
}

public class SFColor extends Field {
  public float[] getValue();
  public void setValue(float[] value)
    throws ArrayIndexOutOfBoundsException;
}

public class MFColor extends Field {
  public float[][] getValue();
  public void setValue(float[][] value)
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFColor value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, float[] value);
    throws ArrayIndexOutOfBoundsException;
}

public class SFFloat extends Field {
  public float getValue();
  public void setValue(float value);
}

public class MFFloat extends Field {
  public float[] getValue();
  public void setValue(float[] value);
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFFloat value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, float value);
    throws ArrayIndexOutOfBoundsException;
}

public class SFImage extends Field {
  public byte[] getValue(int[] dims);
  public void setValue(byte[] data, int[] dims)
    throws ArrayIndexOutOfBoundsException;
}

// In Java, the int class is a 32-bit integer
public class SFInt32 extends Field {
  public int getValue();
  public void setValue(int value);
}

public class MFInt32 extends Field {
  public int[] getValue();
  public void setValue(int[] value);
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFInt32 value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, int value);
    throws ArrayIndexOutOfBoundsException;
}

public class SFNode extends Field {
  public Node getValue();
  public void setValue(Node node);
}

public class MFNode extends Field {
  public Node[] getValue();
  public void setValue(Node[] node);
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFNode node);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, Node node);
    throws ArrayIndexOutOfBoundsException;
}

public class SFRotation extends Field {
  public float[] getValue();
  public void setValue(float[] value)
    throws ArrayIndexOutOfBoundsException;
}

public class MFRotation extends Field {
  public float[][] getValue();
  public void setValue(float[][] value)
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFRotation value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, float[] value);
    throws ArrayIndexOutOfBoundsException;
}

// In Java, the String class is a Unicode string
public class SFString extends Field {
  public String getValue();
  public void setValue(String value);
}

public class MFString extends Field {
  public String[] getValue();
  public void setValue(String[] value);
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFString value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, String value);
    throws ArrayIndexOutOfBoundsException;
}

public class SFTime extends Field {
  public double getValue();
  public void setValue(double value);
}

public class SFVec2f extends Field {
  public float[] getValue();
  public void setValue(float[] value)
    throws ArrayIndexOutOfBoundsException;
}

public class MFVec2f extends Field {
  public float[][] getValue();
  public void setValue(float[][] value)
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFVec2f value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, float[] value);
    throws ArrayIndexOutOfBoundsException;
}

public class SFVec3f extends Field {
  public float[] getValue();
  public void setValue(float[] value)
    throws ArrayIndexOutOfBoundsException;
}

public class MFVec3f extends Field {
  public float[][] getValue();
  public void setValue(float[][] value)
    throws ArrayIndexOutOfBoundsException;
  public void setValue(ConstMFVec3f value);
    throws ArrayIndexOutOfBoundsException;
  public void set1Value(int index, float[] value);
    throws ArrayIndexOutOfBoundsException;
}

//
// Interfaces (abstract classes that your classes can inherit from
// but that you can't instantiate) relating to events and nodes:
//

interface EventIn {
  public String getName();
  public SFTime getTimeStamp();
  public ConstField getValue();
}

//
// This is the general Node interface
// 
public interface Node {
  public Field getValue(String fieldName)
    throws InvalidFieldException;
  public void postEventIn(String eventName, Field eventValue)
    throws InvalidEventInException;
}

//
// 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; thus, the exception codes for those exceptions are to be
// determined by the script author.
//

public class Script implements Node {
  public Field getValue(String fieldName)
    throws InvalidFieldException;
  public void postEventIn(String eventName, Field eventValue)
    throws InvalidEventInException;
  public void processEvents(EventsIn [] events)
    throws Exception; // Script:code is up to script author
  public void eventsProcessed()
    throws Exception; // Script:code is up to script author
  protected Field getEventOut(String eventName)
    throws InvalidEventOutException;
  protected Field getField(String fieldName)
    throws InvalidFieldException;
  public void shutdown(); // This method is called when this Script node is deleted.
}

public class Browser {
  public static String getName();
  public static String getVersion();

  public static float getCurrentSpeed();

  public static float getCurrentFrameRate();

  public static String getWorldURL();
  public static void loadWorld(String [] url);

  public static void replaceWorld(Node[] nodes);

  public static Node[] createVrmlFromString(String vrmlSyntax);
    throws InvalidVRMLException;

  public static void createVrmlFromURL(String[] url, Node node, String event);
    throws InvalidVRMLException;

  public static String getNavigationType();
  public static void setNavigationType(String type)
    throws InvalidNavigationTypeException;

  public static float getNavigationSpeed();
  public static void setNavigationSpeed(float speed);

  public static float getNavigationScale();
  public static void setNavigationScale(float scale);

  public static boolean getHeadlight();
  public static void setHeadlight(boolean onOff);

  public static String getWorldTitle();
  public static void setWorldTitle(String [] title);

  public static void addRoute(Node fromNode, String fromEventOut,
    Node toNode, String toEventIn)
    throws InvalidRouteException;
  public static void deleteRoute(Node fromNode, String fromEventOut,
    Node toNode, String toEventIn)
    throws InvalidRouteException;
}

//
// Groups class
//
public class Anchor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Billboard implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Collision implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Group implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Inline implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class LOD implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Switch implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Transform implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}


//
// Leaf Nodes class
//
public class DirectionalLight implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Fog implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class PointLight implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Shape implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Sound implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class SpotLight implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Sensors  class
//
public class CylinderSensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class PlaneSensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class ProximitySensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class SphereSensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class TimeSensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class TouchSensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class VisibilitySensor implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Bindable Leaf Nodes class
//
public class Background implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class NavigationInfo implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Viewpoint implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Geometry class
//
public class Box implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Cone implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Cylinder implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class ElevationGrid implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Extrusion implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Geometric Properties implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Color implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Coordinate implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Normal implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class TextureCoordinate implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class IndexedFaceSet implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class IndexedLineSet implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class PointSet implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Sphere implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Text implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Appearance class
//
public class Appearance implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class FontStyle implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class ImageTexture implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class Material implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class MovieTexture implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class PixelTexture implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class TextureTransform implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Interpolators class
//
public class ColorInterpolator implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class CoordinateInterpolator implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class NormalInterpolator implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class OrientationInterpolator implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class PositionInterpolator implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}
public class ScalarInterpolator implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Global Nodes  class
//
public class WorldInfo implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}

//
// Media Properties class
//
public class AudioClip implements Node {
    public Field getValue(String fieldName)
	throws invalidFieldException;
    public void postEventIn(String eventName, Field eventValue)
	throws invalidEventInException;
}


Example of exception class

public class InvalidEventInException extends Exception
{
    /**
     * Constructs an InvalidEventInException with no detail message.
     */
    public InvalidEventInException() {
        super();
    }

    /**
     * Constructs an InvalidEventInException with the specified detail message.
     * A detail message is a String that describes this particular exception.
     * @param s the detail message
     */
    public Inv lideEventInException(String s) {
        super(s);
    }
}

public class InvalidEventOutException extends Exception
{
    public InvalidEventOutException() {
        super();
    }

    public InvalidEventOutException(String s) {
        super(s);
    }
}

public class InvalidFieldException extends Exception
{
    public InvalidFieldException() {
        super();
    }

    public InvalidFieldException(String s) {
        super(s);
    }
}

public class InvalidNavigationTypeException extends Exception
{
    public InvalidNavgationTypeException() {
        super();
    }

    public InvalidNavgationTypeException(String s) {
        super(s);
    }
}

public class InvalidRouteException extends Exception
{
    public InvalidRouteException() {
        super();
    }

    public InvalidRouteException(String s) {
        super(s);
    }
}

public class InvalidVRMLException extends Exception
{
    public InvalidVRMLException() {
        super();
    }

    public InvalidVRMLException(String s) {
        super(s);
    }
}

Document Change Log

7/8/96

7/5/96

7/3/96

7/1/96

6/27/96

Acknowledgement

We thank to Justin Couch (jtc@hq.adied.oz.au) and Don Brutzman (brutzman@cs.nps.navy.mil) and Mik Clarke (RAZ89@DIAL.PIPEX.COM) for their careful review of this document.
 Contact mailto:matsuda@arch.sony.co.jp>matsuda@arch.sony.co.jp</A>,%20<A%20HREF=, or <A HREF="mailto:honda@arch.sony.co.jp>honda@arch.sony.co.jp with questions or comments.
This URL: http://vrml.sgi.com/moving-worlds/spec/javaAPI.html.