From 1b1a05eb49cc3a0e0da505c175388ae1147ea2d6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 28 Jul 2015 15:26:38 +0200 Subject: Bug 1154 - Make plugin3-public.jar optional: Part 1 / 2 (Relocate Applet3 classes) --- ...unner-newt-GraphTextDemo01-applet3-napplet.html | 4 +- ...er-newt-GraphUISceneDemo01-applet3-napplet.html | 4 +- ...plet-runner-newt-MovieCube-applet3-napplet.html | 4 +- ...l-applet-runner-newt-gears-applet3-napplet.html | 8 +- ...-runner-newt-gears-applet3-special-napplet.html | 4 +- .../jogl-applet-version-applet3-napplet.html | 8 +- make/build-common.xml | 6 +- .../newt/util/applet/JOGLNewtApplet3Run.java | 360 -------------------- .../jogamp/newt/util/applet/VersionApplet3.java | 226 ------------- .../newt/util/applet3/JOGLNewtApplet3Run.java | 361 +++++++++++++++++++++ .../jogamp/newt/util/applet3/VersionApplet3.java | 226 +++++++++++++ .../junit/jogl/acore/TestVersionSemanticsNOUI.java | 9 +- 12 files changed, 613 insertions(+), 607 deletions(-) delete mode 100644 src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java delete mode 100644 src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java create mode 100644 src/newt/classes/com/jogamp/newt/util/applet3/JOGLNewtApplet3Run.java create mode 100644 src/newt/classes/com/jogamp/newt/util/applet3/VersionApplet3.java diff --git a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html index 0ff71c9f7..fa734ad1c 100644 --- a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html +++ b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html @@ -12,7 +12,7 @@ JOGL Applet3 Graph Text Demo 01

- + @@ -25,7 +25,7 @@ JOGL Applet3 Graph Text Demo 01 - - + - - + -

