diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLDrawableFactory.java')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 077daf6e9..6e7caf8f8 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -43,6 +43,7 @@ package javax.media.opengl; import java.util.ArrayList; import java.util.List; +import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; import com.jogamp.opengl.GLAutoDrawableDelegate; import com.jogamp.opengl.GLRendererQuirks; @@ -142,8 +143,8 @@ public abstract class GLDrawableFactory { final String nwt = NativeWindowFactory.getNativeWindowType(true); GLDrawableFactory tmp = null; - String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true); - ClassLoader cl = GLDrawableFactory.class.getClassLoader(); + String factoryClassName = PropertyAccess.getProperty("jogl.gldrawablefactory.class.name", true); + final ClassLoader cl = GLDrawableFactory.class.getClassLoader(); if (null == factoryClassName) { if ( nwt == NativeWindowFactory.TYPE_X11 ) { factoryClassName = "jogamp.opengl.x11.glx.X11GLXDrawableFactory"; @@ -164,7 +165,7 @@ public abstract class GLDrawableFactory { } try { tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName, cl); - } catch (Exception jre) { + } catch (final Exception jre) { if (DEBUG || GLProfile.DEBUG) { System.err.println("Info: GLDrawableFactory.static - Native Platform: "+nwt+" - not available: "+factoryClassName); jre.printStackTrace(); @@ -179,7 +180,7 @@ public abstract class GLDrawableFactory { if(!disableOpenGLES) { try { tmp = (GLDrawableFactory) ReflectionUtil.createInstance("jogamp.opengl.egl.EGLDrawableFactory", cl); - } catch (Exception jre) { + } catch (final Exception jre) { if (DEBUG || GLProfile.DEBUG) { System.err.println("Info: GLDrawableFactory.static - EGLDrawableFactory - not available"); jre.printStackTrace(); @@ -221,7 +222,7 @@ public abstract class GLDrawableFactory { try { gldf.resetDisplayGamma(); gldf.shutdownImpl(); - } catch (Throwable t) { + } catch (final Throwable t) { System.err.println("GLDrawableFactory.shutdownImpl: Caught "+t.getClass().getName()+" during factory shutdown #"+(i+1)+"/"+gldfCount+" "+gldf.getClass().getName()); if( DEBUG ) { t.printStackTrace(); @@ -322,7 +323,7 @@ public abstract class GLDrawableFactory { * @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device. * @return true if a shared resource could been created, otherwise false. */ - protected final boolean createSharedResource(AbstractGraphicsDevice device) { + protected final boolean createSharedResource(final AbstractGraphicsDevice device) { return createSharedResourceImpl(device); } protected abstract boolean createSharedResourceImpl(AbstractGraphicsDevice device); @@ -343,7 +344,7 @@ public abstract class GLDrawableFactory { * @see #getRendererQuirks(AbstractGraphicsDevice) * @see GLRendererQuirks */ - public final boolean hasRendererQuirk(AbstractGraphicsDevice device, int quirk) { + public final boolean hasRendererQuirk(final AbstractGraphicsDevice device, final int quirk) { final GLRendererQuirks glrq = getRendererQuirks(device); return null != glrq ? glrq.exist(quirk) : false; } @@ -385,11 +386,11 @@ public abstract class GLDrawableFactory { * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory, * or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL. */ - public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException { + public static GLDrawableFactory getFactory(final GLProfile glProfile) throws GLException { return getFactoryImpl(glProfile.getImplName()); } - protected static GLDrawableFactory getFactoryImpl(String glProfileImplName) throws GLException { + protected static GLDrawableFactory getFactoryImpl(final String glProfileImplName) throws GLException { if ( GLProfile.usesNativeGLES(glProfileImplName) ) { if(null!=eglFactory) { return eglFactory; @@ -400,7 +401,7 @@ public abstract class GLDrawableFactory { throw new GLException("No GLDrawableFactory available for profile: "+glProfileImplName); } - protected static GLDrawableFactory getFactoryImpl(AbstractGraphicsDevice device) throws GLException { + protected static GLDrawableFactory getFactoryImpl(final AbstractGraphicsDevice device) throws GLException { if(null != nativeOSFactory && nativeOSFactory.getIsDeviceCompatible(device)) { return nativeOSFactory; } |