From 3972522e561f3d47ce4b0abce0cfa428d97f11bd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 14 Sep 2011 09:49:37 +0200 Subject: Relocated VersionApplet --- jnlp-files/jogl-applet-version-jnlp.html | 2 +- jnlp-files/jogl-applet-version-lancheronly.html | 2 +- jnlp-files/jogl-applet-version.jnlp | 2 +- jnlp-files/jogl-application-version.jnlp | 2 +- jnlp-files/jogl-javaws-version.jnlp | 2 +- .../classes/jogamp/opengl/awt/VersionApplet.java | 168 +++++++++++++++++++ .../newt/driver/awt/opengl/VersionApplet.java | 178 --------------------- 7 files changed, 173 insertions(+), 183 deletions(-) create mode 100644 src/jogl/classes/jogamp/opengl/awt/VersionApplet.java delete mode 100644 src/newt/classes/jogamp/newt/driver/awt/opengl/VersionApplet.java diff --git a/jnlp-files/jogl-applet-version-jnlp.html b/jnlp-files/jogl-applet-version-jnlp.html index 9b9e57aec..316ce2fcc 100644 --- a/jnlp-files/jogl-applet-version-jnlp.html +++ b/jnlp-files/jogl-applet-version-jnlp.html @@ -22,7 +22,7 @@ JNLP Applet with AppletLauncher fallback version. JOGL_CODEBASE_TAG/jar/jogl.all.jar, JOGL_CODEBASE_TAG/jar/gluegen-rt.jar"> - + diff --git a/jnlp-files/jogl-applet-version-lancheronly.html b/jnlp-files/jogl-applet-version-lancheronly.html index 4bcf64081..a897b9024 100644 --- a/jnlp-files/jogl-applet-version-lancheronly.html +++ b/jnlp-files/jogl-applet-version-lancheronly.html @@ -22,7 +22,7 @@ AppletLauncher only version. JOGL_CODEBASE_TAG/jar/jogl.all.jar, JOGL_CODEBASE_TAG/jar/gluegen-rt.jar"> - + diff --git a/jnlp-files/jogl-applet-version.jnlp b/jnlp-files/jogl-applet-version.jnlp index 8afb684ba..a06ea83e2 100644 --- a/jnlp-files/jogl-applet-version.jnlp +++ b/jnlp-files/jogl-applet-version.jnlp @@ -17,7 +17,7 @@ diff --git a/jnlp-files/jogl-application-version.jnlp b/jnlp-files/jogl-application-version.jnlp index b949b69aa..3b3cb07c9 100644 --- a/jnlp-files/jogl-application-version.jnlp +++ b/jnlp-files/jogl-application-version.jnlp @@ -15,5 +15,5 @@ - + diff --git a/jnlp-files/jogl-javaws-version.jnlp b/jnlp-files/jogl-javaws-version.jnlp index 8d0160f85..10f228cca 100755 --- a/jnlp-files/jogl-javaws-version.jnlp +++ b/jnlp-files/jogl-javaws-version.jnlp @@ -15,5 +15,5 @@ - + diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java new file mode 100644 index 000000000..5856bf3a0 --- /dev/null +++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java @@ -0,0 +1,168 @@ +package jogamp.opengl.awt; + +import java.applet.Applet; +import java.awt.BorderLayout; +import java.awt.Container; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.TextArea; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import java.util.List; + +import javax.media.opengl.GLProfile; +import javax.media.opengl.awt.GLCanvas; +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLCapabilitiesImmutable; +import javax.media.opengl.GLDrawableFactory; +import javax.media.opengl.GLEventListener; + +import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.os.Platform; +import com.jogamp.common.util.VersionUtil; +import com.jogamp.opengl.JoglVersion; + +@SuppressWarnings("serial") +public class VersionApplet extends Applet { + TextArea tareaVersion; + TextArea tareaCaps; + GLCanvas canvas; + + public static void main(String[] args) { + Frame frame = new Frame("JOGL Version Applet"); + frame.setSize(800, 600); + frame.setLayout(new BorderLayout()); + + VersionApplet va = new VersionApplet(); + frame.addWindowListener(new ClosingWindowAdapter(frame, va)); + + va.init(); + frame.add(va, BorderLayout.CENTER); + frame.validate(); + + frame.setVisible(true); + va.start(); + } + + static class ClosingWindowAdapter extends WindowAdapter { + Frame f; + VersionApplet va; + public ClosingWindowAdapter(Frame f, VersionApplet va) { + this.f = f; + this.va = va; + } + public void windowClosing(WindowEvent ev) { + f.setVisible(false); + va.stop(); + va.destroy(); + f.remove(va); + f.dispose(); + System.exit(0); + } + } + + private synchronized void my_init() { + if(null != canvas) { return; } + + GLProfile glp = GLProfile.getDefault(); + GLCapabilities glcaps = new GLCapabilities(glp); + + setLayout(new BorderLayout()); + String s; + + tareaVersion = new TextArea(120, 60); + s = VersionUtil.getPlatformInfo().toString(); + System.err.println(s); + tareaVersion.append(s); + + s = GlueGenVersion.getInstance().toString(); + System.err.println(s); + tareaVersion.append(s); + + /* + s = NativeWindowVersion.getInstance().toString(); + System.err.println(s); + tareaVersion.append(NativeWindowVersion.getInstance().toString()); + */ + + s = JoglVersion.getInstance().toString(); + System.err.println(s); + tareaVersion.append(s); + + tareaCaps = new TextArea(120, 20); + GLDrawableFactory factory = GLDrawableFactory.getFactory(glp); + List availCaps = factory.getAvailableCapabilities(null); + for(int i=0; i*/ availCaps = factory.getAvailableCapabilities(null); - for(int i=0; i