From: Kenneth B. R. <kbr...@us...> - 2008-03-02 20:21:27
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16186/src/jake2/qcommon Modified Files: Q2DataDialog.java Log Message: Changes to enable Jake2 to run well as an applet inside the next-generation Java Plug-In. Added Globals.appletMode, Globals.applet and Globals.sizeChangeListener to be able to easily pass around the knowledge that the system is running in applet mode, and the applet itself, which becomes the parent container for the output. Most changes were in Jsr231Driver to support putting the Display into a preexisting parent container rather than a new Frame each time. Changed JOGLKBD to allow manual initialization of the parent container rather than obtaining it from a CreateNotify or ConfigureNotify event since these will never be generated in the applet case. Removed various calls to System.exit(), although strictly speaking this is no longer necessary because it is expected that the separate_jvm parameter will be used in conjunction with the new Java Plug-In to create a fresh JVM instance for each run of Jake2. Video mode switching in applet mode is working; the applet resizes (via JavaScript) to accommodate the newly selected resolution. Full screen mode when running as an applet is not implemented at this point, as the intent was to show this inside the browser, though support could be added very straightforwardly. Index: Q2DataDialog.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Q2DataDialog.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Q2DataDialog.java 27 Feb 2007 14:39:03 -0000 1.15 --- Q2DataDialog.java 2 Mar 2008 20:21:13 -0000 1.16 *************** *** 179,183 **** private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) { ! System.exit(1); dispose(); } --- 179,185 ---- private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) { ! if (!Globals.appletMode) { ! System.exit(1); ! } dispose(); } *************** *** 213,217 **** private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing ! System.exit(1); dispose(); }//GEN-LAST:event_formWindowClosing --- 215,221 ---- private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing ! if (!Globals.appletMode) { ! System.exit(1); ! } dispose(); }//GEN-LAST:event_formWindowClosing *************** *** 402,406 **** --- 406,412 ---- exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + if (!Globals.appletMode) { System.exit(0); + } }}); add(exit, constraints); *************** *** 573,577 **** private void exit() { ! System.exit(0); } --- 579,585 ---- private void exit() { ! if (!Globals.appletMode) { ! System.exit(0); ! } } |