From 480f4251cf3cf530493611d8924f905cacc349d5 Mon Sep 17 00:00:00 2001
From: Sven Gothel
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ *
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation
+ *
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation + *
*/ public static boolean isNativeVisualIDValidForProcessing(final int visualID) { return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) || @@ -645,7 +654,18 @@ public abstract class NativeWindowFactory { * */ public static AbstractGraphicsDevice createDevice(final String displayConnection, final boolean own) { - final String nwt = NativeWindowFactory.getNativeWindowType(true); + return createDevice(NativeWindowFactory.getNativeWindowType(true), displayConnection, own); + } + /** + * Creates a native device type, following the given {@link #getNativeWindowType(boolean) native-window-type}. + *
+ * The device will be opened if own
is true, otherwise no native handle will ever be acquired.
+ *
+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation + *
+ */ + public static AbstractGraphicsDevice createDevice(final String nwt, final String displayConnection, final boolean own) { if( NativeWindowFactory.TYPE_X11 == nwt ) { if( own ) { return new X11GraphicsDevice(displayConnection, AbstractGraphicsDevice.DEFAULT_UNIT, null /* ToolkitLock */); @@ -656,16 +676,13 @@ public abstract class NativeWindowFactory { return new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); } else if( NativeWindowFactory.TYPE_MACOSX == nwt ) { return new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); - /** - * FIXME: Needs service provider interface (SPI) for TK dependent implementation - } else if( NativeWindowFactory.TYPE_BCM_VC_IV == nwt ) { - } else if( NativeWindowFactory.TYPE_ANDROID== nwt ) { } else if( NativeWindowFactory.TYPE_EGL == nwt ) { - } else if( NativeWindowFactory.TYPE_BCM_VC_IV == nwt ) { + throw new UnsupportedOperationException("n/a for windowing system: "+nwt); } else if( NativeWindowFactory.TYPE_AWT == nwt ) { - */ + throw new UnsupportedOperationException("n/a for windowing system: "+nwt); + } else { + return new DefaultGraphicsDevice(nwt, displayConnection, AbstractGraphicsDevice.DEFAULT_UNIT); } - throw new UnsupportedOperationException("n/a for windowing system: "+nwt); } /** @@ -691,6 +708,9 @@ public abstract class NativeWindowFactory { /** * @param nw * @return top-left client-area position in window units + *+ * FIXME: Bug 973 Needs service provider interface (SPI) for TK dependent implementation + *
*/ public static PointImmutable getLocationOnScreen(final NativeWindow nw) { final String nwt = NativeWindowFactory.getNativeWindowType(true); -- cgit v1.2.3