All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class vlc.vrml.util.NodeCreator

java.lang.Object
   |
   +----vlc.vrml.util.NodeCreator

public class NodeCreator
extends Object
VermelGen VRML 2.0 Editor

Version:
0.6 Beta 3 Copyright 1997 The Virtual Light Company under the GNU LGPL

The latest information and bugs in VermelGen can be found at http://www.vlc.com.au/VermelGen/

A static class that is used to create the appropriate node implementation for the type of application that is running. It uses the standard java.lang.Class calls to create new instances of classes that are required.

The problem that we have to solve is there are three versions of this application that could be run. In order to minimise versioning problems and distribution hassles (There are only two of us working on this thing!) that we do all the load and configuration at run time. If we placed all three sets of imports in the top of this file it means that the class loader ends up loading them all before doing anything with them. If the user does not have some of the librariues installed (eg EAI or Script) then the application will refuse to load with a ClassNotFound error - a major pain.

To get around this problem, this class uses Class.forName().newInstance(); to load the appropriate version of each of the dialogs. The string stays the same for each dialog type, just the right package name is then added to the front before the call.

All methods are static so that this can be called as needed.

Author:
Justin Couch justin@vlc.com.au

Constructor Index

 o NodeCreator()

Method Index

 o create(int)
Create a dialog of the correct type for the given node type.
 o setDetails(int, String)
Set the internal representation of the apprpriate details needed for the production of the correct dialog box.

Constructors

 o NodeCreator
 public NodeCreator()

Methods

 o setDetails
 public static void setDetails(int appType,
                               String codeBase)
Set the internal representation of the apprpriate details needed for the production of the correct dialog box.

Parameters:
appType - Value defined in VermelGenCommon. Is one of APPLCATION, APPLET, SCRIPT
codeBase - The codebase of this application
See Also:
VermelGenTypes
 o create
 public static VrmlObject create(int nodeType)
Create a dialog of the correct type for the given node type. Assuming the details have been set up correctly previously this will generate a class of the dialog appropriate to the application type (app, applet or script)

Parameters:
nodeType - The type of node to be created. This is defined by the values in the VrmlTypes class from vlc.vrml.VrmlTypes
Returns:
An instance of the dialog required Assuming that the dialog class actually exists. If it does not then null is returned.
See Also:
VrmlTypes

All Packages  Class Hierarchy  This Package  Previous  Next  Index