- + @@ -35,7 +35,7 @@ JOGL NEWT Applet3 Runner Special Keys:
- <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="200" height="200"> - <param name="code" value="com.jogamp.newt.util.applet.JOGLNewtApplet3Run"> + <param name="code" value="com.jogamp.newt.util.applet3.JOGLNewtApplet3Run"> <param name="archive" value="jar/gluegen-rt.jar, jar/jogl-all-noawt.jar, jar/jogl-test.jar"> @@ -71,7 +71,7 @@ The applet above is instantiated with the following code: <param name="gl_debug" value="false"> <param name="gl_trace" value="false"> <comment> - <embed code="com.jogamp.newt.util.applet.JOGLNewtApplet3Run" + <embed code="com.jogamp.newt.util.applet3.JOGLNewtApplet3Run" width="200" height="200" type="application/x-java-applet;version=1.6" pluginspage="http://java.sun.com/javase/downloads/ea.jsp" diff --git a/jnlp-files/jogl-applet-runner-newt-gears-applet3-special-napplet.html b/jnlp-files/jogl-applet-runner-newt-gears-applet3-special-napplet.html index 821d8f4dc..5fad94adb 100644 --- a/jnlp-files/jogl-applet-runner-newt-gears-applet3-special-napplet.html +++ b/jnlp-files/jogl-applet-runner-newt-gears-applet3-special-napplet.html @@ -9,7 +9,7 @@ JOGL NEWT JNLP Applet3 Runner Special Keys: - + @@ -26,7 +26,7 @@ JOGL NEWT JNLP Applet3 Runner Special Keys: - - + - <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="800" height="600"> - <param name="code" value="com.jogamp.newt.util.applet.VersionApplet3"> + <param name="code" value="com.jogamp.newt.util.applet3.VersionApplet3"> <param name="archive" value="jar/gluegen-rt.jar, jar/jogl-all-noawt.jar"> <comment> - <embed code="com.jogamp.newt.util.applet.VersionApplet3" + <embed code="com.jogamp.newt.util.applet3.VersionApplet3" width="800" height="600" type="application/x-java-applet;version=1.6" pluginspage="http://java.sun.com/javase/downloads/ea.jsp" diff --git a/make/build-common.xml b/make/build-common.xml index 1d408a057..88c876e5d 100644 --- a/make/build-common.xml +++ b/make/build-common.xml @@ -180,7 +180,10 @@ - + + + + @@ -241,6 +244,7 @@ + diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java deleted file mode 100644 index 6ea63f69c..000000000 --- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java +++ /dev/null @@ -1,360 +0,0 @@ -/** - * Copyright 2011 JogAmp Community. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of JogAmp Community. - */ -package com.jogamp.newt.util.applet; - -import java.util.Locale; - -import com.jogamp.plugin.applet.Applet3; -import com.jogamp.plugin.applet.Applet3Context; -import com.jogamp.plugin.ui.NativeWindowDownstream; -import com.jogamp.plugin.ui.NativeWindowUpstream; - -import com.jogamp.nativewindow.AbstractGraphicsDevice; -import com.jogamp.nativewindow.AbstractGraphicsScreen; -import com.jogamp.nativewindow.NativeWindow; -import com.jogamp.nativewindow.NativeWindowFactory; -import com.jogamp.nativewindow.WindowClosingProtocol.WindowClosingMode; -import com.jogamp.nativewindow.util.PointImmutable; -import com.jogamp.opengl.FPSCounter; -import com.jogamp.opengl.GLCapabilities; -import com.jogamp.opengl.GLProfile; - -import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos; -import com.jogamp.newt.NewtFactory; -import com.jogamp.newt.Window; -import com.jogamp.newt.opengl.GLWindow; - -/** - * Simple GLEventListener deployment as an applet using JOGL. This demo must be - * referenced from a web page via an <applet> tag. - * - *

- * Example of an applet tag using GearsES2 within the applet area (normal case): - *

-        <applet width=100 height=100>
-           <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
-           <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2">
-           <param name="gl_profile" value="GL2">
-           <param name="gl_swap_interval" value="1">
-           <param name="gl_debug" value="false">
-           <param name="gl_trace" value="false">
-           <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp">
-        </applet>Hello Gears !
- *  
- *

- * - *

- * Example of an applet tag using GearsES2 in an undecorated, translucent, closeable and always-on-top window: - *

-        <applet width=1 height=1>
-           <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
-           <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2">
-           <param name="gl_profile" value="GL2">
-           <param name="gl_swap_interval" value="1">
-           <param name="gl_undecorated" value="true">
-           <param name="gl_alwaysontop" value="true">
-           <param name="gl_closeable" value="true">
-           <param name="gl_alpha" value="1">
-           <param name="gl_multisamplebuffer" value="0">
-           <param name="gl_opaque" value="false">
-           <param name="gl_dx" value="10">
-           <param name="gl_dy" value="0">
-           <param name="gl_width" value="100">
-           <param name="gl_height" value="100">
-           <param name="gl_nodefaultkeyListener" value="true">
-           <param name="gl_debug" value="false">
-           <param name="gl_trace" value="false">
-           <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp">
-        </applet>Hello Gears !
- *  
- *

- */ -public class JOGLNewtApplet3Run implements Applet3 { - public static final boolean DEBUG = JOGLNewtAppletBase.DEBUG; - - GLWindow glWindow = null; - JOGLNewtAppletBase base = null; - /** if valid glStandalone:=true (own window) ! */ - int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE; - Applet3Context ctx; - boolean glStandalone = false; - UpstreamWindowHookMutableSizePos upstreamSizePosHook; - PointImmutable upstreamLocOnScreen; - NativeWindow browserWin; - - final String getParameter(final String name) { - return ctx.getParameter(name); - } - - @Override - public NativeWindowDownstream createNativeWindow(final Applet3Context ctx, final NativeWindowUpstream upstreamWin) { - this.ctx = ctx; - - String glProfileName=null; - boolean glOpaque=true; - int glAlphaBits=0; - int glNumMultisampleBuffer=0; - boolean glUndecorated=false; - boolean glAlwaysOnTop=false; - try { - glProfileName = getParameter("gl_profile"); - glOpaque = JOGLNewtAppletBase.str2Bool(getParameter("gl_opaque"), glOpaque); - glAlphaBits = JOGLNewtAppletBase.str2Int(getParameter("gl_alpha"), glAlphaBits); - glNumMultisampleBuffer = JOGLNewtAppletBase.str2Int(getParameter("gl_multisamplebuffer"), glNumMultisampleBuffer); - glXd = JOGLNewtAppletBase.str2Int(getParameter("gl_dx"), glXd); - glYd = JOGLNewtAppletBase.str2Int(getParameter("gl_dy"), glYd); - glWidth = JOGLNewtAppletBase.str2Int(getParameter("gl_width"), glWidth); - glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight); - glUndecorated = JOGLNewtAppletBase.str2Bool(getParameter("gl_undecorated"), glUndecorated); - glAlwaysOnTop = JOGLNewtAppletBase.str2Bool(getParameter("gl_alwaysontop"), glAlwaysOnTop); - } catch (final Exception e) { - e.printStackTrace(); - } - glStandalone = Integer.MAX_VALUE>glXd && Integer.MAX_VALUE>glYd && Integer.MAX_VALUE>glWidth && Integer.MAX_VALUE>glHeight; - final GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName)); - caps.setAlphaBits(glAlphaBits); - if(0 availCaps = factory.getAvailableCapabilities(null); - for(int i=0; i + * Example of an applet tag using GearsES2 within the applet area (normal case): + *
+        <applet width=100 height=100>
+           <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
+           <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2">
+           <param name="gl_profile" value="GL2">
+           <param name="gl_swap_interval" value="1">
+           <param name="gl_debug" value="false">
+           <param name="gl_trace" value="false">
+           <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp">
+        </applet>Hello Gears !
+ *  
+ *

+ * + *

+ * Example of an applet tag using GearsES2 in an undecorated, translucent, closeable and always-on-top window: + *

+        <applet width=1 height=1>
+           <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
+           <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2">
+           <param name="gl_profile" value="GL2">
+           <param name="gl_swap_interval" value="1">
+           <param name="gl_undecorated" value="true">
+           <param name="gl_alwaysontop" value="true">
+           <param name="gl_closeable" value="true">
+           <param name="gl_alpha" value="1">
+           <param name="gl_multisamplebuffer" value="0">
+           <param name="gl_opaque" value="false">
+           <param name="gl_dx" value="10">
+           <param name="gl_dy" value="0">
+           <param name="gl_width" value="100">
+           <param name="gl_height" value="100">
+           <param name="gl_nodefaultkeyListener" value="true">
+           <param name="gl_debug" value="false">
+           <param name="gl_trace" value="false">
+           <param name="jnlp_href" value="jogl-newt-applet-runner.jnlp">
+        </applet>Hello Gears !
+ *  
+ *

+ */ +public class JOGLNewtApplet3Run implements Applet3 { + public static final boolean DEBUG = JOGLNewtAppletBase.DEBUG; + + GLWindow glWindow = null; + JOGLNewtAppletBase base = null; + /** if valid glStandalone:=true (own window) ! */ + int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE; + Applet3Context ctx; + boolean glStandalone = false; + UpstreamWindowHookMutableSizePos upstreamSizePosHook; + PointImmutable upstreamLocOnScreen; + NativeWindow browserWin; + + final String getParameter(final String name) { + return ctx.getParameter(name); + } + + @Override + public NativeWindowDownstream createNativeWindow(final Applet3Context ctx, final NativeWindowUpstream upstreamWin) { + this.ctx = ctx; + + String glProfileName=null; + boolean glOpaque=true; + int glAlphaBits=0; + int glNumMultisampleBuffer=0; + boolean glUndecorated=false; + boolean glAlwaysOnTop=false; + try { + glProfileName = getParameter("gl_profile"); + glOpaque = JOGLNewtAppletBase.str2Bool(getParameter("gl_opaque"), glOpaque); + glAlphaBits = JOGLNewtAppletBase.str2Int(getParameter("gl_alpha"), glAlphaBits); + glNumMultisampleBuffer = JOGLNewtAppletBase.str2Int(getParameter("gl_multisamplebuffer"), glNumMultisampleBuffer); + glXd = JOGLNewtAppletBase.str2Int(getParameter("gl_dx"), glXd); + glYd = JOGLNewtAppletBase.str2Int(getParameter("gl_dy"), glYd); + glWidth = JOGLNewtAppletBase.str2Int(getParameter("gl_width"), glWidth); + glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight); + glUndecorated = JOGLNewtAppletBase.str2Bool(getParameter("gl_undecorated"), glUndecorated); + glAlwaysOnTop = JOGLNewtAppletBase.str2Bool(getParameter("gl_alwaysontop"), glAlwaysOnTop); + } catch (final Exception e) { + e.printStackTrace(); + } + glStandalone = Integer.MAX_VALUE>glXd && Integer.MAX_VALUE>glYd && Integer.MAX_VALUE>glWidth && Integer.MAX_VALUE>glHeight; + final GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName)); + caps.setAlphaBits(glAlphaBits); + if(0 availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i excludesDefault; - static final Set excludesStereoPackage; + static final Set excludesStereoPackageAndAppletUtils; static { excludesDefault = new HashSet(); excludesDefault.add("^\\Qjogamp/\\E.*$"); - excludesStereoPackage = new HashSet(excludesDefault); - excludesStereoPackage.add("^\\Qcom/jogamp/opengl/util/stereo/\\E.*$"); + excludesStereoPackageAndAppletUtils = new HashSet(excludesDefault); + excludesStereoPackageAndAppletUtils.add("^\\Qcom/jogamp/opengl/util/stereo/\\E.*$"); + excludesStereoPackageAndAppletUtils.add("^\\Qcom/jogamp/newt/util/applet/\\E.*$"); } @@ -138,7 +139,7 @@ public class TestVersionSemanticsNOUI extends SingletonJunitCase { VersionSemanticsUtil.testVersion(diffCriteria, expectedCompatibilityType, previousJar, preVersionNumber, curVersion.getClass(), currentCL, curVersionNumber, - excludesStereoPackage); + excludesStereoPackageAndAppletUtils); } public static void main(final String args[]) throws IOException { -- cgit v1.2.3