diff options
Diffstat (limited to 'src/newt/classes/jogamp')
32 files changed, 161 insertions, 0 deletions
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java index 46a354d4a..7ef2d7ffc 100644 --- a/src/newt/classes/jogamp/newt/Debug.java +++ b/src/newt/classes/jogamp/newt/Debug.java @@ -54,6 +54,7 @@ public class Debug extends PropertyAccess { static { AccessController.doPrivileged(new PrivilegedAction<Object>() { + @Override public Object run() { PropertyAccess.addTrustedPrefix("newt."); return null; diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java index c6cb706a4..0c29d772a 100644 --- a/src/newt/classes/jogamp/newt/DisplayImpl.java +++ b/src/newt/classes/jogamp/newt/DisplayImpl.java @@ -53,6 +53,7 @@ public abstract class DisplayImpl extends Display { static { NativeWindowFactory.addCustomShutdownHook(true /* head */, new Runnable() { + @Override public void run() { WindowImpl.shutdownAll(); ScreenImpl.shutdownAll(); @@ -147,6 +148,7 @@ public abstract class DisplayImpl extends Display { final DisplayImpl f_dpy = this; try { runOnEDTIfAvail(true, new Runnable() { + @Override public void run() { f_dpy.createNativeImpl(); }}); @@ -244,6 +246,7 @@ public abstract class DisplayImpl extends Display { task.run(); } + @Override public boolean validateEDTStopped() { if( 0==refCount && null == aDevice ) { final EDTUtil _edtUtil = edtUtil; @@ -277,6 +280,7 @@ public abstract class DisplayImpl extends Display { aDevice = null; refCount=0; stopEDT( edtUtil, new Runnable() { // blocks! + @Override public void run() { if ( null != f_aDevice ) { f_dpy.closeNativeImpl(f_aDevice); @@ -308,6 +312,7 @@ public abstract class DisplayImpl extends Display { d.aDevice = null; d.refCount=0; final Runnable closeNativeTask = new Runnable() { + @Override public void run() { if ( null != d.getGraphicsDevice() ) { d.closeNativeImpl(f_aDevice); @@ -329,6 +334,7 @@ public abstract class DisplayImpl extends Display { } } + @Override public synchronized final int addReference() { if(DEBUG) { System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1)); @@ -343,6 +349,7 @@ public abstract class DisplayImpl extends Display { } + @Override public synchronized final int removeReference() { if(DEBUG) { System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1)); @@ -355,6 +362,7 @@ public abstract class DisplayImpl extends Display { return refCount; } + @Override public synchronized final int getReferenceCount() { return refCount; } @@ -450,6 +458,7 @@ public abstract class DisplayImpl extends Display { private volatile boolean haveEvents = false; final protected Runnable dispatchMessagesRunnable = new Runnable() { + @Override public void run() { DisplayImpl.this.dispatchMessages(); } }; diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java index f1e212394..9364ada30 100644 --- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java +++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java @@ -51,6 +51,7 @@ import com.jogamp.common.util.cache.TempJarCache; public class NEWTJNILibLoader extends JNILibLoaderBase { public static boolean loadNEWT() { return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + @Override public Boolean run() { Platform.initSingleton(); final String libName = "newt"; diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java index eba844230..2478b1e5d 100644 --- a/src/newt/classes/jogamp/newt/OffscreenWindow.java +++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java @@ -57,6 +57,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { static long nextWindowHandle = 0x100; // start here - a marker + @Override protected void createNativeImpl() { if(capsRequested.isOnscreen()) { throw new NativeWindowException("Capabilities is onscreen"); @@ -75,6 +76,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { visibleChanged(false, true); } + @Override protected void closeNativeImpl() { // nop } @@ -85,6 +87,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { surfaceHandle = 0; } + @Override public void setSurfaceHandle(long handle) { surfaceHandle = handle ; } @@ -94,6 +97,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { return surfaceHandle; } + @Override protected void requestFocusImpl(boolean reparented) { } @@ -113,6 +117,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { sizeChanged(false, width, height, false); if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { @@ -138,10 +143,12 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { return new Point(0,0); } + @Override protected Point getLocationOnScreenImpl(int x, int y) { return new Point(x,y); } + @Override protected void updateInsetsImpl(Insets insets) { // nop .. } diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index a0ef8816b..5102fd26d 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -207,6 +207,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer /** last mouse button click count */ short lastButtonClickCount = (short)0; + @Override final void clearButton() { super.clearButton(); lastButtonPressTime = 0; @@ -536,12 +537,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer private Object closingListenerLock = new Object(); private WindowClosingMode defaultCloseOperation = WindowClosingMode.DISPOSE_ON_CLOSE; + @Override public WindowClosingMode getDefaultCloseOperation() { synchronized (closingListenerLock) { return defaultCloseOperation; } } + @Override public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) { synchronized (closingListenerLock) { WindowClosingMode _op = defaultCloseOperation; @@ -956,6 +959,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer this.visible = visible; } + @Override public final void run() { setVisibleActionImpl(visible); } @@ -983,6 +987,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer this.disregardFS = disregardFS; } + @Override public final void run() { final RecursiveLock _lock = windowLock; _lock.lock(); @@ -1035,6 +1040,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } private class DestroyAction implements Runnable { + @Override public final void run() { boolean animatorPaused = false; if(null!=lifecycleHook) { @@ -1188,6 +1194,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer screen = newScreen; } + @Override public final void run() { boolean animatorPaused = false; if(null!=lifecycleHook) { @@ -1462,6 +1469,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } private class ReparentActionRecreate implements Runnable { + @Override public final void run() { final RecursiveLock _lock = windowLock; _lock.lock(); @@ -1514,6 +1522,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer this.undecorated = undecorated; } + @Override public final void run() { final RecursiveLock _lock = windowLock; _lock.lock(); @@ -1559,6 +1568,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer this.alwaysOnTop = alwaysOnTop; } + @Override public final void run() { final RecursiveLock _lock = windowLock; _lock.lock(); @@ -1834,6 +1844,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } private final Runnable requestFocusAction = new Runnable() { + @Override public final void run() { if(DEBUG_IMPLEMENTATION) { System.err.println("Window.RequestFocusAction: force 0 - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)); @@ -1842,6 +1853,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } }; private final Runnable requestFocusActionForced = new Runnable() { + @Override public final void run() { if(DEBUG_IMPLEMENTATION) { System.err.println("Window.RequestFocusAction: force 1 - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)); @@ -1921,6 +1933,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer this.y = y; } + @Override public final void run() { final RecursiveLock _lock = windowLock; _lock.lock(); @@ -1970,6 +1983,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } public boolean fsOn() { return fullscreen; } + @Override public final void run() { final RecursiveLock _lock = windowLock; _lock.lock(); @@ -2144,6 +2158,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer List<MonitorDevice> _fullscreenMonitors = null; boolean _fullscreenUseMainMonitor = true; + @Override public void monitorModeChangeNotify(MonitorEvent me) { hadFocus = hasFocus(); if(DEBUG_IMPLEMENTATION) { @@ -2164,6 +2179,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } } + @Override public void monitorModeChanged(MonitorEvent me, boolean success) { if(DEBUG_IMPLEMENTATION) { System.err.println("Window.monitorModeChanged: hadFocus "+hadFocus+", "+me+", success: "+success+" @ "+Thread.currentThread().getName()); diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java index 325f17278..4bcb0fc82 100644 --- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java +++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java @@ -51,16 +51,19 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt this.downstreamParent = downstreamParent; } + @Override public AWTAdapter addTo(java.awt.Component awtComponent) { awtComponent.addHierarchyListener(this); return super.addTo(awtComponent); } + @Override public AWTAdapter removeFrom(java.awt.Component awtComponent) { awtComponent.removeHierarchyListener(this); return super.removeFrom(awtComponent); } + @Override public void focusGained(java.awt.event.FocusEvent e) { // forward focus to NEWT child final com.jogamp.newt.Window newtChild = getNewtWindow(); @@ -78,12 +81,14 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt } } + @Override public void focusLost(java.awt.event.FocusEvent e) { if(DEBUG_IMPLEMENTATION) { System.err.println("AWT: focusLost: "+ e); } } + @Override public void componentResized(java.awt.event.ComponentEvent e) { // Need to resize the NEWT child window // the resized event will be send via the native window feedback. @@ -93,6 +98,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt } final Window newtWindow = getNewtWindow(); newtWindow.runOnEDTIfAvail(false, new Runnable() { + @Override public void run() { int cw = comp.getWidth(); int ch = comp.getHeight(); @@ -109,6 +115,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt }}); } + @Override public void componentMoved(java.awt.event.ComponentEvent e) { if(DEBUG_IMPLEMENTATION) { System.err.println("AWT: componentMoved: "+e); @@ -119,14 +126,17 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt } } + @Override public void windowActivated(java.awt.event.WindowEvent e) { // no propagation to NEWT child window } + @Override public void windowDeactivated(java.awt.event.WindowEvent e) { // no propagation to NEWT child window } + @Override public void hierarchyChanged(java.awt.event.HierarchyEvent e) { if( null == getNewtEventListener() ) { long bits = e.getChangeFlags(); @@ -137,6 +147,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt System.err.println("AWT: hierarchyChanged SHOWING_CHANGED: showing "+showing+", "+changed+", source "+e.getComponent()); } getNewtWindow().runOnEDTIfAvail(false, new Runnable() { + @Override public void run() { if(getNewtWindow().isVisible() != showing) { getNewtWindow().setVisible(showing); diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java index 14cc9c69d..f7722c91c 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java +++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java @@ -107,6 +107,7 @@ public class AWTCanvas extends Canvas { return res; } + @Override public void addNotify() { /** @@ -160,6 +161,7 @@ public class AWTCanvas extends Canvas { return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false; } + @Override public void removeNotify() { try { dispose(); @@ -195,6 +197,7 @@ public class AWTCanvas extends Canvas { * Overridden to choose a GraphicsConfiguration on a parent container's * GraphicsDevice because both devices */ + @Override public GraphicsConfiguration getGraphicsConfiguration() { /* * Workaround for problems with Xinerama and java.awt.Component.checkGD @@ -324,6 +327,7 @@ public class AWTCanvas extends Canvas { if (!disableBackgroundEraseInitialized) { try { AccessController.doPrivileged(new PrivilegedAction<Object>() { + @Override public Object run() { try { Class<?> clazz = getToolkit().getClass(); diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java index bddb43b30..4a7193306 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java +++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java @@ -218,6 +218,7 @@ public class AWTEDTUtil implements EDTUtil { } try { AWTEDTExecutor.singleton.invoke(true, new Runnable() { + @Override public void run() { } }); } catch (Exception e) { } diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java index 9e716d544..d9a4a48e5 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java @@ -46,6 +46,7 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override protected void createNativeImpl() { aDevice = AWTGraphicsDevice.createDefault(); } @@ -54,6 +55,7 @@ public class DisplayDriver extends DisplayImpl { aDevice = d; } + @Override protected EDTUtil createEDTUtil() { final EDTUtil def; if(NewtFactory.useEDT()) { @@ -67,10 +69,12 @@ public class DisplayDriver extends DisplayImpl { return def; } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { aDevice.close(); } + @Override protected void dispatchMessagesNative() { /* nop */ } } diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java index a2430e2bb..a4356707e 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java @@ -49,6 +49,7 @@ public class ScreenDriver extends ScreenImpl { public ScreenDriver() { } + @Override protected void createNativeImpl() { aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice()); } @@ -65,8 +66,10 @@ public class ScreenDriver extends ScreenImpl { super.updateVirtualScreenOriginAndSize(); } + @Override protected void closeNativeImpl() { } + @Override protected int validateScreenIndex(int idx) { return idx; // pass through ... } diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java index db71695b7..9854524d9 100644 --- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java @@ -86,6 +86,7 @@ public class WindowDriver extends WindowImpl { private Frame awtFrame = null; private AWTCanvas awtCanvas; + @Override protected void requestFocusImpl(boolean reparented) { awtContainer.requestFocus(); } @@ -97,6 +98,7 @@ public class WindowDriver extends WindowImpl { } } + @Override protected void createNativeImpl() { if(0!=getParentWindowHandle()) { throw new RuntimeException("Window parenting not supported in AWT, use AWTWindow(Frame) cstr for wrapping instead"); @@ -140,6 +142,7 @@ public class WindowDriver extends WindowImpl { } } + @Override protected void closeNativeImpl() { setWindowHandle(0); if(null!=awtContainer) { @@ -176,6 +179,7 @@ public class WindowDriver extends WindowImpl { return res; } + @Override protected void updateInsetsImpl(javax.media.nativewindow.util.Insets insets) { final Insets contInsets = awtContainer.getInsets(); insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom); @@ -214,6 +218,7 @@ public class WindowDriver extends WindowImpl { awtContainer.validate(); } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { if(DEBUG_IMPLEMENTATION) { System.err.println("AWTWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+ @@ -266,6 +271,7 @@ public class WindowDriver extends WindowImpl { return true; } + @Override protected Point getLocationOnScreenImpl(int x, int y) { java.awt.Point ap = awtCanvas.getLocationOnScreen(); ap.translate(x, y); diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java index 1b73cb381..9da671d37 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java @@ -61,6 +61,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl { public DisplayDriver() { } + @Override protected void createNativeImpl() { final long handle = CreateDisplay(ScreenDriver.fixedWidth, ScreenDriver.fixedHeight); if (handle == EGL.EGL_NO_DISPLAY) { @@ -69,6 +70,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl { aDevice = new EGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, null); } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) { DestroyDisplay(aDevice.getHandle()); @@ -76,6 +78,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl { aDevice.close(); } + @Override protected void dispatchMessagesNative() { // n/a .. DispatchMessages(); } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java index 269574adc..d3231557f 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java @@ -53,12 +53,15 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl { public ScreenDriver() { } + @Override protected void createNativeImpl() { aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx); } + @Override protected void closeNativeImpl() { } + @Override protected int validateScreenIndex(int idx) { return 0; // only one screen available } @@ -100,6 +103,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl { return false; } + @Override protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) { vOriginSize.set(0, 0, fixedWidth, fixedHeight); // FIXME } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java index bed0520ff..39f168e0f 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java @@ -52,6 +52,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl { public WindowDriver() { } + @Override protected void createNativeImpl() { if(0!=getParentWindowHandle()) { throw new RuntimeException("Window parenting not supported (yet)"); @@ -72,12 +73,14 @@ public class WindowDriver extends jogamp.newt.WindowImpl { } } + @Override protected void closeNativeImpl() { if(0!=windowHandleClose) { CloseWindow(getDisplayHandle(), windowHandleClose); } } + @Override protected void requestFocusImpl(boolean reparented) { } protected void setSizeImpl(int width, int height) { @@ -89,6 +92,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl { } } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { if(0!=getWindowHandle()) { if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) { @@ -117,10 +121,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl { return true; } + @Override protected Point getLocationOnScreenImpl(int x, int y) { return new Point(x,y); } + @Override protected void updateInsetsImpl(Insets insets) { // nop .. } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java index 52c92a5da..d8d93f123 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java @@ -59,15 +59,18 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override protected void createNativeImpl() { // FIXME: map name to EGL_*_DISPLAY aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { aDevice.close(); } + @Override protected void dispatchMessagesNative() { DispatchMessages(); } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java index 5a1917419..dc2a8459a 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java @@ -45,13 +45,16 @@ public class ScreenDriver extends ScreenImpl { public ScreenDriver() { } + @Override protected void createNativeImpl() { aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx); initNative(); } + @Override protected void closeNativeImpl() { } + @Override protected int validateScreenIndex(int idx) { return 0; // only one screen available } diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java index 560e49e96..4d4977776 100644 --- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java @@ -55,6 +55,7 @@ public class WindowDriver extends WindowImpl { public WindowDriver() { } + @Override protected void createNativeImpl() { if(0!=getParentWindowHandle()) { throw new RuntimeException("Window parenting not supported (yet)"); @@ -92,6 +93,7 @@ public class WindowDriver extends WindowImpl { focusChanged(false, true); } + @Override protected void closeNativeImpl() { final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getGraphicsConfiguration().getScreen().getDevice(); @@ -106,10 +108,12 @@ public class WindowDriver extends WindowImpl { eglDevice.close(); } + @Override protected void requestFocusImpl(boolean reparented) { focusChanged(false, true); } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { setVisible0(nativeWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags)); @@ -143,10 +147,12 @@ public class WindowDriver extends WindowImpl { return true; } + @Override protected Point getLocationOnScreenImpl(int x, int y) { return new Point(x,y); } + @Override protected void updateInsetsImpl(Insets insets) { // nop .. } diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java index 4cb566bc2..cc435540f 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java @@ -59,6 +59,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl { public DisplayDriver() { } + @Override protected void createNativeImpl() { synchronized(DisplayDriver.class) { if(0==initCounter) { @@ -72,6 +73,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl { aDevice = new DefaultGraphicsDevice(NativeWindowFactory.TYPE_DEFAULT, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, displayHandle); } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { if(0==displayHandle) { throw new NativeWindowException("displayHandle null; initCnt "+initCounter); @@ -87,6 +89,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl { aDevice.close(); } + @Override protected void dispatchMessagesNative() { if(0!=displayHandle) { DispatchMessages(displayHandle, focusedWindow); diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java index b5202aaf9..44802e348 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java @@ -53,14 +53,17 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl { public ScreenDriver() { } + @Override protected void createNativeImpl() { AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice(); GetScreenInfo(adevice.getHandle(), screen_idx); aScreen = new DefaultGraphicsScreen(adevice, screen_idx); } + @Override protected void closeNativeImpl() { } + @Override protected int validateScreenIndex(int idx) { return 0; // only one screen available } @@ -102,6 +105,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl { return false; } + @Override protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) { vOriginSize.set(0, 0, cachedWidth, cachedHeight); } diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java index 80821d4da..0e96c65d0 100644 --- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java @@ -48,6 +48,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl { static long nextWindowHandle = 1; + @Override protected void createNativeImpl() { if(0!=getParentWindowHandle()) { throw new NativeWindowException("GDL Window does not support window parenting"); @@ -72,6 +73,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl { } } + @Override protected void closeNativeImpl() { if(0!=surfaceHandle) { synchronized(WindowDriver.class) { @@ -82,6 +84,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl { } } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { ScreenDriver screen = (ScreenDriver) getScreen(); @@ -112,6 +115,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl { return true; } + @Override protected void requestFocusImpl(boolean reparented) { ((DisplayDriver)getScreen().getDisplay()).setFocus(this); } @@ -121,10 +125,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl { return surfaceHandle; } + @Override protected Point getLocationOnScreenImpl(int x, int y) { return new Point(x,y); } + @Override protected void updateInsetsImpl(Insets insets) { // nop .. } diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java index 1b92ca586..929688b11 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java @@ -59,15 +59,18 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override protected void createNativeImpl() { // FIXME: map name to EGL_*_DISPLAY aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { aDevice.close(); } + @Override protected void dispatchMessagesNative() { DispatchMessages(); } diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java index 17cc5dd2f..9ebe2629a 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java @@ -51,12 +51,15 @@ public class ScreenDriver extends ScreenImpl { public ScreenDriver() { } + @Override protected void createNativeImpl() { aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx); } + @Override protected void closeNativeImpl() { } + @Override protected int validateScreenIndex(int idx) { return 0; // only one screen available } @@ -98,6 +101,7 @@ public class ScreenDriver extends ScreenImpl { return false; } + @Override protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) { vOriginSize.set(0, 0, cachedWidth, cachedHeight); } diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java index d30d4f025..158e6ab2f 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java @@ -56,6 +56,7 @@ public class WindowDriver extends WindowImpl { public WindowDriver() { } + @Override protected void createNativeImpl() { if(0!=getParentWindowHandle()) { throw new RuntimeException("Window parenting not supported (yet)"); @@ -83,6 +84,7 @@ public class WindowDriver extends WindowImpl { windowHandleClose = eglWindowHandle; } + @Override protected void closeNativeImpl() { if(0!=windowHandleClose) { CloseWindow(windowHandleClose, windowUserData); @@ -90,8 +92,10 @@ public class WindowDriver extends WindowImpl { } } + @Override protected void requestFocusImpl(boolean reparented) { } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags)); @@ -125,10 +129,12 @@ public class WindowDriver extends WindowImpl { return true; } + @Override protected Point getLocationOnScreenImpl(int x, int y) { return new Point(x,y); } + @Override protected void updateInsetsImpl(Insets insets) { // nop .. } diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java index 2dbdfdce7..c44685dc8 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java @@ -64,14 +64,17 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override protected void dispatchMessagesNative() { // nop } + @Override protected void createNativeImpl() { aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { aDevice.close(); } diff --git a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java index 5d3b7287b..4f3cc691b 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java @@ -52,10 +52,12 @@ public class ScreenDriver extends ScreenImpl { public ScreenDriver() { } + @Override protected void createNativeImpl() { aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx); } + @Override protected void closeNativeImpl() { } private MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, int crt_idx, int mode_idx) { @@ -114,6 +116,7 @@ public class ScreenDriver extends ScreenImpl { return setMonitorMode0(monitor.getId(), mode.getId(), mode.getRotation()); } + @Override protected int validateScreenIndex(int idx) { return 0; // big-desktop w/ multiple monitor attached, only one screen available } diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index f36d32772..7db3e2aab 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -87,6 +87,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl isOffscreenInstance = false; if (0 != handle) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { close0( handle ); } } ); @@ -144,6 +145,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if (isNativeValid()) { if (0 != sscSurfaceHandle) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() ); } } ); @@ -160,6 +162,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl @Override protected void setTitleImpl(final String title) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { setTitle0(getWindowHandle(), title); } } ); @@ -172,6 +175,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } if(!isOffscreenInstance) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { requestFocus0(getWindowHandle(), force); } } ); @@ -187,6 +191,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } if(!isOffscreenInstance) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { resignFocus0(getWindowHandle()); } } ); @@ -209,6 +214,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl System.err.println("MacWindow: updatePosition() parent["+useParent+" "+pX+"/"+pY+"] "+x+"/"+y+" -> "+x+"/"+y+" rel-client-pos, "+p0S+" screen-client-pos"); } OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { setWindowClientTopLeftPoint0(handle, p0S.getX(), p0S.getY(), isVisible()); } } ); @@ -230,6 +236,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl System.err.println("MacWindow: sizeChanged() parent["+useParent+" "+x+"/"+y+"] "+getX()+"/"+getY()+" "+newWidth+"x"+newHeight+" -> "+p0S+" screen-client-pos"); } OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { setWindowClientTopLeftPoint0(getWindowHandle(), p0S.getX(), p0S.getY(), isVisible()); } } ); @@ -275,6 +282,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && !setVisible ) { if ( !isOffscreenInstance ) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { orderOut0(getWindowHandle()); visibleChanged(true, false); @@ -297,6 +305,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( width>0 && height>0 ) { if( !isOffscreenInstance ) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { setWindowClientTopLeftPointAndSize0(getWindowHandle(), pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, setVisible); } } ); @@ -308,6 +317,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && setVisible ) { if( !isOffscreenInstance ) { OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { orderFront0(getWindowHandle()); visibleChanged(true, true); @@ -476,6 +486,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView"); } OSXUtil.RunOnMainThread(false, new Runnable() { + @Override public void run() { changeContentView0(parentWinHandle, preWinHandle, 0); close0( preWinHandle ); @@ -502,6 +513,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl final boolean isOpaque = getGraphicsConfiguration().getChosenCapabilities().isBackgroundOpaque() && !offscreenInstance; // Blocking initialization on main-thread! OSXUtil.RunOnMainThread(true, new Runnable() { + @Override public void run() { initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height, isOpaque, fullscreen, visible && !offscreenInstance, surfaceHandle); diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java index d3c7416cc..d8ff7ecb5 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java @@ -71,16 +71,19 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override protected void createNativeImpl() { sharedClass = sharedClassFactory.getSharedClass(); aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); } + @Override protected void closeNativeImpl(AbstractGraphicsDevice aDevice) { sharedClassFactory.releaseSharedClass(); aDevice.close(); } + @Override protected void dispatchMessagesNative() { DispatchMessages0(); } diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 30405aa05..6e8ac3efa 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -127,6 +127,7 @@ public class WindowDriver extends WindowImpl { return false; } + @Override protected void createNativeImpl() { final ScreenDriver screen = (ScreenDriver) getScreen(); final DisplayDriver display = (DisplayDriver) screen.getDisplay(); @@ -156,6 +157,7 @@ public class WindowDriver extends WindowImpl { } } + @Override protected void closeNativeImpl() { if(windowHandleClose != 0) { if (hdc != 0) { @@ -183,6 +185,7 @@ public class WindowDriver extends WindowImpl { hdc_old = 0; } + @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { if(DEBUG_IMPLEMENTATION) { System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+ @@ -210,6 +213,7 @@ public class WindowDriver extends WindowImpl { return true; } + @Override protected void requestFocusImpl(boolean force) { requestFocus0(getWindowHandle(), force); } @@ -224,6 +228,7 @@ public class WindowDriver extends WindowImpl { final boolean[] res = new boolean[] { false }; this.runOnEDTIfAvail(true, new Runnable() { + @Override public void run() { res[0] = setPointerVisible0(getWindowHandle(), pointerVisible); } @@ -236,6 +241,7 @@ public class WindowDriver extends WindowImpl { final Boolean[] res = new Boolean[] { Boolean.FALSE }; this.runOnEDTIfAvail(true, new Runnable() { + @Override public void run() { final Point p0 = getLocationOnScreenImpl(0, 0); res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine, @@ -248,6 +254,7 @@ public class WindowDriver extends WindowImpl { @Override protected void warpPointerImpl(final int x, final int y) { this.runOnEDTIfAvail(true, new Runnable() { + @Override public void run() { final Point sPos = getLocationOnScreenImpl(x, y); warpPointer0(getWindowHandle(), sPos.getX(), sPos.getY()); @@ -256,10 +263,12 @@ public class WindowDriver extends WindowImpl { return; } + @Override protected Point getLocationOnScreenImpl(int x, int y) { return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y); } + @Override protected void updateInsetsImpl(Insets insets) { // nop - using event driven insetsChange(..) } diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java index aa8067520..504839797 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java @@ -63,6 +63,7 @@ public class DisplayDriver extends DisplayImpl { public DisplayDriver() { } + @Override public String validateDisplayName(String name, long handle) { return X11Util.validateDisplayName(name, handle); } @@ -72,6 +73,7 @@ public class DisplayDriver extends DisplayImpl { * * We use a private non-shared X11 Display instance for EDT window operations and one for exposed animation, eg. OpenGL. */ + @Override protected void createNativeImpl() { X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set long handle = X11Util.openDisplay(name); diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java index 7f75e03f0..bef7f60ec 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java @@ -74,6 +74,7 @@ public class ScreenDriver extends ScreenImpl { protected void createNativeImpl() { // validate screen index Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() { + @Override public Long run(long dpy) { return new Long(GetScreen0(dpy, screen_idx)); } } ); @@ -180,6 +181,7 @@ public class ScreenDriver extends ScreenImpl { if( null == rAndR ) { return null; } return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<MonitorMode>() { + @Override public MonitorMode run(long dpy) { final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId()); return MonitorModeProps.streamInMonitorMode(null, null, currentModeProps, 0); @@ -192,6 +194,7 @@ public class ScreenDriver extends ScreenImpl { final long t0 = System.currentTimeMillis(); boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() { + @Override public Boolean run(long dpy) { return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) ); } @@ -205,6 +208,7 @@ public class ScreenDriver extends ScreenImpl { } private DisplayImpl.DisplayRunnable<Boolean> xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable<Boolean>() { + @Override public Boolean run(long dpy) { return new Boolean(X11Util.XineramaIsEnabled(dpy)); } }; @@ -236,6 +240,7 @@ public class ScreenDriver extends ScreenImpl { } } ); } else */ { runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { + @Override public Object run(long dpy) { vOriginSize.set(0, 0, getWidth0(dpy, screen_idx), getHeight0(dpy, screen_idx)); return null; diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java index 02f80c0c3..5e1f7a6ed 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java @@ -176,6 +176,7 @@ public class WindowDriver extends WindowImpl { final int fflags = flags; final DisplayDriver display = (DisplayDriver) getScreen().getDisplay(); runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { + @Override public Object run(long dpy) { reconfigureWindow0( dpy, getScreenIndex(), getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(), @@ -202,6 +203,7 @@ public class WindowDriver extends WindowImpl { } final DisplayDriver display = (DisplayDriver) getScreen().getDisplay(); runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { + @Override public Object run(long dpy) { reconfigureWindow0( dpy, getScreenIndex(), getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(), @@ -223,6 +225,7 @@ public class WindowDriver extends WindowImpl { @Override protected void requestFocusImpl(final boolean force) { runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { + @Override public Object run(long dpy) { requestFocus0(dpy, getWindowHandle(), force); return null; @@ -233,6 +236,7 @@ public class WindowDriver extends WindowImpl { @Override protected void setTitleImpl(final String title) { runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { + @Override public Object run(long dpy) { setTitle0(dpy, getWindowHandle(), title); return null; @@ -243,6 +247,7 @@ public class WindowDriver extends WindowImpl { @Override protected boolean setPointerVisibleImpl(final boolean pointerVisible) { return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() { + @Override public Boolean run(long dpy) { return Boolean.valueOf(setPointerVisible0(dpy, getWindowHandle(), pointerVisible)); } @@ -252,6 +257,7 @@ public class WindowDriver extends WindowImpl { @Override protected boolean confinePointerImpl(final boolean confine) { return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() { + @Override public Boolean run(long dpy) { return Boolean.valueOf(confinePointer0(dpy, getWindowHandle(), confine)); } @@ -261,6 +267,7 @@ public class WindowDriver extends WindowImpl { @Override protected void warpPointerImpl(final int x, final int y) { runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { + @Override public Object run(long dpy) { warpPointer0(dpy, getWindowHandle(), x, y); return null; @@ -271,6 +278,7 @@ public class WindowDriver extends WindowImpl { @Override protected Point getLocationOnScreenImpl(final int x, final int y) { return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Point>() { + @Override public Point run(long dpy) { return X11Lib.GetRelativeLocation(dpy, getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y); } diff --git a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java index 08eacdee5..db89690f4 100644 --- a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java +++ b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java @@ -54,6 +54,7 @@ public class SWTEDTUtil implements EDTUtil { this.threadGroup = Thread.currentThread().getThreadGroup(); this.name=Thread.currentThread().getName()+"-SWTDisplay-"+newtDisplay.getFQName()+"-EDT-"; this.dispatchMessages = new Runnable() { + @Override public void run() { ((jogamp.newt.DisplayImpl) newtDisplay).dispatchMessages(); } }; @@ -252,6 +253,7 @@ public class SWTEDTUtil implements EDTUtil { } try { swtDisplay.syncExec(new Runnable() { + @Override public void run() { } }); } catch (Exception e) { } |