Class OGLBrowserCanvas

java.lang.Object
org.web3d.vrml.renderer.ogl.browser.OGLBrowserCanvas
All Implemented Interfaces:
Runnable, BrowserCoreListener

public class OGLBrowserCanvas extends Object implements BrowserCoreListener, Runnable
A single canvas that can display a VRML scene graph.

The aim of this canvas is to work in one of two modes - a single canvas that displays the full VRML content, or part of a series of canvases that are used together to form a common view of a single VRML scene graph. The first option represents your typical VRMLbrowser situation, where the latter represents an immersive environment like a CAVE or stereo glasses. The setup of the constructor determines which of these two modes you operate in.

To operate in multicanvas mode, you first start with a single canvas. This canvas is then used as the source of information for all the other canvases. They feed from this central item of information and work from there to build their extra scene information.

Startup of the canvas is a two-phase process. In the first phase, you get Just the canvas and a bit of view information set up. There is no live VRML scene graph at this point, and the various getter methods will return null. After that, there is a second stage that is achieved by calling the initialize() method. This creates the VRML structures needed by this class. This second step is quite time consuming so it allows the caller code to get a UI item on the screen as quickly as possible and then call a separate thread to start the initialization process in a separate thread.

As part of the startup process, a lot of loading of extra items needs to be performed. Instead of requiring the user to create their own, this class allows the information to be specified as a collection of system properties. The only part that is not loaded as part of this startup process are the scripting engines. The end user must create their own scripting engine(s) and register those with the ScriptManager, which is available from this class after initialize() has been called.

The following system properties can be defined as part of this class:

  • org.xj3d.script.loader.class The name of the class that implements the ScriptLoader interface, which is used for loading scripts.
  • org.xj3d.script.manager.class The name of the class that implements the ScriptManager interface, which is used for managing scripts.
  • org.xj3d.file.loader.class The name of the class that implements the ContentLoadManager interface, which is used for loading content other than scripts.
  • org.xj3d.router.manager.class The name of the class that implements the RouteManager interface, which is used for managing routes.
  • org.xj3d.router.factory.class The name of the class that implements the RouterFactory interface, which is used for creating routers.
  • org.xj3d.frame.state.class The name of the class that implements the FrameStateManager interface, which is used for managing per-frame state.
  • org.xj3d.sensor.manager.class The name of the class that implements the SensorManager interface, which is used for managing sensors.
  • org.xj3d.eventmodel.evaluator.class The name of the class that implements the EventModelEvaluator interface, which is used for running the event model.
Note This code already makes use of the link selection listener with the universe. Callers should not register their own listener with the universe, but should register it with this class. NoteThis class starts with its enabled state as false. call setEnabled(true) when you want to start rendering. If this is parented to an AWT component then you should call this after addNotify has been called on the component.
Version:
$Revision: 1.68 $
Author:
Justin Couch