summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java118
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java185
2 files changed, 152 insertions, 151 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index e3a7838e7..9d2d21ce5 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -184,7 +184,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
private volatile boolean isShowing;
private final HierarchyListener hierarchyListener = new HierarchyListener() {
@Override
- public void hierarchyChanged(HierarchyEvent e) {
+ public void hierarchyChanged(final HierarchyEvent e) {
isShowing = GLCanvas.this.isShowing();
}
};
@@ -212,7 +212,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
* @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice)
*/
- public GLCanvas(GLCapabilitiesImmutable capsReqUser) throws GLException {
+ public GLCanvas(final GLCapabilitiesImmutable capsReqUser) throws GLException {
this(capsReqUser, null, null, null);
}
@@ -226,7 +226,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* @deprecated Use {@link #GLCanvas(GLCapabilitiesImmutable)}
* and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
*/
- public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLContext shareWith)
+ public GLCanvas(final GLCapabilitiesImmutable capsReqUser, final GLContext shareWith)
throws GLException
{
this(capsReqUser, null, shareWith, null);
@@ -244,9 +244,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
is passed for this argument.
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
*/
- public GLCanvas(GLCapabilitiesImmutable capsReqUser,
- GLCapabilitiesChooser chooser,
- GraphicsDevice device)
+ public GLCanvas(final GLCapabilitiesImmutable capsReqUser,
+ final GLCapabilitiesChooser chooser,
+ final GraphicsDevice device)
throws GLException
{
this(capsReqUser, chooser, null, device);
@@ -272,8 +272,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
*/
public GLCanvas(GLCapabilitiesImmutable capsReqUser,
- GLCapabilitiesChooser chooser,
- GLContext shareWith,
+ final GLCapabilitiesChooser chooser,
+ final GLContext shareWith,
GraphicsDevice device)
throws GLException
{
@@ -297,7 +297,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
if(null==device) {
- GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ final GraphicsConfiguration gc = super.getGraphicsConfiguration();
if(null!=gc) {
device = gc.getDevice();
}
@@ -316,12 +316,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.context, sharedContext);
}
@Override
- public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
helper.setSharedAutoDrawable(this, sharedAutoDrawable);
}
@@ -331,7 +331,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setShallUseOffscreenLayer(boolean v) {
+ public void setShallUseOffscreenLayer(final boolean v) {
shallUseOffscreenLayer = v;
}
@@ -410,11 +410,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* block, both devices should have the same visual list, and the
* same configuration should be selected here.
*/
- AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(),
+ final AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(),
(GLCapabilitiesImmutable)awtConfig.getRequestedCapabilities(),
chooser, gc.getDevice());
final GraphicsConfiguration compatible = (null!=config)?config.getAWTGraphicsConfiguration():null;
- boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
+ final boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
if(DEBUG) {
System.err.println(getThreadName()+": Info:");
System.err.println("Created Config (n): HAVE GC "+chosen);
@@ -487,7 +487,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
}
- private final void setRealizedImpl(boolean realized) {
+ private final void setRealizedImpl(final boolean realized) {
final RecursiveLock _lock = lock;
_lock.lock();
try {
@@ -514,7 +514,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
};
@Override
- public final void setRealized(boolean realized) {
+ public final void setRealized(final boolean realized) {
// Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock!
AWTEDTExecutor.singleton.invoke(getTreeLock(), false /* allowOnNonEDT */, true /* wait */, realized ? realizeOnEDTAction : unrealizeOnEDTAction);
}
@@ -531,7 +531,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return awtWindowClosingProtocol.setDefaultCloseOperation(op);
}
@@ -565,7 +565,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
destroyImpl( false );
}
- protected void destroyImpl(boolean destroyJAWTWindowAndAWTDevice) {
+ protected void destroyImpl(final boolean destroyJAWTWindowAndAWTDevice) {
Threading.invoke(true, destroyOnEDTAction, getTreeLock());
if( destroyJAWTWindowAndAWTDevice ) {
AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, disposeJAWTWindowAndAWTDeviceOnEDT);
@@ -578,21 +578,21 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
properly.
*/
@Override
- public void paint(Graphics g) {
+ public void paint(final Graphics g) {
if( Beans.isDesignTime() ) {
// Make GLCanvas behave better in NetBeans GUI builder
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
- FontMetrics fm = g.getFontMetrics();
+ final FontMetrics fm = g.getFontMetrics();
String name = getName();
if (name == null) {
name = getClass().getName();
- int idx = name.lastIndexOf('.');
+ final int idx = name.lastIndexOf('.');
if (idx >= 0) {
name = name.substring(idx + 1);
}
}
- Rectangle2D bounds = fm.getStringBounds(name, g);
+ final Rectangle2D bounds = fm.getStringBounds(name, g);
g.setColor(Color.WHITE);
g.drawString(name,
(int) ((getWidth() - bounds.getWidth()) / 2),
@@ -801,7 +801,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
<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) {
+ public void reshape(final int x, final int y, final int width, final int height) {
synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
super.reshape(x, y, width, height);
reshapeImpl(width, height);
@@ -845,7 +845,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* canvas from interfering with the OpenGL rendering.
*/
@Override
- public void update(Graphics g) {
+ public void update(final Graphics g) {
paint(g);
}
@@ -855,7 +855,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
private AWTTilePainter printAWTTiles = null;
@Override
- public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
@@ -960,7 +960,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
};
@Override
- public void print(Graphics graphics) {
+ public void print(final Graphics graphics) {
if( !printActive || null == printGLAD ) {
throw new IllegalStateException("setupPrint() not called");
}
@@ -994,7 +994,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
printAWTTiles.resetGraphics2D();
}
}
- } catch (NoninvertibleTransformException nte) {
+ } catch (final NoninvertibleTransformException nte) {
System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
nte.printStackTrace();
}
@@ -1004,12 +1004,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void addGLEventListener(GLEventListener listener) {
+ public void addGLEventListener(final GLEventListener listener) {
helper.addGLEventListener(listener);
}
@Override
- public void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
+ public void addGLEventListener(final int index, final GLEventListener listener) throws IndexOutOfBoundsException {
helper.addGLEventListener(index, listener);
}
@@ -1019,7 +1019,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+ public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
@@ -1029,29 +1029,29 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean getGLEventListenerInitState(GLEventListener listener) {
+ public boolean getGLEventListenerInitState(final GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
@Override
- public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
@Override
- public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+ public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
Threading.invoke(true, r, getTreeLock());
return r.listener;
}
@Override
- public GLEventListener removeGLEventListener(GLEventListener listener) {
+ public GLEventListener removeGLEventListener(final GLEventListener listener) {
return helper.removeGLEventListener(listener);
}
@Override
- public void setAnimator(GLAnimatorControl animatorControl) {
+ public void setAnimator(final GLAnimatorControl animatorControl) {
helper.setAnimator(animatorControl);
}
@@ -1061,7 +1061,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final Thread setExclusiveContextThread(Thread t) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t) throws GLException {
return helper.setExclusiveContextThread(t, context);
}
@@ -1071,7 +1071,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean invoke(boolean wait, GLRunnable glRunnable) {
+ public boolean invoke(final boolean wait, final GLRunnable glRunnable) {
return helper.invoke(this, wait, glRunnable);
}
@@ -1081,7 +1081,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+ public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
final RecursiveLock _lock = lock;
_lock.lock();
try {
@@ -1114,7 +1114,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GL setGL(GL gl) {
+ public GL setGL(final GL gl) {
final GLContext _context = context;
if (_context != null) {
_context.setGL(gl);
@@ -1125,7 +1125,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
@Override
- public void setAutoSwapBufferMode(boolean onOrOff) {
+ public void setAutoSwapBufferMode(final boolean onOrOff) {
helper.setAutoSwapBufferMode(onOrOff);
}
@@ -1140,7 +1140,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setContextCreationFlags(int flags) {
+ public void setContextCreationFlags(final int flags) {
additionalCtxCreationFlags = flags;
final GLContext _context = context;
if(null != _context) {
@@ -1263,7 +1263,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if(DEBUG) {
System.err.println(getThreadName()+": destroyOnEDTAction() - post ctx: "+context);
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -1327,7 +1327,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
} else {
adeviceMsg = null;
}
- boolean closed = adevice.close();
+ final boolean closed = adevice.close();
if(DEBUG) {
System.err.println(getThreadName()+": GLCanvas.disposeJAWTWindowAndAWTDeviceOnEDT(): post GraphicsDevice: "+adeviceMsg+", result: "+closed);
}
@@ -1393,7 +1393,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
private class DisposeGLEventListenerAction implements Runnable {
GLEventListener listener;
private final boolean remove;
- private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+ private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
this.listener = listener;
this.remove = remove;
}
@@ -1431,16 +1431,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
clazz.getDeclaredMethod("disableBackgroundErase",
new Class[] { Canvas.class });
disableBackgroundEraseMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
clazz = clazz.getSuperclass();
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
}
return null;
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
}
disableBackgroundEraseInitialized = true;
if(DEBUG) {
@@ -1452,7 +1452,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
Throwable t=null;
try {
disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
- } catch (Exception e) {
+ } catch (final Exception e) {
t = e;
}
if(DEBUG) {
@@ -1498,7 +1498,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
- AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
+ final AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen,
capsRequested,
chooser, aScreen, VisualIDHolder.VID_UNDEFINED);
@@ -1506,9 +1506,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
});
config = ( bucket.size() > 0 ) ? bucket.get(0) : null ;
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new GLException(e);
}
}
@@ -1525,7 +1525,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
/**
* A most simple JOGL AWT test entry
*/
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
// System.err.println(NativeWindowVersion.getInstance());
@@ -1542,16 +1542,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
glCanvas.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLInfo(gl, null));
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
@Override
- public void display(GLAutoDrawable drawable) { }
+ public void display(final GLAutoDrawable drawable) { }
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
});
try {
@@ -1560,7 +1560,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void run() {
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
glCanvas.display();
@@ -1570,7 +1570,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void run() {
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
}
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 558970df6..eca99c6c0 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -96,6 +96,7 @@ import jogamp.opengl.awt.AWTTilePainter;
import jogamp.opengl.awt.Java2D;
import jogamp.opengl.util.glsl.GLSLTextureRaster;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.awt.AWTEDTExecutor;
import com.jogamp.nativewindow.awt.AWTPrintLifecycle;
import com.jogamp.nativewindow.awt.AWTWindowClosingProtocol;
@@ -190,11 +191,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
static {
Debug.initSingleton();
DEBUG = Debug.debug("GLJPanel");
- DEBUG_VIEWPORT = Debug.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
- USE_GLSL_TEXTURE_RASTERIZER = !Debug.isPropertyDefined("jogl.gljpanel.noglsl", true);
- SKIP_VERTICAL_FLIP_DEFAULT = Debug.isPropertyDefined("jogl.gljpanel.noverticalflip", true);
- boolean enabled = Debug.getBooleanProperty("sun.java2d.opengl", false);
- java2dOGLEnabledByProp = enabled && !Debug.isPropertyDefined("jogl.gljpanel.noogl", true);
+ DEBUG_VIEWPORT = PropertyAccess.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
+ USE_GLSL_TEXTURE_RASTERIZER = !PropertyAccess.isPropertyDefined("jogl.gljpanel.noglsl", true);
+ SKIP_VERTICAL_FLIP_DEFAULT = PropertyAccess.isPropertyDefined("jogl.gljpanel.noverticalflip", true);
+ boolean enabled = PropertyAccess.getBooleanProperty("sun.java2d.opengl", false);
+ java2dOGLEnabledByProp = enabled && !PropertyAccess.isPropertyDefined("jogl.gljpanel.noogl", true);
enabled = false;
if( java2dOGLEnabledByProp ) {
@@ -281,7 +282,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private volatile boolean isShowing;
private final HierarchyListener hierarchyListener = new HierarchyListener() {
@Override
- public void hierarchyChanged(HierarchyEvent e) {
+ public void hierarchyChanged(final HierarchyEvent e) {
isShowing = GLJPanel.this.isShowing();
}
};
@@ -308,7 +309,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
selection mechanism.
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
*/
- public GLJPanel(GLCapabilitiesImmutable userCapsRequest) throws GLException {
+ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest) throws GLException {
this(userCapsRequest, null, null);
}
@@ -320,7 +321,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
is used if null is passed for this argument.
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
*/
- public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser)
+ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser)
throws GLException
{
this(userCapsRequest, chooser, null);
@@ -343,7 +344,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* @deprecated Use {@link #GLJPanel(GLCapabilitiesImmutable, GLCapabilitiesChooser)}
* and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
*/
- public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser, GLContext shareWith)
+ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser, final GLContext shareWith)
throws GLException
{
super();
@@ -393,7 +394,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* <p>
* @param offthread
*/
- public final boolean initializeBackend(boolean offthread) {
+ public final boolean initializeBackend(final boolean offthread) {
if( offthread ) {
new Thread(getThreadName()+"-GLJPanel_Init") {
public void run() {
@@ -412,12 +413,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.getContext(), sharedContext);
}
@Override
- public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
helper.setSharedAutoDrawable(this, sharedAutoDrawable);
}
@@ -428,7 +429,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* @throws IllegalArgumentException if <code>custom</code> is <code>null</code>
* @throws IllegalStateException if backend is already realized, i.e. this instanced already painted once.
*/
- public void setPixelBufferProvider(AWTGLPixelBufferProvider custom) throws IllegalArgumentException, IllegalStateException {
+ public void setPixelBufferProvider(final AWTGLPixelBufferProvider custom) throws IllegalArgumentException, IllegalStateException {
if( null == custom ) {
throw new IllegalArgumentException("Null PixelBufferProvider");
}
@@ -454,7 +455,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// so do everything on the event dispatch thread
try {
EventQueue.invokeAndWait(paintImmediatelyAction);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new GLException(e);
}
}
@@ -469,7 +470,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (backend != null && backend.getContext() != null) {
boolean animatorPaused = false;
- GLAnimatorControl animator = getAnimator();
+ final GLAnimatorControl animator = getAnimator();
if(null!=animator) {
animatorPaused = animator.pause();
}
@@ -517,16 +518,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// Make GLJPanel behave better in NetBeans GUI builder
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
- FontMetrics fm = g.getFontMetrics();
+ final FontMetrics fm = g.getFontMetrics();
String name = getName();
if (name == null) {
name = getClass().getName();
- int idx = name.lastIndexOf('.');
+ final int idx = name.lastIndexOf('.');
if (idx >= 0) {
name = name.substring(idx + 1);
}
}
- Rectangle2D bounds = fm.getStringBounds(name, g);
+ final Rectangle2D bounds = fm.getStringBounds(name, g);
g.setColor(Color.WHITE);
g.drawString(name,
(int) ((getWidth() - bounds.getWidth()) / 2),
@@ -647,7 +648,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
*/
@SuppressWarnings("deprecation")
@Override
- public void reshape(int x, int y, int width, int height) {
+ public void reshape(final int x, final int y, final int width, final int height) {
super.reshape(x, y, width, height);
reshapeImpl(width, height);
}
@@ -675,7 +676,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private AWTTilePainter printAWTTiles = null;
@Override
- public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
@@ -802,7 +803,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
};
@Override
- public void print(Graphics graphics) {
+ public void print(final Graphics graphics) {
if( !printActive ) {
throw new IllegalStateException("setupPrint() not called");
}
@@ -837,7 +838,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
printAWTTiles.resetGraphics2D();
}
}
- } catch (NoninvertibleTransformException nte) {
+ } catch (final NoninvertibleTransformException nte) {
System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
nte.printStackTrace();
}
@@ -846,7 +847,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
@Override
- protected void printComponent(Graphics g) {
+ protected void printComponent(final Graphics g) {
if( DEBUG ) {
System.err.println("AWT printComponent.X: "+printAWTTiles);
}
@@ -854,7 +855,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setOpaque(boolean opaque) {
+ public void setOpaque(final boolean opaque) {
if (backend != null) {
backend.setOpaque(opaque);
}
@@ -862,12 +863,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void addGLEventListener(GLEventListener listener) {
+ public void addGLEventListener(final GLEventListener listener) {
helper.addGLEventListener(listener);
}
@Override
- public void addGLEventListener(int index, GLEventListener listener) {
+ public void addGLEventListener(final int index, final GLEventListener listener) {
helper.addGLEventListener(index, listener);
}
@@ -877,7 +878,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+ public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
@@ -887,17 +888,17 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean getGLEventListenerInitState(GLEventListener listener) {
+ public boolean getGLEventListenerInitState(final GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
@Override
- public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
@Override
- public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+ public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
if (EventQueue.isDispatchThread()) {
r.run();
@@ -906,7 +907,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// so do everything on the event dispatch thread
try {
EventQueue.invokeAndWait(r);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new GLException(e);
}
}
@@ -914,12 +915,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLEventListener removeGLEventListener(GLEventListener listener) {
+ public GLEventListener removeGLEventListener(final GLEventListener listener) {
return helper.removeGLEventListener(listener);
}
@Override
- public void setAnimator(GLAnimatorControl animatorControl) {
+ public void setAnimator(final GLAnimatorControl animatorControl) {
helper.setAnimator(animatorControl);
}
@@ -929,7 +930,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final Thread setExclusiveContextThread(Thread t) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t) throws GLException {
return helper.setExclusiveContextThread(t, getContext());
}
@@ -939,7 +940,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean invoke(boolean wait, GLRunnable glRunnable) {
+ public boolean invoke(final boolean wait, final GLRunnable glRunnable) {
return helper.invoke(this, wait, glRunnable);
}
@@ -949,7 +950,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
final Backend b = backend;
if ( null == b ) {
return null;
@@ -958,7 +959,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setRealized(boolean realized) {
+ public void setRealized(final boolean realized) {
}
@Override
@@ -967,7 +968,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+ public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
final Backend b = backend;
if ( null == b ) {
return null;
@@ -1002,13 +1003,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (Beans.isDesignTime()) {
return null;
}
- GLContext context = getContext();
+ final GLContext context = getContext();
return (context == null) ? null : context.getGL();
}
@Override
- public GL setGL(GL gl) {
- GLContext context = getContext();
+ public GL setGL(final GL gl) {
+ final GLContext context = getContext();
if (context != null) {
context.setGL(gl);
return gl;
@@ -1017,7 +1018,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setAutoSwapBufferMode(boolean enable) {
+ public void setAutoSwapBufferMode(final boolean enable) {
this.autoSwapBufferMode = enable;
boolean backendHandlesSwapBuffer = false;
if( isInitialized ) {
@@ -1047,7 +1048,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setContextCreationFlags(int flags) {
+ public void setContextCreationFlags(final int flags) {
additionalCtxCreationFlags = flags;
}
@@ -1111,7 +1112,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* See constraints of {@link #isGLOriented()}.
* </p>
*/
- public final void setSkipGLOrientationVerticalFlip(boolean v) {
+ public final void setSkipGLOrientationVerticalFlip(final boolean v) {
skipGLOrientationVerticalFlip = v;
}
/** See {@link #setSkipGLOrientationVerticalFlip(boolean)}. */
@@ -1186,7 +1187,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* @param v requested texture unit
* @see #getTextureUnit()
*/
- public final void setTextureUnit(int v) {
+ public final void setTextureUnit(final int v) {
requestedTextureUnit = v;
}
@@ -1244,7 +1245,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return awtWindowClosingProtocol.setDefaultCloseOperation(op);
}
@@ -1265,12 +1266,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
class Updater implements GLEventListener {
private Graphics g;
- public void setGraphics(Graphics g) {
+ public void setGraphics(final Graphics g) {
this.g = g;
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if (!backend.preGL(g)) {
return;
}
@@ -1279,12 +1280,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
helper.disposeAllGLEventListener(GLJPanel.this, false);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if (!backend.preGL(g)) {
return;
}
@@ -1300,12 +1301,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
backend.postGL(g, true);
}
- public void plainPaint(GLAutoDrawable drawable) {
+ public void plainPaint(final GLAutoDrawable drawable) {
helper.display(GLJPanel.this);
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
// This is handled above and dispatched directly to the appropriate context
}
}
@@ -1329,7 +1330,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// so we can continue with the destruction.
try {
helper.disposeGL(GLJPanel.this, _context, !backendDestroy);
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -1373,7 +1374,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private class DisposeGLEventListenerAction implements Runnable {
GLEventListener listener;
private final boolean remove;
- private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+ private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
this.listener = listener;
this.remove = remove;
}
@@ -1387,8 +1388,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
};
- private int getGLInteger(GL gl, int which) {
- int[] tmp = new int[1];
+ private int getGLInteger(final GL gl, final int which) {
+ final int[] tmp = new int[1];
gl.glGetIntegerv(which, tmp, 0);
return tmp[0];
}
@@ -1507,7 +1508,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// For saving/restoring of OpenGL state during ReadPixels
private final GLPixelStorageModes psm = new GLPixelStorageModes();
- OffscreenBackend(GLProfile glp, AWTGLPixelBufferProvider custom) {
+ OffscreenBackend(final GLProfile glp, final AWTGLPixelBufferProvider custom) {
if(null == custom) {
pixelBufferProvider = getSingleAWTGLPixelBufferProvider();
} else {
@@ -1543,7 +1544,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if( DEBUG ) {
offscreenDrawable.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
@Override
- public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
System.err.println(getThreadName()+": OffscreenBackend.swapBuffers - frameCount "+frameCount);
} } );
}
@@ -1577,7 +1578,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
glslTextureRaster = new GLSLTextureRaster(fboDrawable.getTextureUnit(), true);
glslTextureRaster.init(gl.getGL2ES2());
glslTextureRaster.reshape(gl.getGL2ES2(), 0, 0, fboDrawable.getSurfaceWidth(), fboDrawable.getSurfaceHeight());
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
if(null != glslTextureRaster) {
glslTextureRaster.dispose(gl.getGL2ES2());
@@ -1659,7 +1660,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setOpaque(boolean opaque) {
+ public final void setOpaque(final boolean opaque) {
if ( opaque != isOpaque() && !useSingletonBuffer ) {
pixelBuffer.dispose();
pixelBuffer = null;
@@ -1668,7 +1669,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final boolean preGL(Graphics g) {
+ public final boolean preGL(final Graphics g) {
// Empty in this implementation
return true;
}
@@ -1687,7 +1688,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void postGL(Graphics g, boolean isDisplay) {
+ public final void postGL(final Graphics g, final boolean isDisplay) {
if (isDisplay) {
if(DEBUG) {
System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: - frameCount "+frameCount);
@@ -1871,7 +1872,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void doPaintComponent(Graphics g) {
+ public final void doPaintComponent(final Graphics g) {
helper.invokeGL(offscreenDrawable, offscreenContext, updaterDisplayAction, updaterInitAction);
if ( null != alignedImage ) {
@@ -1922,12 +1923,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final GLContext createContext(GLContext shareWith) {
+ public final GLContext createContext(final GLContext shareWith) {
return (null != offscreenDrawable) ? offscreenDrawable.createContext(shareWith) : null;
}
@Override
- public final void setContext(GLContext ctx) {
+ public final void setContext(final GLContext ctx) {
offscreenContext=(GLContextImpl)ctx;
}
@@ -2041,12 +2042,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setOpaque(boolean opaque) {
+ public final void setOpaque(final boolean opaque) {
// Empty in this implementation
}
@Override
- public final GLContext createContext(GLContext shareWith) {
+ public final GLContext createContext(final GLContext shareWith) {
if(null != shareWith) {
throw new GLException("J2DOGLBackend cannot create context w/ additional shared context, since it already needs to share the context w/ J2D.");
}
@@ -2054,7 +2055,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setContext(GLContext ctx) {
+ public final void setContext(final GLContext ctx) {
joglContext=ctx;
}
@@ -2090,11 +2091,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final boolean preGL(Graphics g) {
+ public final boolean preGL(final Graphics g) {
final GL2 gl = joglContext.getGL().getGL2();
// Set up needed state in JOGL context from Java2D context
- gl.glEnable(GL2.GL_SCISSOR_TEST);
- Rectangle r = Java2D.getOGLScissorBox(g);
+ gl.glEnable(GL.GL_SCISSOR_TEST);
+ final Rectangle r = Java2D.getOGLScissorBox(g);
if (r == null) {
if (DEBUG) {
@@ -2107,7 +2108,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
gl.glScissor(r.x, r.y, r.width, r.height);
- Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
+ final Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
// If the viewport X or Y changes, in addition to the panel's
// width or height, we need to send a reshape operation to the
// client
@@ -2132,13 +2133,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// The texture target for Java2D's OpenGL pipeline when using FBOs
// -- either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB
- int fboTextureTarget = Java2D.getOGLTextureType(g);
+ final int fboTextureTarget = Java2D.getOGLTextureType(g);
if (!checkedForFBObjectWorkarounds) {
checkedForFBObjectWorkarounds = true;
gl.glBindTexture(fboTextureTarget, 0);
- gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]);
- int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, frameBuffer[0]);
+ final int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
if (status != GL.GL_FRAMEBUFFER_COMPLETE) {
// Need to do workarounds
fbObjectWorkarounds = true;
@@ -2168,10 +2169,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
gl.glBindTexture(fboTextureTarget, frameBufferTexture[0]);
- int[] width = new int[1];
- int[] height = new int[1];
- gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_WIDTH, width, 0);
- gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_HEIGHT, height, 0);
+ final int[] width = new int[1];
+ final int[] height = new int[1];
+ gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2GL3.GL_TEXTURE_WIDTH, width, 0);
+ gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2GL3.GL_TEXTURE_HEIGHT, height, 0);
gl.glGenRenderbuffers(1, frameBufferDepthBuffer, 0);
if (DEBUG) {
@@ -2181,9 +2182,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, frameBufferDepthBuffer[0]);
// FIXME: may need a loop here like in Java2D
- gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL2GL3.GL_DEPTH_COMPONENT24, width[0], height[0]);
+ gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL.GL_DEPTH_COMPONENT24, width[0], height[0]);
- gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0);
+ gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, 0);
createNewDepthBuffer = false;
}
@@ -2207,7 +2208,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
if (DEBUG) {
- int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
+ final int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
if (status != GL.GL_FRAMEBUFFER_COMPLETE) {
throw new GLException("Error: framebuffer was incomplete: status = 0x" +
Integer.toHexString(status));
@@ -2240,11 +2241,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void postGL(Graphics g, boolean isDisplay) {
+ public final void postGL(final Graphics g, final boolean isDisplay) {
// Cause OpenGL pipeline to flush its results because
// otherwise it's possible we will buffer up multiple frames'
// rendering results, resulting in apparent mouse lag
- GL gl = joglContext.getGL();
+ final GL gl = joglContext.getGL();
gl.glFinish();
if (Java2D.isFBOEnabled() &&
@@ -2308,7 +2309,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// FIXME: add more checks?
j2dContext.makeCurrent();
- GL gl = j2dContext.getGL();
+ final GL gl = j2dContext.getGL();
if ((getGLInteger(gl, GL.GL_RED_BITS) < offscreenCaps.getRedBits()) ||
(getGLInteger(gl, GL.GL_GREEN_BITS) < offscreenCaps.getGreenBits()) ||
(getGLInteger(gl, GL.GL_BLUE_BITS) < offscreenCaps.getBlueBits()) ||
@@ -2346,7 +2347,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
try {
captureJ2DState(j2dContext.getGL(), g);
- Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
+ final Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
if (curSurface != null) {
if (j2dSurface != curSurface) {
if (joglContext != null) {
@@ -2362,7 +2363,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
j2dSurface = curSurface;
if (DEBUG) {
System.err.print(getThreadName()+": Surface type: ");
- int surfaceType = Java2D.getOGLSurfaceType(g);
+ final int surfaceType = Java2D.getOGLSurfaceType(g);
if (surfaceType == Java2D.UNDEFINED) {
System.err.println("UNDEFINED");
} else if (surfaceType == Java2D.WINDOW) {
@@ -2381,7 +2382,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
if (joglContext == null) {
- AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+ final AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
if (factory.canCreateExternalGLDrawable(device)) {
joglDrawable = factory.createExternalGLDrawable();
joglContext = joglDrawable.createContext(j2dContext);
@@ -2410,9 +2411,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);
}
- private final void captureJ2DState(GL gl, Graphics g) {
- gl.glGetIntegerv(GL2.GL_DRAW_BUFFER, drawBuffer, 0);
- gl.glGetIntegerv(GL2.GL_READ_BUFFER, readBuffer, 0);
+ private final void captureJ2DState(final GL gl, final Graphics g) {
+ gl.glGetIntegerv(GL2GL3.GL_DRAW_BUFFER, drawBuffer, 0);
+ gl.glGetIntegerv(GL2ES3.GL_READ_BUFFER, readBuffer, 0);
if (Java2D.isFBOEnabled() &&
Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) {
gl.glGetIntegerv(GL.GL_FRAMEBUFFER_BINDING, frameBuffer, 0);
@@ -2446,7 +2447,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (!checkedGLVendor) {
checkedGLVendor = true;
- String vendor = gl.glGetString(GL.GL_VENDOR);
+ final String vendor = gl.glGetString(GL.GL_VENDOR);
if ((vendor != null) &&
vendor.startsWith("ATI")) {