diff options
Diffstat (limited to 'src/test/jogamp/newt/WindowImplAccess.java')
-rw-r--r-- | src/test/jogamp/newt/WindowImplAccess.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/test/jogamp/newt/WindowImplAccess.java b/src/test/jogamp/newt/WindowImplAccess.java index 76d0dc050..e8be5f68a 100644 --- a/src/test/jogamp/newt/WindowImplAccess.java +++ b/src/test/jogamp/newt/WindowImplAccess.java @@ -29,26 +29,16 @@ package jogamp.newt; import com.jogamp.newt.Window; -import com.jogamp.newt.opengl.GLWindow; /** * Allows access to protected methods of WindowImpl */ public class WindowImplAccess { public static final void windowDestroyNotify(Window win) { - WindowImpl winImpl = null; - if(win instanceof GLWindow) { - GLWindow glwin = (GLWindow) win; - winImpl = (WindowImpl) glwin.getWindow(); - } else if(win instanceof WindowImpl) { - winImpl = (WindowImpl) win; - } else { - throw new RuntimeException("Given Window not a GLWindow, not WindowImpl, but "+win.getClass()); - } - final WindowImpl winImplF = winImpl; - winImplF.runOnEDTIfAvail(true, new Runnable() { + final WindowImpl winImpl = (WindowImpl) win.getDelegatedWindow(); + winImpl.runOnEDTIfAvail(true, new Runnable() { public void run() { - winImplF.windowDestroyNotify(); + winImpl.windowDestroyNotify(); } }); } |