Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLExternalNodeType

All Known Subinterfaces:
NRAudioClipNodeType, VRMLAudioClipNodeType, VRMLExternProtoDeclare, VRMLInlineNodeType, VRMLMultiExternalNodeType, VRMLScriptNodeType, VRMLSingleExternalNodeType
All Known Implementing Classes:
CRExternPrototypeDecl, ExternalPrototypeDecl, NRExternPrototypeDecl, OGLExternPrototypeDecl

public interface VRMLExternalNodeType

Representation of a node that defines it's content at a URL separate to this file that will also need loading.

The idea behind this node interface is that we are going to allow a separate thread from the one that created the initial node to simultaneously load the contents of this node. As we really don't know all the possible types to load, particularly with profiles, a common base class will make life much easier for us to deal with in a generic fashion.

The operation of this interface is to get the loader thread to set the load state as it is going. Once it has loaded the content it then tells the implementation about what it has found.

When fetching the URL list, it is expected that all URLs will be fully qualified. It will be up to the implementor to process the set URLs to contain only fully qualified URLs. For this, we will ensure that the world URL is set on every instance through the setWorldUrl() method.

Version:
$Revision: 1.11 $
Author:
Justin Couch

Field Summary
static int LOAD_COMPLETE
          The node loaded sucessfully and has it's content available
static int LOAD_FAILED
          The node completed loading but none of the available content was successfully loaded.
static int LOADING
          The node is in the middle of the loading process.
static int NOT_LOADED
          The node has not started loading yet.
 
Method Summary
 void addContentStateListener(VRMLContentStateListener l)
          Add a listener to this node instance for the content state changes.
 void addUrlListener(VRMLUrlListener l)
          Add a listener to this node instance for URL changes.
 java.lang.String getWorldUrl()
          Get the world URL so set for this node.
 void removeContentStateListener(VRMLContentStateListener l)
          Remove a listener from this node instance for the content state changes.
 void removeUrlListener(VRMLUrlListener l)
          Remove a listener from this node instance for URL changes.
 void setWorldUrl(java.lang.String url)
          Set the world URL so that any relative URLs may be corrected to the fully qualified version.
 

Field Detail

NOT_LOADED

static final int NOT_LOADED
The node has not started loading yet.

See Also:
Constant Field Values

LOADING

static final int LOADING
The node is in the middle of the loading process.

See Also:
Constant Field Values

LOAD_COMPLETE

static final int LOAD_COMPLETE
The node loaded sucessfully and has it's content available

See Also:
Constant Field Values

LOAD_FAILED

static final int LOAD_FAILED
The node completed loading but none of the available content was successfully loaded.

See Also:
Constant Field Values
Method Detail

setWorldUrl

void setWorldUrl(java.lang.String url)
Set the world URL so that any relative URLs may be corrected to the fully qualified version. Guaranteed to be non-null.

Parameters:
url - The world URL.

getWorldUrl

java.lang.String getWorldUrl()
Get the world URL so set for this node.

Returns:
url The world URL.

addUrlListener

void addUrlListener(VRMLUrlListener l)
Add a listener to this node instance for URL changes. If the listener is already added or null the request is silently ignored.

Parameters:
l - The listener instance to add

removeUrlListener

void removeUrlListener(VRMLUrlListener l)
Remove a listener from this node instance for URL changes. If the listener is null or not registered, the request is silently ignored.

Parameters:
l - The listener to be removed

addContentStateListener

void addContentStateListener(VRMLContentStateListener l)
Add a listener to this node instance for the content state changes. If the listener is already added or null the request is silently ignored.

Parameters:
l - The listener instance to add

removeContentStateListener

void removeContentStateListener(VRMLContentStateListener l)
Remove a listener from this node instance for the content state changes. If the listener is null or not registered, the request is silently ignored.

Parameters:
l - The listener to be removed

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium