Class DefaultNodeFactory

java.lang.Object
org.web3d.vrml.renderer.DefaultNodeFactory
All Implemented Interfaces:
Cloneable, VRMLNodeFactory
Direct Known Subclasses:
NRNodeFactory, OGLNodeFactory

public class DefaultNodeFactory extends Object implements VRMLNodeFactory, Cloneable
Implementation of the VRMLNodeFactory that produces implementations of the nodes and can be customized for a specific renderer.

This implementation serves two purposes - generalised node factory implementation and the base of a renderer-specific implementation. The class is a full instance allowing it to be used directly, but the constructor is marked protected so that you can't create an instance directly. However, you can use the static factory method to fetch the singleton instance for that particular renderer type.

Property Files

Yes, there are a lot used by this class. Most of them we don't know until runtime because the loading of one file is used to find the definition of another file to load with further property information. There is a much more in-depth tutorial on how to extend Xj3D on the website, so this is just an overview.

At the top of the pile is xj3d.properties. This file is used at startup of the factory. In here, is located the list of profiles supported, components supported and renderers supported. The list of profiles are then used to load a separate property file for each profile, with the file name profile_name.properties. The file name is all lower case, regardless of what the initial formal profile name is. In the profile properties file is the title and the list of each component and level that is required for that profile.

After the profiles, there is a list of the components that may be supported. This list just points to the property file that contains the definition of the component. These files may be placed anywhere, however, for the inbuilt components of Xj3D, you will find the property files in this package (directory). Users wishing to create custom components may place them anywhere, so long as they are findable in the CLASSPATH at runtime. Each file contains a title, name of the implementor and a URL of that implementor. In addition, it contains the definition of the maximum level supported by that component and the list of nodes that are provided at each level. This class is longer a singleton. setProfile was clearing the supported nodes each time. This meant multiple threads with different profiles got messed up.

Version:
$Revision: 2.9 $
Author:
Justin Couch