com.sun.opengl.util
Class JOGLAppletLauncher

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended bycom.sun.opengl.util.JOGLAppletLauncher
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class JOGLAppletLauncher
extends Applet

This class enables deployment of high-end applets which use OpenGL for 3D graphics via JOGL and (optionally) OpenAL for spatialized audio via JOAL. The applet being deployed may be either signed or unsigned; if it is unsigned, it runs inside the security sandbox, and if it is signed, the user receives a security dialog to accept the certificate for the applet as well as for JOGL and JOAL.

The steps for deploying such applets are straightforward. First, the "archive" parameter to the applet tag must contain jogl.jar and gluegen-rt.jar, as well as any jar files associated with your applet (in this case, "your_applet.jar").

Second, the codebase directory on the server, which contains the applet's jar files, must also contain jogl.jar, gluegen-rt.jar, and all of the jogl-natives-*.jar and gluegen-rt-natives-*.jar files from the standard JOGL and GlueGen runtime distributions (provided in jogl-[version]-webstart.zip from the JOGL release builds and gluegen-rt-[version]-webstart.zip from the GlueGen runtime release builds). Note that the codebase of the applet is currently the location from which the JOGL native library used by the applet is downloaded. All of the JOGL and GlueGen-related jars must be signed by the same entity, which is typically Sun Microsystems, Inc.

To deploy an applet using both JOGL and JOAL, simply add joal.jar to the list of jars in the archive tag of the applet, and put joal.jar and the joal-natives-*.jar signed jars into the same codebase directory on the web server. These signed jars are supplied in the joal-[version]-webstart.zip archive from the JOAL release builds.

Sample applet code:

 <applet code="com.sun.opengl.util.JOGLAppletLauncher"
      width=600
      height=400
      codebase="/lib"
      archive="jogl.jar,gluegen-rt.jar,your_applet.jar">
   <param name="subapplet.classname" VALUE="untrusted.JOGLApplet">
   <param name="subapplet.displayname" VALUE="My JOGL Applet">
   <param name="progressbar" value="true">
   <param name="cache_archive" VALUE="jogl.jar,gluegen-rt.jar,your_applet.jar">
   <param name="cache_archive_ex" VALUE="jogl.jar;preload,gluegen-rt.jar;preload,your_applet.jar;preload">
 </applet>
 

There are some limitations with this approach. It is not possible to specify e.g. -Dsun.java2d.noddraw=true or -Dsun.java2d.opengl=true for better control over the Java2D pipeline as it is with Java Web Start. However, the JOGLAppletLauncher tries to force the use of -Dsun.java2d.noddraw=true on Windows platforms for best robustness by detecting if it has not been set and asking the user whether it can update the Java Plug-In configuration automatically. If the user agrees to this, a browser restart is required in order for the change to take effect, though it is permanent for subsequent browser restarts.

The behavior of the noddraw-related dialog box can be changed via two applet parameters. The jogl.silent.noddraw.check parameter, if set to "true", silences the two dialog boxes associated with this check, forcing it to always be performed and deployment.properties to be silently updated if necessary (unless the user previously saw such a dialog box and dismissed it by saying "No, Don't Ask Again"). The noddraw check can be disabled completely by setting the jogl.disable.noddraw.check applet parameter to "true".

The JOGL (and optionally JOAL) natives are cached in the user's home directory (the value of the "user.home" system property in Java) under the directory .jogl_ext. The Java Plug-In is responsible for performing all other jar caching. If the JOGL installation is updated on the server, the .jogl_ext cache will automatically be updated.

This technique requires that JOGL has not been installed in to the JRE under e.g. jre/lib/ext. If problems are seen when deploying this applet launcher, the first question to ask the end user is whether jogl.jar and any associated DLLs, .so's, etc. are installed directly in to the JRE. The applet launcher has been tested primarily under Mozilla, Firefox and Internet Explorer; there may be problems when running under, for example, Opera.

It has been discovered that the Talkback agent in Mozilla / Firefox has bad interactions with OpenGL applets. For highest performance, we recommend disabling the Talkback agent; find talkback.exe, run it, and follow the directions for turning it off. Please see this thread on the javagaming.org forums and this thread on the Mozilla bug reporting database.

Author:
Lilian Chamontin, Kenneth Russell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.applet.Applet
Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JOGLAppletLauncher()
           
 
Method Summary
 void destroy()
           
 Applet getSubApplet()
          Helper method to make it easier to call methods on the sub-applet from JavaScript.
 void init()
          Applet initialization
 void start()
          start asynchroneous loading of libraries if needed
 void stop()
           
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JOGLAppletLauncher

public JOGLAppletLauncher()
Method Detail

init

public void init()
Applet initialization


start

public void start()
start asynchroneous loading of libraries if needed


stop

public void stop()

destroy

public void destroy()

getSubApplet

public Applet getSubApplet()
Helper method to make it easier to call methods on the sub-applet from JavaScript.



Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.