From 05135c584e578bc16bf2f47f47a9676842d3dcde Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 28 Jun 2008 14:30:26 +0000 Subject: 3rd round cdcfp - compile clean. Re-adding cdcfp: com/sun/opengl/impl/glu/mipmap/* com/sun/opengl/impl/GLPbufferImpl.java Using 'BufferUtil.nativeOrder(ByteBuffer)' to set up the native byte order. 'BufferUtil.nativeOrder' is now public. GLDrawableFactory: - removed 'hardcoded' awt attribute. Cleanup NEWT's AWT wrapping implementation. - NativeWindowFactory incooperates with the wrapping property. Bugs on X11/NEWT/AWT: - no events - deadlock at shutdown - deadlock if EGLDrawable with AWT get's locked git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1700 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/GLReflection.java | 30 +++++++++++++++++------ 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src/classes/com') diff --git a/src/classes/com/sun/opengl/impl/GLReflection.java b/src/classes/com/sun/opengl/impl/GLReflection.java index 94e004f..6898db8 100644 --- a/src/classes/com/sun/opengl/impl/GLReflection.java +++ b/src/classes/com/sun/opengl/impl/GLReflection.java @@ -89,7 +89,9 @@ public final class GLReflection { } public static final boolean instanceOf(Object obj, String clazzName) { - Class clazz = obj.getClass(); + return instanceOf(obj.getClass(), clazzName); + } + public static final boolean instanceOf(Class clazz, String clazzName) { do { if(clazz.getName().equals(clazzName)) { return true; @@ -100,15 +102,29 @@ public final class GLReflection { } public static final boolean implementationOf(Object obj, String faceName) { - Class[] clazzes = obj.getClass().getInterfaces(); - for(int i=clazzes.length-1; i>=0; i--) { - Class face = clazzes[i]; - if(face.getName().equals(faceName)) { - return true; + return implementationOf(obj.getClass(), faceName); + } + public static final boolean implementationOf(Class clazz, String faceName) { + do { + Class[] clazzes = clazz.getInterfaces(); + for(int i=clazzes.length-1; i>=0; i--) { + Class face = clazzes[i]; + if(face.getName().equals(faceName)) { + return true; + } } - } + clazz = clazz.getSuperclass(); + } while (clazz!=null); return false; } + public static boolean isAWTComponent(Object target) { + return instanceOf(target, "java.awt.Component"); + } + + public static boolean isAWTComponent(Class clazz) { + return instanceOf(clazz, "java.awt.Component"); + } + } -- cgit v1.2.3