diff options
author | Sven Gothel <[email protected]> | 2012-05-02 01:20:46 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-02 01:20:46 +0200 |
commit | 935523a8c58efced1c0845bd60e08e2acb9e5aee (patch) | |
tree | 3719897e3c2804abff130e299858df7c09f84588 /src/newt/classes/com | |
parent | 969567663c08597c2c2effe6128f4810ec252513 (diff) |
NEWT API Change 'WindowClosingProtocol': Use 'enum WindowClosingMode' instead of static final int values.
Diffstat (limited to 'src/newt/classes/com')
4 files changed, 12 insertions, 12 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index c0d8f97b3..9af4a02ae 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -74,7 +74,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto private boolean shallUseOffscreenLayer = false; private Window newtChild = null; private boolean isOnscreen = true; - private int newtChildCloseOp; + private WindowClosingMode newtChildCloseOp; private AWTAdapter awtAdapter = null; private AWTAdapter awtMouseAdapter = null; private AWTAdapter awtKeyAdapter = null; @@ -283,11 +283,11 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto * or {@link #addNotify()} hasn't been called yet.*/ public NativeWindow getNativeWindow() { return jawtWindow; } - public int getDefaultCloseOperation() { + public WindowClosingMode getDefaultCloseOperation() { return awtWindowClosingProtocol.getDefaultCloseOperation(); } - public int setDefaultCloseOperation(int op) { + public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) { return awtWindowClosingProtocol.setDefaultCloseOperation(op); } @@ -319,7 +319,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto awtAdapter = new AWTParentWindowAdapter(jawtWindow, newtChild).addTo(this); newtChild.addWindowListener(clearAWTMenusOnNewtFocus); newtChild.setFocusAction(focusAction); // enable AWT focus traversal - newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingProtocol.DO_NOTHING_ON_CLOSE); + newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE); awtWindowClosingProtocol.addClosingListenerOneShot(); keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); keyboardFocusManager.addPropertyChangeListener("focusOwner", focusPropertyChangeListener); diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java index 82562636b..d06aca039 100755 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java @@ -36,7 +36,7 @@ import java.awt.event.KeyListener; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import javax.media.nativewindow.WindowClosingProtocol; +import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode; import javax.media.opengl.FPSCounter; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; @@ -187,7 +187,7 @@ public class JOGLNewtApplet1Run extends Applet { glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err); glWindow.setUndecorated(glUndecorated); glWindow.setAlwaysOnTop(glAlwaysOnTop); - glWindow.setDefaultCloseOperation(glCloseable ? WindowClosingProtocol.DISPOSE_ON_CLOSE : WindowClosingProtocol.DO_NOTHING_ON_CLOSE); + glWindow.setDefaultCloseOperation(glCloseable ? WindowClosingMode.DISPOSE_ON_CLOSE : WindowClosingMode.DO_NOTHING_ON_CLOSE); container.setLayout(new BorderLayout()); if(appletDebugTestBorder) { container.add(new Button("North"), BorderLayout.NORTH); diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java index f6b9b6583..082c01c23 100755 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java @@ -32,7 +32,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import javax.media.nativewindow.NativeWindow; -import javax.media.nativewindow.WindowClosingProtocol; +import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode; import javax.media.opengl.FPSCounter; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; @@ -164,7 +164,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { // Closing action: back to parent! @Override public void windowDestroyNotify(WindowEvent e) { - if( WindowClosingProtocol.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() ) { + if( WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() ) { if(null == glWindow.getParent()) { // we may be called directly by the native EDT new Thread(new Runnable() { @@ -298,7 +298,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { } else { glWindow.reparentWindow(null); if(glClosable) { - glWindow.setDefaultCloseOperation(WindowClosingProtocol.DISPOSE_ON_CLOSE); + glWindow.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE); } } } diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index efdcf4c12..34e0df64f 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -94,7 +94,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC @Override public void windowDestroyNotify(WindowEvent e) { - if( DISPOSE_ON_CLOSE == GLWindow.this.getDefaultCloseOperation() ) { + if( WindowClosingMode.DISPOSE_ON_CLOSE == GLWindow.this.getDefaultCloseOperation() ) { // Is an animator thread perform rendering? if (GLWindow.this.helper.isExternalAnimatorRunning()) { // Pause animations before initiating safe destroy. @@ -176,11 +176,11 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC //---------------------------------------------------------------------- // WindowClosingProtocol implementation // - public int getDefaultCloseOperation() { + public WindowClosingMode getDefaultCloseOperation() { return window.getDefaultCloseOperation(); } - public int setDefaultCloseOperation(int op) { + public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) { return window.setDefaultCloseOperation(op); } |