From 556d92b63555a085b25e32b1cd55afce24edd07a Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Thu, 3 Jul 2014 16:21:36 +0200
Subject: 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
---
.../classes/jogamp/nativewindow/Debug.java | 4 +-
.../DefaultGraphicsConfigurationFactoryImpl.java | 2 +-
.../nativewindow/NativeWindowFactoryImpl.java | 8 +--
.../jogamp/nativewindow/ProxySurfaceImpl.java | 24 +++----
.../nativewindow/SharedResourceToolkitLock.java | 8 +--
.../jogamp/nativewindow/SurfaceScaleUtils.java | 2 +-
.../jogamp/nativewindow/SurfaceUpdatedHelper.java | 10 +--
.../jogamp/nativewindow/WrappedSurface.java | 6 +-
.../classes/jogamp/nativewindow/WrappedWindow.java | 12 ++--
.../classes/jogamp/nativewindow/awt/AWTMisc.java | 18 +++---
.../jogamp/nativewindow/jawt/JAWTJNILibLoader.java | 2 +-
.../classes/jogamp/nativewindow/jawt/JAWTUtil.java | 73 +++++++++++-----------
.../nativewindow/jawt/macosx/MacOSXJAWTWindow.java | 30 ++++-----
.../jawt/windows/Win32SunJDKReflection.java | 14 ++---
.../jawt/windows/WindowsJAWTWindow.java | 9 +--
.../nativewindow/jawt/x11/X11JAWTWindow.java | 9 +--
.../nativewindow/jawt/x11/X11SunJDKReflection.java | 14 ++---
.../macosx/OSXDummyUpstreamSurfaceHook.java | 8 +--
.../jogamp/nativewindow/macosx/OSXUtil.java | 28 ++++-----
.../windows/GDIDummyUpstreamSurfaceHook.java | 6 +-
.../jogamp/nativewindow/windows/GDISurface.java | 6 +-
.../jogamp/nativewindow/windows/GDIUtil.java | 10 +--
.../nativewindow/windows/RegisteredClass.java | 2 +-
.../windows/RegisteredClassFactory.java | 4 +-
.../jogamp/nativewindow/x11/X11Capabilities.java | 6 +-
.../x11/X11DummyUpstreamSurfaceHook.java | 6 +-
.../x11/X11GraphicsConfigurationFactory.java | 28 ++++-----
.../classes/jogamp/nativewindow/x11/X11Util.java | 44 ++++++-------
.../awt/X11AWTGraphicsConfigurationFactory.java | 10 +--
29 files changed, 205 insertions(+), 198 deletions(-)
(limited to 'src/nativewindow/classes/jogamp')
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
index b7197dbca..1c4874fba 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -63,7 +63,7 @@ public class Debug extends PropertyAccess {
verbose = isPropertyDefined("nativewindow.verbose", true);
debugAll = isPropertyDefined("nativewindow.debug", true);
if (verbose) {
- Package p = Package.getPackage("javax.media.nativewindow");
+ final Package p = Package.getPackage("javax.media.nativewindow");
System.err.println("NativeWindow specification version " + p.getSpecificationVersion());
System.err.println("NativeWindow implementation version " + p.getImplementationVersion());
System.err.println("NativeWindow implementation vendor " + p.getImplementationVendor());
@@ -81,7 +81,7 @@ public class Debug extends PropertyAccess {
return debugAll;
}
- public static final boolean debug(String subcomponent) {
+ public static final boolean debug(final String subcomponent) {
return debugAll() || isPropertyDefined("nativewindow.debug." + subcomponent, true);
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
index 8fb819251..6061c4e79 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -38,7 +38,7 @@ import javax.media.nativewindow.*;
public class DefaultGraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen screen, final int nativeVisualID) {
return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index e6b68f87b..40fca0f7b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -52,7 +52,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
// This subclass of NativeWindowFactory handles the case of
// NativeWindows being passed in
@Override
- protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
+ protected NativeWindow getNativeWindowImpl(final Object winObj, final AbstractGraphicsConfiguration config) throws IllegalArgumentException {
if (winObj instanceof NativeWindow) {
// Use the NativeWindow directly
return (NativeWindow) winObj;
@@ -73,7 +73,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
private Constructor> nativeWindowConstructor = null;
- private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
+ private NativeWindow getAWTNativeWindow(final Object winObj, final AbstractGraphicsConfiguration config) {
if (nativeWindowConstructor == null) {
try {
final String windowingType = getNativeWindowType(true);
@@ -96,14 +96,14 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
nativeWindowConstructor = ReflectionUtil.getConstructor(
windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class },
true, getClass().getClassLoader());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new IllegalArgumentException(e);
}
}
try {
return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
- } catch (Exception ie) {
+ } catch (final Exception ie) {
throw new IllegalArgumentException(ie);
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index 53daa2acd..deb685b51 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -55,7 +55,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise false
. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- protected ProxySurfaceImpl(AbstractGraphicsConfiguration cfg, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+ protected ProxySurfaceImpl(final AbstractGraphicsConfiguration cfg, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
if(null == cfg) {
throw new IllegalArgumentException("null AbstractGraphicsConfiguration");
}
@@ -81,7 +81,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
public final UpstreamSurfaceHook getUpstreamSurfaceHook() { return upstream; }
@Override
- public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook) {
+ public void setUpstreamSurfaceHook(final UpstreamSurfaceHook hook) {
if(null == hook) {
throw new IllegalArgumentException("null UpstreamSurfaceHook");
}
@@ -89,7 +89,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public final void enableUpstreamSurfaceHookLifecycle(boolean enable) {
+ public final void enableUpstreamSurfaceHookLifecycle(final boolean enable) {
upstreamSurfaceHookLifecycleEnabled = enable;
}
@@ -134,7 +134,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
+ public final void setGraphicsConfiguration(final AbstractGraphicsConfiguration cfg) {
config = cfg;
}
@@ -165,22 +165,22 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
}
@Override
- public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+ public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
}
@Override
- public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
}
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
}
@@ -287,15 +287,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
public final int getUpstreamOptionBits() { return implBitfield; }
@Override
- public final boolean containsUpstreamOptionBits(int v) {
+ public final boolean containsUpstreamOptionBits(final int v) {
return v == ( implBitfield & v ) ;
}
@Override
- public final void addUpstreamOptionBits(int v) { implBitfield |= v; }
+ public final void addUpstreamOptionBits(final int v) { implBitfield |= v; }
@Override
- public final void clearUpstreamOptionBits(int v) { implBitfield &= ~v; }
+ public final void clearUpstreamOptionBits(final int v) { implBitfield &= ~v; }
@Override
public StringBuilder toString(StringBuilder sink) {
@@ -316,7 +316,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
@Override
public String toString() {
- StringBuilder msg = new StringBuilder();
+ final StringBuilder msg = new StringBuilder();
msg.append(getClass().getSimpleName()).append("[ ");
toString(msg);
msg.append(" ]");
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
index 7b74e1f1f..d0174b2f5 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
@@ -58,7 +58,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
/**
* @return number of unclosed EGL Displays.
*/
- public static int shutdown(boolean verbose) {
+ public static int shutdown(final boolean verbose) {
if(DEBUG || verbose || handle2Lock.size() > 0 ) {
System.err.println("SharedResourceToolkitLock: Shutdown (open: "+handle2Lock.size()+")");
if(DEBUG) {
@@ -74,13 +74,13 @@ public class SharedResourceToolkitLock implements ToolkitLock {
public static void dumpOpenDisplayConnections() {
System.err.println("SharedResourceToolkitLock: Open ResourceToolkitLock's: "+handle2Lock.size());
int i=0;
- for(Iterator iter = handle2Lock.iterator(); iter.hasNext(); i++) {
+ for(final Iterator iter = handle2Lock.iterator(); iter.hasNext(); i++) {
final LongObjectHashMap.Entry e = iter.next();
System.err.println("SharedResourceToolkitLock: Open["+i+"]: "+e.value);
}
}
- public static final SharedResourceToolkitLock get(long handle) {
+ public static final SharedResourceToolkitLock get(final long handle) {
SharedResourceToolkitLock res;
synchronized(handle2Lock) {
res = (SharedResourceToolkitLock) handle2Lock.get(handle);
@@ -101,7 +101,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
private final long handle;
private volatile int refCount;
- private SharedResourceToolkitLock(long handle) {
+ private SharedResourceToolkitLock(final long handle) {
this.lock = LockFactory.createRecursiveLock();
this.handle = handle;
this.refCount = 0;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
index 3aea58852..73413cf59 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
@@ -62,7 +62,7 @@ public class SurfaceScaleUtils {
* @param DEBUG_PREFIX if set, dumps debug info on stderr using this prefix
* @return true if pixelScale has changed, otherwise false
*/
- public static boolean computePixelScale(int[] result, final int[] prePixelScale, final int[] reqPixelScale, final int[] newPixelScaleRaw, final String DEBUG_PREFIX) {
+ public static boolean computePixelScale(final int[] result, final int[] prePixelScale, final int[] reqPixelScale, final int[] newPixelScaleRaw, final String DEBUG_PREFIX) {
final int newPixelScaleSafeX = 0 < newPixelScaleRaw[0] ? newPixelScaleRaw[0] : ScalableSurface.IDENTITY_PIXELSCALE;
final int newPixelScaleSafeY = 0 < newPixelScaleRaw[1] ? newPixelScaleRaw[1] : ScalableSurface.IDENTITY_PIXELSCALE;
final boolean useHiDPI = ScalableSurface.IDENTITY_PIXELSCALE != reqPixelScale[0] || ScalableSurface.IDENTITY_PIXELSCALE != reqPixelScale[1];
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
index 0b033955e..a7e136f76 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
@@ -42,17 +42,17 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
// Management Utils
//
public final int size() { return surfaceUpdatedListeners.size(); }
- public final SurfaceUpdatedListener get(int i) { return surfaceUpdatedListeners.get(i); }
+ public final SurfaceUpdatedListener get(final int i) { return surfaceUpdatedListeners.get(i); }
//
// Implementation of NativeSurface SurfaceUpdatedListener methods
//
- public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
addSurfaceUpdatedListener(-1, l);
}
- public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l)
+ public final void addSurfaceUpdatedListener(int index, final SurfaceUpdatedListener l)
throws IndexOutOfBoundsException
{
if(l == null) {
@@ -67,7 +67,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
}
}
- public final boolean removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final boolean removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
if (l == null) {
return false;
}
@@ -79,7 +79,7 @@ public class SurfaceUpdatedHelper implements 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) {
if( isEmpty ) {
return;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index 752057a49..d3439b53f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -57,7 +57,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise false
. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle, int initialWidth, int initialHeight, boolean ownsDevice) {
+ public WrappedSurface(final AbstractGraphicsConfiguration cfg, final long handle, final int initialWidth, final int initialHeight, final boolean ownsDevice) {
super(cfg, new UpstreamSurfaceHookMutableSize(initialWidth, initialHeight), ownsDevice);
surfaceHandle=handle;
}
@@ -70,7 +70,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise false
.
*/
- public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+ public WrappedSurface(final AbstractGraphicsConfiguration cfg, final long handle, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
super(cfg, upstream, ownsDevice);
surfaceHandle=handle;
}
@@ -88,7 +88,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface
}
@Override
- public final void setSurfaceHandle(long surfaceHandle) {
+ public final void setSurfaceHandle(final long surfaceHandle) {
this.surfaceHandle=surfaceHandle;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
index 949243b0d..fd39a3b4a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
@@ -32,10 +32,10 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise false
. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- public WrappedWindow(AbstractGraphicsConfiguration cfg, long surfaceHandle,
- int initialWinX, int initialWinY, int initialWinWidth, int initialWinHeight,
- int initialPixelWidth, int initialPixelHeight,
- boolean ownsDevice, long windowHandle) {
+ public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle,
+ final int initialWinX, final int initialWinY, final int initialWinWidth, final int initialWinHeight,
+ final int initialPixelWidth, final int initialPixelHeight,
+ final boolean ownsDevice, final long windowHandle) {
this(cfg, surfaceHandle,
new UpstreamWindowHookMutableSizePos(initialWinX, initialWinY, initialWinWidth, initialWinHeight,
initialPixelWidth, initialPixelHeight),
@@ -50,7 +50,7 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise false
.
*/
- public WrappedWindow(AbstractGraphicsConfiguration cfg, long surfaceHandle, UpstreamWindowHookMutableSizePos upstream, boolean ownsDevice, long windowHandle) {
+ public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle, final UpstreamWindowHookMutableSizePos upstream, final boolean ownsDevice, final long windowHandle) {
super(cfg, surfaceHandle, upstream, ownsDevice);
this.windowHandle = windowHandle;
}
@@ -105,7 +105,7 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
}
@Override
- public Point getLocationOnScreen(Point point) {
+ public Point getLocationOnScreen(final Point point) {
if(null!=point) {
return point;
} else {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
index b2067c143..b0eda63b6 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
@@ -95,7 +95,7 @@ public class AWTMisc {
* @param topLevelOnly if true only returns insets of top-level components, i.e. Window and JRootPanel,
* otherwise for JComponent as well.
*/
- public static Insets getInsets(Component c, boolean topLevelOnly) {
+ public static Insets getInsets(final Component c, final boolean topLevelOnly) {
if( c instanceof Window ) {
return ((Window)c).getInsets();
}
@@ -119,7 +119,7 @@ public class AWTMisc {
public void run(Component c);
}
- public static int performAction(Container c, Class> cType, ComponentAction action) {
+ public static int performAction(final Container c, final Class> cType, final ComponentAction action) {
int count = 0;
final int cc = c.getComponentCount();
for(int i=0; i= 0;
+ return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+ PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;
}
/**
* Returns true if this platform's JAWT implementation requires using offscreen layer.
*/
public static boolean isOffscreenLayerRequired() {
- return Platform.OS_TYPE == Platform.OSType.MACOS &&
- Platform.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
+ return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+ PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
}
/**
@@ -218,14 +221,14 @@ public class JAWTUtil {
*/
public static int getOSXCALayerQuirks() {
int res = 0;
- if( Platform.OS_TYPE == Platform.OSType.MACOS &&
- Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
+ if( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+ PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
/** Knowing impl. all expose the SIZE bug */
res |= JAWT_OSX_CALAYER_QUIRK_SIZE;
- final int c = Platform.JAVA_VERSION_NUMBER.compareTo(Platform.Version17);
- if( c < 0 || c == 0 && Platform.JAVA_VERSION_UPDATE < 40 ) {
+ final int c = PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(PlatformPropsImpl.Version17);
+ if( c < 0 || c == 0 && PlatformPropsImpl.JAVA_VERSION_UPDATE < 40 ) {
res |= JAWT_OSX_CALAYER_QUIRK_POSITION;
} else {
res |= JAWT_OSX_CALAYER_QUIRK_LAYOUT;
@@ -238,9 +241,9 @@ public class JAWTUtil {
* @param useOffscreenLayerIfAvailable
* @return
*/
- public static JAWT getJAWT(boolean useOffscreenLayerIfAvailable) {
+ public static JAWT getJAWT(final boolean useOffscreenLayerIfAvailable) {
final int jawt_version_flags = JAWTFactory.JAWT_VERSION_1_4;
- JAWT jawt = JAWT.create();
+ final JAWT jawt = JAWT.create();
// default queries
boolean tryOffscreenLayer;
@@ -248,24 +251,24 @@ public class JAWTUtil {
int jawt_version_flags_offscreen = jawt_version_flags;
if(isOffscreenLayerRequired()) {
- if(Platform.OS_TYPE == Platform.OSType.MACOS) {
- if(Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
+ if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) {
+ if(PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER;
tryOffscreenLayer = true;
tryOnscreen = false;
} else {
- throw new RuntimeException("OSX: Invalid version of Java ("+Platform.JAVA_VERSION_NUMBER+") / OS X ("+Platform.OS_VERSION_NUMBER+")");
+ throw new RuntimeException("OSX: Invalid version of Java ("+PlatformPropsImpl.JAVA_VERSION_NUMBER+") / OS X ("+PlatformPropsImpl.OS_VERSION_NUMBER+")");
}
} else {
- throw new InternalError("offscreen required, but n/a for: "+Platform.OS_TYPE);
+ throw new InternalError("offscreen required, but n/a for: "+PlatformPropsImpl.OS_TYPE);
}
} else if(useOffscreenLayerIfAvailable && isOffscreenLayerSupported()) {
- if(Platform.OS_TYPE == Platform.OSType.MACOS) {
+ if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) {
jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER;
tryOffscreenLayer = true;
tryOnscreen = true;
} else {
- throw new InternalError("offscreen requested and supported, but n/a for: "+Platform.OS_TYPE);
+ throw new InternalError("offscreen requested and supported, but n/a for: "+PlatformPropsImpl.OS_TYPE);
}
} else {
tryOffscreenLayer = false;
@@ -275,7 +278,7 @@ public class JAWTUtil {
System.err.println("JAWTUtil.getJAWT(tryOffscreenLayer "+tryOffscreenLayer+", tryOnscreen "+tryOnscreen+")");
}
- StringBuilder errsb = new StringBuilder();
+ final StringBuilder errsb = new StringBuilder();
if(tryOffscreenLayer) {
errsb.append("Offscreen 0x").append(Integer.toHexString(jawt_version_flags_offscreen));
if( JAWT.getJAWT(jawt, jawt_version_flags_offscreen) ) {
@@ -294,12 +297,12 @@ public class JAWTUtil {
throw new RuntimeException("Unable to initialize JAWT, trials: "+errsb.toString());
}
- public static boolean isJAWTUsingOffscreenLayer(JAWT jawt) {
+ public static boolean isJAWTUsingOffscreenLayer(final JAWT jawt) {
return 0 != ( jawt.getCachedVersion() & JAWTUtil.JAWT_MACOSX_USE_CALAYER );
}
static {
- SKIP_AWT_HIDPI = Debug.isPropertyDefined("nativewindow.awt.nohidpi", true);
+ SKIP_AWT_HIDPI = PropertyAccess.isPropertyDefined("nativewindow.awt.nohidpi", true);
if(DEBUG) {
System.err.println("JAWTUtil initialization (JAWT/JNI/...); SKIP_AWT_HIDPI "+SKIP_AWT_HIDPI);
@@ -321,7 +324,7 @@ public class JAWTUtil {
} else {
// Non-headless case
JAWTJNILibLoader.initSingleton(); // load libjawt.so
- if(!JAWTJNILibLoader.loadNativeWindow("awt")) { // load libnativewindow_awt.so
+ if(!NWJNILibLoader.loadNativeWindow("awt")) { // load libnativewindow_awt.so
throw new NativeWindowException("NativeWindow AWT native library load error.");
}
jawtLockObject = getJAWT(false); // don't care for offscreen layer here
@@ -333,15 +336,15 @@ public class JAWTUtil {
java2DClass = Class.forName("jogamp.opengl.awt.Java2D");
isQueueFlusherThreadTmp = java2DClass.getMethod("isQueueFlusherThread", (Class[])null);
j2dExistTmp = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
}
isQueueFlusherThread = isQueueFlusherThreadTmp;
j2dExist = j2dExistTmp;
- PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction
*/
@Override
- public final void setSurfaceHandle(long surfaceHandle) {
+ public final void setSurfaceHandle(final long surfaceHandle) {
this.windowHandle = surfaceHandle;
}
/**
* Sets the window handle (HWND).
*/
- public final void setWindowHandle(long windowHandle) {
+ public final void setWindowHandle(final long windowHandle) {
this.windowHandle = windowHandle;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
index 720ff9bdb..8203a804b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
@@ -93,7 +93,7 @@ public class GDIUtil implements ToolkitProperties {
private static RegisteredClass dummyWindowClass = null;
private static Object dummyWindowSync = new Object();
- public static long CreateDummyWindow(int x, int y, int width, int height) {
+ public static long CreateDummyWindow(final int x, final int y, final int width, final int height) {
synchronized(dummyWindowSync) {
dummyWindowClass = dummyWindowClassFactory.getSharedClass();
if(DEBUG) {
@@ -104,7 +104,7 @@ public class GDIUtil implements ToolkitProperties {
}
}
- public static boolean DestroyDummyWindow(long hwnd) {
+ public static boolean DestroyDummyWindow(final long hwnd) {
boolean res;
synchronized(dummyWindowSync) {
if( null == dummyWindowClass ) {
@@ -116,15 +116,15 @@ public class GDIUtil implements ToolkitProperties {
return res;
}
- public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) {
+ public static Point GetRelativeLocation(final long src_win, final long dest_win, final int src_x, final int src_y) {
return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y);
}
- public static boolean IsUndecorated(long win) {
+ public static boolean IsUndecorated(final long win) {
return IsUndecorated0(win);
}
- public static boolean IsChild(long win) {
+ public static boolean IsChild(final long win) {
return IsChild0(win);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
index 1f6cb7c05..3c7b1adfb 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -33,7 +33,7 @@ public class RegisteredClass {
private final String className;
private final long hDDTCtx;
- RegisteredClass(long hInst, String name, long hDispatchThreadCtx) {
+ RegisteredClass(final long hInst, final String name, final long hDispatchThreadCtx) {
this.hInstance = hInst;
this.className = name;
this.hDDTCtx = hDispatchThreadCtx;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
index c4b4d145c..e3ea49314 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
@@ -57,7 +57,7 @@ public class RegisteredClassFactory {
private int sharedRefCount = 0;
private final Object sync = new Object();
- private String toHexString(long l) { return "0x"+Long.toHexString(l); }
+ private String toHexString(final long l) { return "0x"+Long.toHexString(l); }
@Override
public final String toString() { return "RegisteredClassFactory[moduleHandle "+toHexString(hInstance)+", "+classBaseName+
@@ -93,7 +93,7 @@ public class RegisteredClassFactory {
/** Application handle. */
public static long getHInstance() { return hInstance; }
- public RegisteredClassFactory(String classBaseName, long wndProc, boolean useDummyDispatchThread, long iconSmallHandle, long iconBigHandle) {
+ public RegisteredClassFactory(final String classBaseName, final long wndProc, final boolean useDummyDispatchThread, final long iconSmallHandle, final long iconBigHandle) {
this.classBaseName = classBaseName;
this.wndProc = wndProc;
this.useDummyDispatchThread = useDummyDispatchThread;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
index 4f8cff8c5..0ac3d4a2e 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
@@ -35,7 +35,7 @@ import javax.media.nativewindow.VisualIDHolder;
public class X11Capabilities extends Capabilities {
final private XVisualInfo xVisualInfo; // maybe null if !onscreen
- public X11Capabilities(XVisualInfo xVisualInfo) {
+ public X11Capabilities(final XVisualInfo xVisualInfo) {
super();
this.xVisualInfo = xVisualInfo;
}
@@ -49,7 +49,7 @@ public class X11Capabilities extends Capabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new NativeWindowException(e);
}
}
@@ -59,7 +59,7 @@ public class X11Capabilities extends Capabilities {
final public boolean hasXVisualInfo() { return null!=xVisualInfo; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
index 53b303071..7e61ba6d0 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
@@ -21,12 +21,12 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
* not the actual dummy surface height,
* The latter is platform specific and small
*/
- public X11DummyUpstreamSurfaceHook(int width, int height) {
+ public X11DummyUpstreamSurfaceHook(final int width, final int height) {
super(width, height);
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
final X11GraphicsConfiguration cfg = (X11GraphicsConfiguration) s.getGraphicsConfiguration();
final X11GraphicsScreen screen = (X11GraphicsScreen) cfg.getScreen();
final X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice();
@@ -51,7 +51,7 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
final X11GraphicsDevice device = (X11GraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
if( 0 == s.getSurfaceHandle() ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
index 6258632cd..e12c3fd13 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
@@ -53,7 +53,7 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID)
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen screen, final int nativeVisualID)
throws IllegalArgumentException, NativeWindowException {
if(!(screen instanceof X11GraphicsScreen)) {
@@ -72,15 +72,15 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
return res;
}
- public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, int visualID)
+ public static XVisualInfo getXVisualInfo(final AbstractGraphicsScreen screen, final int visualID)
{
- XVisualInfo xvi_temp = XVisualInfo.create();
+ final XVisualInfo xvi_temp = XVisualInfo.create();
xvi_temp.setVisualid(visualID);
xvi_temp.setScreen(screen.getIndex());
- int num[] = { -1 };
- long display = screen.getDevice().getHandle();
+ final int num[] = { -1 };
+ final long display = screen.getDevice().getHandle();
- XVisualInfo[] xvis = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
+ final XVisualInfo[] xvis = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
if(xvis==null || num[0]<1) {
return null;
@@ -89,26 +89,26 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
return XVisualInfo.create(xvis[0]);
}
- public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities)
+ public static XVisualInfo getXVisualInfo(final AbstractGraphicsScreen screen, final CapabilitiesImmutable capabilities)
{
- XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
+ final XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
if(null!=xv) return xv;
return getXVisualInfoImpl(screen, capabilities, 5 /* DirectColor */);
}
- private static XVisualInfo getXVisualInfoImpl(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities, int c_class)
+ private static XVisualInfo getXVisualInfoImpl(final AbstractGraphicsScreen screen, final CapabilitiesImmutable capabilities, final int c_class)
{
XVisualInfo ret = null;
- int[] num = { -1 };
+ final int[] num = { -1 };
- XVisualInfo vinfo_template = XVisualInfo.create();
+ final XVisualInfo vinfo_template = XVisualInfo.create();
vinfo_template.setScreen(screen.getIndex());
vinfo_template.setC_class(c_class);
- long display = screen.getDevice().getHandle();
+ final long display = screen.getDevice().getHandle();
- XVisualInfo[] vinfos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
+ final XVisualInfo[] vinfos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
XVisualInfo best=null;
- int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
+ final int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
for (int i = 0; vinfos!=null && i < num[0]; i++) {
if ( best == null ||
best.getDepth() < vinfos[i].getDepth() )
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
index 2f825e8d4..2414248b4 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -243,7 +243,7 @@ public class X11Util implements ToolkitProperties {
return hasThreadingIssues; // JOGL impl. may utilize special locking "somewhere"
}
- public static void setX11ErrorHandler(boolean onoff, boolean quiet) {
+ public static void setX11ErrorHandler(final boolean onoff, final boolean quiet) {
synchronized(setX11ErrorHandlerLock) {
setX11ErrorHandler0(onoff, quiet);
}
@@ -282,7 +282,7 @@ public class X11Util implements ToolkitProperties {
boolean unCloseable;
Throwable creationStack;
- protected NamedDisplay(String name, long handle) {
+ protected NamedDisplay(final String name, final long handle) {
this.name=name;
this.handle=handle;
this.refCount=0;
@@ -306,7 +306,7 @@ public class X11Util implements ToolkitProperties {
}
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if(this == obj) { return true; }
if(obj instanceof NamedDisplay) {
return handle == ((NamedDisplay) obj).handle;
@@ -321,7 +321,7 @@ public class X11Util implements ToolkitProperties {
public final long getHandle() { return handle; }
public final int getRefCount() { return refCount; }
- public final void setUncloseable(boolean v) { unCloseable = v; }
+ public final void setUncloseable(final boolean v) { unCloseable = v; }
public final boolean isUncloseable() { return unCloseable; }
public final Throwable getCreationStack() { return creationStack; }
@@ -341,7 +341,7 @@ public class X11Util implements ToolkitProperties {
synchronized(globalLock) {
if( getMarkAllDisplaysUnclosable() ) {
for(int i=0; i