summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreteq <[email protected]>2006-08-01 20:49:36 +0000
committereteq <[email protected]>2006-08-01 20:49:36 +0000
commit36aaff888ce0fe773d89de89bdf79eb3d4b1c0bf (patch)
tree982d958b70b87df58415dd82ebde2fc76b4ad02c
parent93a15554115adc759630d11e628f7a2cfb52b1b3 (diff)
updated to latest version of GLJFrame from previous source tree
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@6 83d24430-9974-4f80-8418-2cc3294053b9
-rw-r--r--src/net/java/joglutils/GLJFrame.java61
1 files changed, 41 insertions, 20 deletions
diff --git a/src/net/java/joglutils/GLJFrame.java b/src/net/java/joglutils/GLJFrame.java
index a76ab1e..bde29fc 100644
--- a/src/net/java/joglutils/GLJFrame.java
+++ b/src/net/java/joglutils/GLJFrame.java
@@ -47,9 +47,9 @@ import java.awt.event.*;
* @author Erik J. Tollerud
*/
public class GLJFrame extends JFrame {
- private Canvas mainCanvas;
private GLEventListener listener;
private GLCapabilities caps;
+ private GLCapabilitiesChooser chooser;
private com.sun.opengl.util.Animator animator;
private GLContext contextToShareWith;
@@ -69,6 +69,7 @@ public class GLJFrame extends JFrame {
super(title);
this.listener = listener;
this.caps = new GLCapabilities();
+ this.chooser = null; //can be null because that will choose the default
initComponents();
((GLCanvas)mainCanvas).addGLEventListener(listener);
animator = null;
@@ -76,41 +77,54 @@ public class GLJFrame extends JFrame {
}
/**
* Creates new form GLJFrame
- * @param title title for the window
+ * @param caps the GLCapabilities to request for the GLCanvas
+ * @param chooser the capabilities chooser to use in creating the GLCanvas on this frame
+ * @param title the title for the window
* @param listener the GLEventListener to attach to the GLCanvas
- * @param capabilities the GLCapabilities to request for the GLCanvas
+ * @param contextToShareWith the context to share with
*/
- public GLJFrame(String title, GLEventListener listener, GLCapabilities capabilities) {
+ public GLJFrame(String title, GLEventListener listener, GLCapabilities caps,GLCapabilitiesChooser chooser,GLContext contextToShareWith) {
super(title);
this.listener = listener;
- this.caps = (GLCapabilities)capabilities.clone();
+ this.caps = caps;
+ this.chooser = chooser;
+ this.contextToShareWith = contextToShareWith;
initComponents();
((GLCanvas)mainCanvas).addGLEventListener(listener);
animator = null;
- this.contextToShareWith = null;
}
+
/**
* Creates new form GLJFrame
+ * @param title title for the window
* @param listener the GLEventListener to attach to the GLCanvas
- * @param contextToShareWith the context to share with
- * @see javax.media.opengl.GLCanvas#javax.media.opengl.GLCanvas(javax.media.opengl.GLCapabilities,javax.media.opengl.GLCapabilitiesChooser,javax.media.opengl.GLContext,javax.media.opengl.GraphicsDevice)
+ * @param capabilities the GLCapabilities to request for the GLCanvas
*/
- public GLJFrame(GLEventListener listener, GLContext contextToShareWith) {
- this(listener);
- this.contextToShareWith = contextToShareWith;
-
+ public GLJFrame(String title, GLEventListener listener, GLCapabilities capabilities) {
+ this(title,listener,capabilities,null,null);
}
+
/**
* Creates new form GLJFrame
* @param title title for the window
* @param listener the GLEventListener to attach to the GLCanvas
* @param capabilities the GLCapabilities to request for the GLCanvas
+ * @param chooser the capabilities chooser to use in creating the GLCanvas on this frame
+ */
+ public GLJFrame(String title, GLEventListener listener, GLCapabilities capabilities, GLCapabilitiesChooser chooser) {
+ this(title,listener,capabilities,chooser,null);
+ }
+
+ /**
+ * Creates new form GLJFrame
+ * @param listener the GLEventListener to attach to the GLCanvas
* @param contextToShareWith the context to share with
* @see javax.media.opengl.GLCanvas#javax.media.opengl.GLCanvas(javax.media.opengl.GLCapabilities,javax.media.opengl.GLCapabilitiesChooser,javax.media.opengl.GLContext,javax.media.opengl.GraphicsDevice)
*/
- public GLJFrame(String title, GLEventListener listener, GLCapabilities capabilities, GLContext contextToShareWith) {
- this(title,listener,capabilities);
+ public GLJFrame(GLEventListener listener, GLContext contextToShareWith) {
+ this(listener);
this.contextToShareWith = contextToShareWith;
+
}
/**
* Creates new form GLJFrame
@@ -163,9 +177,14 @@ public class GLJFrame extends JFrame {
this.setFullscreen(fullscreen);
}
-
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
- mainCanvas = new GLCanvas(caps,null,contextToShareWith,null);
+ mainCanvas = new GLCanvas(caps,chooser,contextToShareWith,null);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addComponentListener(new java.awt.event.ComponentAdapter() {
@@ -178,13 +197,15 @@ public class GLJFrame extends JFrame {
getContentPane().add(mainCanvas, java.awt.BorderLayout.CENTER);
pack();
- }
+ }// </editor-fold>//GEN-END:initComponents
- private void formComponentResized(java.awt.event.ComponentEvent evt) {
+ private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
this.mainCanvas.setSize(this.getRootPane().getSize());
- }
+ }//GEN-LAST:event_formComponentResized
-
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private java.awt.Canvas mainCanvas;
+ // End of variables declaration//GEN-END:variables
/**
* Sets the event listener attached to the GLcanvas. Note that this method does not repaint this component, so it will not immediately update.
* @param listener the GLEventListener to attach to the GLCanvas