diff options
author | Sven Gothel <[email protected]> | 2011-09-27 11:59:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-27 11:59:06 +0200 |
commit | df85f0dfafc09e147f9d422adf5ee8eabf67977b (patch) | |
tree | 2cfa489bc37a8195e0742d8ce48d0d7b2ba468fb /src/jogl/classes/javax | |
parent | e5ab975727134d8249277f4df707b2b14a7788f3 (diff) |
Adapt to GlueGen's Lock ChangeSet: e4baba27507ce78e64a150ec6f69fb96f5721a34 ; Use generics
Diffstat (limited to 'src/jogl/classes/javax')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 03dfc55b5..48c1c5411 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -90,6 +90,7 @@ import com.jogamp.common.GlueGenVersion; import com.jogamp.common.util.VersionUtil; import com.jogamp.opengl.JoglVersion; +import com.jogamp.common.util.locks.LockFactory; import com.jogamp.common.util.locks.RecursiveLock; import jogamp.opengl.Debug; import jogamp.opengl.GLContextImpl; @@ -134,6 +135,7 @@ import jogamp.opengl.ThreadingImpl; * </ul> */ +@SuppressWarnings("serial") public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosingProtocol { private static final boolean DEBUG; @@ -498,7 +500,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing } } - RecursiveLock drawableSync = new RecursiveLock(); + RecursiveLock drawableSync = LockFactory.createRecursiveLock(); /** Overridden to track when this component is added to a container. Subclasses which override this method must call @@ -507,6 +509,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing <B>Overrides:</B> <DL><DD><CODE>addNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */ + @SuppressWarnings("deprecation") @Override public void addNotify() { if(DEBUG) { @@ -593,6 +596,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing about this.</p> <B>Overrides:</B> <DL><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */ + @SuppressWarnings("deprecation") @Override public void removeNotify() { if(DEBUG) { @@ -628,6 +632,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing <B>Overrides:</B> <DL><DD><CODE>reshape</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */ + @SuppressWarnings("deprecation") @Override public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); @@ -935,10 +940,10 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing private void disableBackgroundErase() { if (!disableBackgroundEraseInitialized) { try { - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { try { - Class clazz = getToolkit().getClass(); + Class<?> clazz = getToolkit().getClass(); while (clazz != null && disableBackgroundEraseMethod == null) { try { disableBackgroundEraseMethod = @@ -1006,7 +1011,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing chooser, aScreen); } else { try { - final ArrayList bucket = new ArrayList(1); + final ArrayList<AWTGraphicsConfiguration> bucket = new ArrayList<AWTGraphicsConfiguration>(1); EventQueue.invokeAndWait(new Runnable() { public void run() { AWTGraphicsConfiguration c = (AWTGraphicsConfiguration) @@ -1016,7 +1021,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing bucket.add(c); } }); - config = ( bucket.size() > 0 ) ? (AWTGraphicsConfiguration)bucket.get(0) : null ; + config = ( bucket.size() > 0 ) ? bucket.get(0) : null ; } catch (InvocationTargetException e) { throw new GLException(e.getTargetException()); } catch (InterruptedException e) { @@ -1042,7 +1047,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing GLProfile.initSingleton(false); GLDrawableFactory factory = GLDrawableFactory.getDesktopFactory(); - List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null); + List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null); for(int i=0; i<availCaps.size(); i++) { System.err.println(availCaps.get(i)); } |