summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-26 22:41:04 +0100
committerSven Gothel <[email protected]>2011-02-26 22:41:04 +0100
commit10c696f7e908ccbf150838f86b286b7c383058c6 (patch)
treec39fb70e8223ae86be61c4926fdf4c91a6734c73 /src/nativewindow/classes/jogamp
parent76444dce2b678a7f6769564abac4f8a73f414609 (diff)
Code cleanup: override, imports, StringBuilder, ..
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java14
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java1
7 files changed, 13 insertions, 16 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index d514b662d..3db8f32d2 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -38,8 +38,6 @@ import java.lang.reflect.*;
import javax.media.nativewindow.*;
public class NativeWindowFactoryImpl extends NativeWindowFactory {
- protected static final boolean DEBUG = Debug.debug("NativeWindow");
-
private static final ToolkitLock nullToolkitLock = new NullToolkitLock();
public static ToolkitLock getNullToolkitLock() {
@@ -96,14 +94,14 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class },
getClass().getClassLoader());
} catch (Exception e) {
- throw (IllegalArgumentException) new IllegalArgumentException().initCause(e);
+ throw new IllegalArgumentException(e);
}
}
try {
return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
} catch (Exception ie) {
- throw (IllegalArgumentException) new IllegalArgumentException().initCause(ie);
+ throw new IllegalArgumentException(ie);
}
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
index c3518ed85..834d8a703 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
@@ -40,28 +40,28 @@ import javax.swing.MenuSelectionManager;
public class AWTMisc {
- public static final JFrame getJFrame(Component c) {
+ public static JFrame getJFrame(Component c) {
while (c != null && !(c instanceof JFrame)) {
c = c.getParent();
}
return (JFrame) c;
}
- public static final Frame getFrame(Component c) {
+ public static Frame getFrame(Component c) {
while (c != null && !(c instanceof Frame)) {
c = c.getParent();
}
return (Frame) c;
}
- public static final Window getWindow(Component c) {
+ public static Window getWindow(Component c) {
while (c != null && !(c instanceof Window)) {
c = c.getParent();
}
return (Window) c;
}
- public static final Container getContainer(Component c) {
+ public static Container getContainer(Component c) {
while (c != null && !(c instanceof Container)) {
c = c.getParent();
}
@@ -71,11 +71,11 @@ public class AWTMisc {
/**
* Issue this when your non AWT toolkit gains focus to clear AWT menu path
*/
- public static final void clearAWTMenus() {
+ public static void clearAWTMenus() {
MenuSelectionManager.defaultManager().clearSelectedPath();
}
- public final static int AWT2NWClosingOperation(int awtClosingOperation) {
+ public static int AWT2NWClosingOperation(int awtClosingOperation) {
switch (awtClosingOperation) {
case WindowConstants.DISPOSE_ON_CLOSE:
case WindowConstants.EXIT_ON_CLOSE:
@@ -88,7 +88,7 @@ public class AWTMisc {
}
}
- public final static int getNWClosingOperation(Component c) {
+ public static int getNWClosingOperation(Component c) {
JFrame jf = getJFrame(c);
int op = (null != jf) ? jf.getDefaultCloseOperation() : WindowConstants.DO_NOTHING_ON_CLOSE ;
return AWT2NWClosingOperation(op);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index adbd0885f..1ac9e1709 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -43,8 +43,6 @@ import javax.media.nativewindow.NativeWindowFactory;
import jogamp.nativewindow.NWJNILibLoader;
import java.awt.Toolkit;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
index 781882f08..61be51b8a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
@@ -68,7 +68,7 @@ public abstract class JAWTWindow implements NativeWindow {
init((Component)comp);
}
- private final void init(Component windowObject) throws NativeWindowException {
+ private void init(Component windowObject) throws NativeWindowException {
invalidate();
this.component = windowObject;
validateNative();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
index 11651ac15..40d7b8032 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
@@ -39,8 +39,6 @@
package jogamp.nativewindow.jawt;
-import jogamp.nativewindow.*;
-
/** Marker class for all window system-specific JAWT data structures. */
public interface JAWT_PlatformInfo {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
index 612d571f2..982b94888 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -61,6 +61,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
protected void validateNative() throws NativeWindowException {
}
+ @Override
protected synchronized void invalidate() {
super.invalidate();
windowHandle = 0;
@@ -125,6 +126,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
win32dsi = null;
}
+ @Override
public long getWindowHandle() {
return windowHandle;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
index 16f1046a7..afb3daf7c 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -40,5 +40,6 @@ public class RegisteredClass {
public final long getHandle() { return hInstance; }
public final String getName() { return className; }
+ @Override
public final String toString() { return "RegisteredClass[handle 0x"+Long.toHexString(hInstance)+", "+className+"]"; }
}