changeset 11102:aca026a95ec4

Merge
author kcr
date Fri, 05 Oct 2018 05:59:03 -0700
parents 4ec2cbf0048b b8b116f461dc
children 9b0ceebc83b1 5aae50fd6682
files dependencies/java.desktop/module-info.java.extra modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/FXDnDInteropO.java modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/InteropFactoryO.java modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/JFXPanelInteropO.java modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/SwingFXUtilsImplInteropO.java modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/SwingNodeInteropO.java modules/javafx.swing/src/main/module-info/module-info.java
diffstat 14 files changed, 93 insertions(+), 1397 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Fri Sep 14 08:35:48 2018 -0700
+++ b/build.gradle	Fri Oct 05 05:59:03 2018 -0700
@@ -605,17 +605,13 @@
 
 // Determine whether the javafx.* modules are present in the JDK. To do this,
 // we will execute "java --list-modules" and search for javafx.base.
-// Also, check if jdk.unsupported.desktop module is present in JDK to ensure 
-// javafx.swing do not use internal JDK classes directly.
 ext.HAS_JAVAFX_MODULES = false;
-ext.HAS_UNSUPPORTED_DESKTOP = false;
 def inStream2 = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(JAVA, "--list-modules").start().getInputStream()));
 try {
     String v;
     while ((v = inStream2.readLine()) != null) {
         v = v.trim();
         if (v.startsWith("javafx.base")) ext.HAS_JAVAFX_MODULES = true;
-        if (v.startsWith("jdk.unsupported.desktop")) ext.HAS_UNSUPPORTED_DESKTOP = true;
     }
 } finally {
     inStream2.close();
@@ -997,13 +993,6 @@
     }
 }
 
-void appendQualExports(File dest, List<String> qualExports) {
-    qualExports.each { exp ->
-        dest << exp
-        dest << "\n"
-    }
-}
-
 // perform common project manipulation for modules
 void commonModuleSetup(Project p, List<String> moduleChain) {
 
@@ -1289,7 +1278,6 @@
 logger.quiet("minimum jdk version: ${jfxBuildJdkVersionMin}")
 logger.quiet("minimum jdk build number: ${jfxBuildJdkBuildnumMin}")
 logger.quiet("HAS_JAVAFX_MODULES: $HAS_JAVAFX_MODULES")
-logger.quiet("HAS_UNSUPPORTED_DESKTOP: $HAS_UNSUPPORTED_DESKTOP")
 logger.quiet("STUB_RUNTIME: $STUB_RUNTIME")
 logger.quiet("CONF: $CONF")
 logger.quiet("NUM_COMPILE_THREADS: $NUM_COMPILE_THREADS")
@@ -1765,7 +1753,7 @@
     // All of our projects are java projects
 
     apply plugin: "java"
-    sourceCompatibility = 10
+    sourceCompatibility = 11
 
     // By default all of our projects require junit for testing so we can just
     // setup this dependency here.
@@ -1810,16 +1798,6 @@
     }
 }
 
-// Qualified exports needed by javafx.swing
-def qualExportsSwing = [
-        "--add-exports=java.desktop/java.awt.dnd.peer=javafx.swing",
-        "--add-exports=java.desktop/sun.awt=javafx.swing",
-        "--add-exports=java.desktop/sun.awt.dnd=javafx.swing",
-        "--add-exports=java.desktop/sun.awt.image=javafx.swing",
-        "--add-exports=java.desktop/sun.java2d=javafx.swing",
-        "--add-exports=java.desktop/sun.swing=javafx.swing",
-]
-
 // These strings define the module-source-path to be used in compilation.
 // They need to contain the full paths to the sources and the * will be
 // used to infer the module name that is used.
@@ -2414,29 +2392,8 @@
 
     test {
         enabled = IS_FULL_TEST && IS_AWT_TEST
-
-        if (!HAS_JAVAFX_MODULES) {
-            jvmArgs += qualExportsSwing
-        }
     }
 
-    sourceSets.main.java.srcDirs += "$buildDir/gensrc/java"
-    sourceSets.main.java {
-        if (!HAS_UNSUPPORTED_DESKTOP) {
-            exclude("com/sun/javafx/embed/swing/newimpl/**")
-        }
-    }
-    task copyModuleInfo(type: Copy, description: "copy module-info file to gensrc") {
-        from "src/main/module-info/module-info.java"
-        into "$buildDir/gensrc/java/"
-        filter { line->
-            !HAS_UNSUPPORTED_DESKTOP && line.contains('jdk.unsupported.desktop') ? null : line
-        }
-    }
-    compileJava.dependsOn copyModuleInfo
-
-    compileJava.options.compilerArgs.addAll(qualExportsSwing)
-
     if (COMPILE_SWING) {
         addMavenPublication(project, [ 'graphics' ])
     }
@@ -3565,10 +3522,6 @@
             exclude("**/com/sun/javafx/application/Swing*.*");
         }
 
-        if (!HAS_JAVAFX_MODULES) {
-            jvmArgs += qualExportsSwing
-        }
-
         forkEvery = 1
     }
 }
@@ -3741,10 +3694,6 @@
         mspFile << "--module-source-path\n"
         mspFile << defaultModuleSourcePath
         mspFile << "\n"
-
-        if (!HAS_JAVAFX_MODULES) {
-            appendQualExports(mspFile, qualExportsSwing)
-        }
     }
 }
 
@@ -3795,10 +3744,8 @@
         ]);
 
     doLast {
-        // FIXME: remove JDK 10 logic once minimum JDK is bumped to 11
-        def isBootJdk10 = jdkVersion.startsWith("10")
         projectsToDocument.each { p ->
-            def destDir = isBootJdk10 ? "$buildDir/javadoc" : "$buildDir/javadoc/${p.ext.moduleName}"
+            def destDir = "$buildDir/javadoc/${p.ext.moduleName}"
             copy {
                 from("$p.projectDir/src/main/docs") {
                     include "**/*.html"
@@ -4290,7 +4237,7 @@
         def copySourceFilesTask = project.task("copySourceFiles$t.capital", type: Copy, dependsOn: copyLibFilesTask) {
             if (copySources) {
                 from "${project.projectDir}/src/main/java"
-                if (project.name.equals("base") || project.name.equals("swing")) {
+                if (project.name.equals("base")) {
                     from "${project.projectDir}/build/gensrc/java"
                 }
                 if (project.name.equals("web")) {
@@ -4301,9 +4248,6 @@
             }
             into "${modulesSrcDir}/${moduleName}"
             include "**/*.java"
-            if (!HAS_UNSUPPORTED_DESKTOP) {
-                exclude("com/sun/javafx/embed/swing/newimpl/**")
-            }  
 
             if (project.hasProperty("sourceFilter")) {
                 filter(project.sourceFilter)
@@ -4915,8 +4859,6 @@
                 writeRunArgsFile(testCompileArgsFile, null, modpath, modnames)
                 writeRunArgsFile(testRunArgsFile, computeLibraryPath(true), modpath, modnames)
 
-                appendQualExports(testCompileArgsFile, qualExportsSwing)
-                appendQualExports(testRunArgsFile, qualExportsSwing)
             }
         }
     }
--- a/build.properties	Fri Sep 14 08:35:48 2018 -0700
+++ b/build.properties	Fri Oct 05 05:59:03 2018 -0700
@@ -72,5 +72,5 @@
 #
 ##############################################################################
 
-jfx.build.jdk.version.min=10
-jfx.build.jdk.buildnum.min=46
+jfx.build.jdk.version.min=11
+jfx.build.jdk.buildnum.min=28
--- a/dependencies/java.desktop/module-info.java.extra	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-exports java.awt.dnd.peer to javafx.swing;
-exports sun.awt to javafx.swing;
-exports sun.awt.dnd to javafx.swing;
-exports sun.awt.image to javafx.swing;
-exports sun.java2d to javafx.swing;
-exports sun.swing to javafx.swing;
--- a/doc-files/release-notes-11.md	Fri Sep 14 08:35:48 2018 -0700
+++ b/doc-files/release-notes-11.md	Fri Oct 05 05:59:03 2018 -0700
@@ -8,6 +8,11 @@
 
 ## Important Changes
 
+### Running JavaFX applications
+
+Now that the JDK no longer includes JavaFX, it is necessary to explicitly include the JavaFX modules that your application uses. Please refer to the [Getting Started with JavaFX 11](https://openjfx.io/openjfx-docs/) page for instructions.
+
+
 ### Add APIs to customize step repeat timing for Spinner control
 
 The default duration that the mouse has to be pressed on a Spinner control arrow button before the value steps is modified in JavaFX 11. Two new properties, "initialDelay" and "repeatDelay", have been added to configure this behavior. 
@@ -51,7 +56,9 @@
 
 JavaFX crashes on Ubuntu 18.04 Linux machines when the XWayland window server is enabled. This happens whenever the FX window toolkit code uses GTK 3 on Linux, which is the default as of JavaFX 11.
 
-Workaround: explicitly force GTK 2 by passing the following system property on the command line:
+The recommended workaround is to use the Xorg server instead of the Wayland server when running JavaFX applications. Note that Wayland is not supported by JDK 10 or JDK 11.
+
+An alternative workaround is to explicitly force GTK 2 by passing the following system property on the command line:
 
 ```
     java -Djdk.gtk.version=2 ...
@@ -59,9 +66,9 @@
 
 See [JDK-8210411](https://bugs.openjdk.java.net/browse/JDK-8210411) for more information.
 
-### FX / Swing interop requires qualified exports when run with JDK 10
+### Swing interop requires qualified exports when run with JDK 10
 
-When running JavaFX 11 with an OpenJDK 10 release, the following four qualified exports must be added to the `java` command line, or in an args file referred to with an `@` argument passed to the `java` command line.
+To run FX / Swing interop applications using JavaFX 11 with an OpenJDK 10 release, the following four qualified exports must be added to the `java` command line.
 
 ```
 --add-exports=java.desktop/java.awt.dnd.peer=javafx.swing
@@ -75,10 +82,34 @@
 
 ### Swing interop fails when run with a security manager with standalone SDK
 
-FX / Swing interop application will fail when run with a security manager enabled. An application that uses either JFXPanel or SwingNode must run without a security manager enabled.
+FX / Swing interop applications will fail when run with a security manager enabled. An application that uses either JFXPanel or SwingNode must run without a security manager enabled.
 See [JDK-8202451](https://bugs.openjdk.java.net/browse/JDK-8202451) for more information.
 
 
+### Swing interop fails when using a minimal jdk image created with jlink
+
+A minimal Java image created using jlink that includes the javafx.swing module from the JavaFX 11 jmods bundle will fail to run FX / Swing interop applications. For example, an image created as follows will not work:
+
+```
+    jlink --output myjdk --module-path javafx-jmods-11 \
+        --add-modules java.desktop,javafx.swing,javafx.controls
+```
+
+The javafx.swing module depends on a new jdk.unsupported.desktop module in JDK 11 that must either be explicitly added or included via the `--bind-services` option.
+
+Workaround: create your image using one of the following two methods:
+
+```
+    jlink --output myjdk --module-path javafx-jmods-11 \
+        --add-modules java.desktop,javafx.swing,javafx.controls,jdk.unsupported.desktop
+
+    jlink --output myjdk --bind-services --module-path javafx-jmods-11 \
+        --add-modules java.desktop,javafx.swing,javafx.controls
+```
+
+See [JDK-8210759](https://bugs.openjdk.java.net/browse/JDK-8210759) for more information.
+
+
 ## List of Fixed Bugs
 
 Issue key|Summary|Subcomponent
--- a/modules/javafx.graphics/src/main/native-font/freetype.c	Fri Sep 14 08:35:48 2018 -0700
+++ b/modules/javafx.graphics/src/main/native-font/freetype.c	Fri Oct 05 05:59:03 2018 -0700
@@ -389,21 +389,10 @@
     }
 }
 
-#define LIB_FREETYPE "libfreetype.so"
 JNIEXPORT jint JNICALL OS_NATIVE(FT_1Library_1SetLcdFilter)
     (JNIEnv *env, jclass that, jlong arg0, jint arg1)
 {
-//  return (jint)FT_Library_SetLcdFilter((FT_Library)arg0, (FT_LcdFilter)arg1);
-    static void *fp = NULL;
-    if (!fp) {
-        void* handle = dlopen(LIB_FREETYPE, RTLD_LAZY);
-        if (handle) fp = dlsym(handle, "FT_Library_SetLcdFilter");
-    }
-    jint rc = 0;
-    if (fp) {
-        rc = (jint)((jint (*)(jlong, jint))fp)(arg0, arg1);
-    }
-    return rc;
+    return (jint)FT_Library_SetLcdFilter((FT_Library)arg0, (FT_LcdFilter)arg1);
 }
 
 JNIEXPORT jint JNICALL OS_NATIVE(FT_1Done_1Face)
--- a/modules/javafx.swing/.classpath	Fri Sep 14 08:35:48 2018 -0700
+++ b/modules/javafx.swing/.classpath	Fri Oct 05 05:59:03 2018 -0700
@@ -20,7 +20,6 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
 		<attributes>
 			<attribute name="module" value="true"/>
-			<attribute name="add-exports" value="java.desktop/java.awt.dnd.peer=javafx.swing:java.desktop/sun.awt=javafx.swing:java.desktop/sun.awt.dnd=javafx.swing:java.desktop/sun.swing=javafx.swing"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
--- a/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/InteropFactory.java	Fri Sep 14 08:35:48 2018 -0700
+++ b/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/InteropFactory.java	Fri Oct 05 05:59:03 2018 -0700
@@ -25,45 +25,16 @@
 
 package com.sun.javafx.embed.swing;
 
-import java.lang.reflect.Constructor;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
+import com.sun.javafx.embed.swing.newimpl.InteropFactoryN;
 
 public abstract class InteropFactory {
     private static InteropFactory instance = null;
-    private static boolean verbose = false;
-
-    static {
-        AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
-            verbose = Boolean.valueOf(
-                          System.getProperty("javafx.embed.swing.verbose"));
-            return null;
-        });
-    }
-
-    private static final String[] factoryNames = {
-        "com.sun.javafx.embed.swing.newimpl.InteropFactoryN",
-    "com.sun.javafx.embed.swing.oldimpl.InteropFactoryO"
-    };
 
     public synchronized static InteropFactory getInstance() throws Exception {
-        if (instance != null) return instance;
-
-    Class factoryClass = null;
-        for (String factoryName : factoryNames) {
-        try {
-                factoryClass = Class.forName(factoryName);
-                Constructor<InteropFactory> cons = factoryClass.getConstructor();
-                instance = cons.newInstance();
-                return instance;
-        } catch (Exception e) {
-                System.err.println("InteropFactory: cannot load " + factoryName);
-                if (verbose) {
-                    e.printStackTrace();
-                }
+        if (instance == null) {
+            instance = new InteropFactoryN();
         }
-        }
-    throw new Exception("No swing interop factory can be loaded");
+        return instance;
     }
 
     public abstract SwingNodeInterop createSwingNodeImpl();
@@ -71,4 +42,3 @@
     public abstract FXDnDInterop createFXDnDImpl();
     public abstract SwingFXUtilsImplInterop createSwingFXUtilsImpl();
 }
-
--- a/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/FXDnDInteropO.java	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,573 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.embed.swing.oldimpl;
-
-import com.sun.javafx.embed.swing.CachingTransferable;
-import com.sun.javafx.embed.swing.FXDnD;
-import com.sun.javafx.embed.swing.FXDnDInterop;
-import com.sun.javafx.embed.swing.SwingDnD;
-import com.sun.javafx.embed.swing.SwingEvents;
-import com.sun.javafx.embed.swing.SwingNodeHelper;
-import com.sun.javafx.tk.Toolkit;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Point;
-import java.awt.SecondaryLoop;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.dnd.DnDConstants;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.DragGestureRecognizer;
-import java.awt.dnd.DragSource;
-import java.awt.dnd.DropTarget;
-import java.awt.dnd.DropTargetContext;
-import java.awt.dnd.DropTargetDragEvent;
-import java.awt.dnd.DropTargetDropEvent;
-import java.awt.dnd.DropTargetListener;
-import java.awt.dnd.InvalidDnDOperationException;
-import java.awt.dnd.MouseDragGestureRecognizer;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.awt.dnd.peer.DropTargetContextPeer;
-import java.util.HashMap;
-import java.util.Map;
-import javafx.application.Platform;
-import javafx.embed.swing.SwingNode;
-import javafx.event.EventHandler;
-import javafx.event.EventType;
-import javafx.scene.input.DataFormat;
-import javafx.scene.input.DragEvent;
-import javafx.scene.input.Dragboard;
-import javafx.scene.input.MouseEvent;
-import javafx.scene.input.TransferMode;
-import sun.awt.AWTAccessor;
-import sun.awt.dnd.SunDragSourceContextPeer;
-import sun.swing.JLightweightFrame;
-
-public class FXDnDInteropO extends FXDnDInterop {
-
-    public Component findComponentAt(Object frame, int x, int y,
-                                              boolean ignoreEnabled) {
-        JLightweightFrame lwFrame = (JLightweightFrame) frame;
-        return AWTAccessor.getContainerAccessor().findComponentAt(lwFrame,
-                        x, y, false);
-    }
-
-    public boolean isCompEqual(Component c, Object frame) {
-        JLightweightFrame lwFrame = (JLightweightFrame) frame;
-        return c != lwFrame;
-    }
-
-    public int convertModifiersToDropAction(int modifiers,
-                                                     int supportedActions) {
-        return SunDragSourceContextPeer.convertModifiersToDropAction(modifiers,
-                        supportedActions);
-    }
-
-    public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
-                        DragSource ds, Component c, int srcActions,
-                           DragGestureListener dgl) {
-        return (T) new FXDragGestureRecognizer(ds, c, srcActions, dgl);
-    }
-
-    public DragSourceContextPeer createDragSourceContext(DragGestureEvent dge)
-            throws InvalidDnDOperationException {
-        return new FXDragSourceContextPeer(dge);
-    }
-
-    private void runOnFxThread(Runnable runnable) {
-        if (Platform.isFxApplicationThread()) {
-            runnable.run();
-        } else {
-            Platform.runLater(runnable);
-        }
-    }
-
-    private SwingNode getNode() {
-        return node;
-    }
-
-    public void setNode(SwingNode swnode) {
-        node = swnode;
-    }
-
-    private SwingNode node = null;
-
-    /**
-     * Utility class that operates on Maps with Components as keys.
-     * Useful when processing mouse events to choose an object from the map
-     * based on the component located at the given coordinates.
-     */
-    private class ComponentMapper<T> {
-        public int x, y;
-        public T object = null;
-
-        private ComponentMapper(Map<Component, T> map, int xArg, int yArg) {
-            this.x = xArg;
-            this.y = yArg;
-
-            final JLightweightFrame lwFrame = (JLightweightFrame)SwingNodeHelper.getLightweightFrame(node);
-            Component c = AWTAccessor.getContainerAccessor().findComponentAt(lwFrame, x, y, false);
-            if (c == null) return;
-
-            synchronized (c.getTreeLock()) {
-                do {
-                    object = map.get(c);
-                } while (object == null && (c = c.getParent()) != null);
-
-                if (object != null) {
-                    // The object is either a DropTarget or a DragSource, so:
-                    //assert c == object.getComponent();
-
-                    // Translate x, y from lwFrame to component coordinates
-                    while (c != lwFrame && c != null) {
-                        x -= c.getX();
-                        y -= c.getY();
-                        c = c.getParent();
-                    }
-                }
-            }
-        }
-    }
-
-    public <T> ComponentMapper<T> mapComponent(Map<Component, T> map, int x, int y) {
-        return new ComponentMapper<T>(map, x, y);
-    }
-
-    ///////////////////////////////////////////////////////////////////////////
-    //     DRAG SOURCE IMPLEMENTATION
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    private boolean isDragSourceListenerInstalled = false;
-
-    // To keep track of where the DnD gesture actually started
-    private MouseEvent pressEvent = null;
-    private long pressTime = 0;
-
-    private volatile SecondaryLoop loop;
-
-    private final Map<Component, FXDragGestureRecognizer> recognizers = new HashMap<>();
-
-    // Note that we don't really use the MouseDragGestureRecognizer facilities,
-    // however some code in JDK may expect a descendant of this class rather
-    // than a generic DragGestureRecognizer. So we inherit from it.
-    private class FXDragGestureRecognizer extends MouseDragGestureRecognizer {
-        FXDragGestureRecognizer(DragSource ds, Component c, int srcActions,
-            DragGestureListener dgl)
-        {
-            super(ds, c, srcActions, dgl);
-
-            if (c != null) recognizers.put(c, this);
-        }
-
-        @Override public void setComponent(Component c) {
-            final Component old = getComponent();
-            if (old != null) recognizers.remove(old);
-            super.setComponent(c);
-            if (c != null) recognizers.put(c, this);
-        }
-
-        protected void registerListeners() {
-            runOnFxThread(() -> {
-                if (!isDragSourceListenerInstalled) {
-                    node.addEventHandler(MouseEvent.MOUSE_PRESSED, onMousePressHandler);
-                    node.addEventHandler(MouseEvent.DRAG_DETECTED, onDragStartHandler);
-                    node.addEventHandler(DragEvent.DRAG_DONE, onDragDoneHandler);
-
-                    isDragSourceListenerInstalled = true;
-                }
-            });
-        }
-
-        protected void unregisterListeners() {
-            runOnFxThread(() -> {
-                if (isDragSourceListenerInstalled) {
-                    node.removeEventHandler(MouseEvent.MOUSE_PRESSED, onMousePressHandler);
-                    node.removeEventHandler(MouseEvent.DRAG_DETECTED, onDragStartHandler);
-                    node.removeEventHandler(DragEvent.DRAG_DONE, onDragDoneHandler);
-
-                    isDragSourceListenerInstalled = false;
-                }
-            });
-        }
-
-        private void fireEvent(int x, int y, long evTime, int modifiers) {
-            // In theory we should register all the events that trigger the gesture (like PRESS, DRAG, DRAG, BINGO!)
-            // But we can live with this hack for now.
-            appendEvent(new java.awt.event.MouseEvent(getComponent(), java.awt.event.MouseEvent.MOUSE_PRESSED,
-                        evTime, modifiers, x, y, 0, false));
-
-            // Also, the modifiers here should've actually come from the last known mouse event (last MOVE or DRAG).
-            // But we're OK with using the initial PRESS modifiers for now
-            int initialAction = SunDragSourceContextPeer.convertModifiersToDropAction(
-                    modifiers, getSourceActions());
-
-            fireDragGestureRecognized(initialAction, new java.awt.Point(x, y));
-        }
-    }
-
-    // Invoked on EDT
-    private void fireEvent(int x, int y, long evTime, int modifiers) {
-        ComponentMapper<FXDragGestureRecognizer> mapper = mapComponent(recognizers, x, y);
-
-        final FXDragGestureRecognizer r = mapper.object;
-        if (r != null) {
-            r.fireEvent(mapper.x, mapper.y, evTime, modifiers);
-        } else {
-            // No recognizer, no DnD, no startDrag, so release the FX loop now
-            SwingNodeHelper.leaveFXNestedLoop(this);
-        }
-    }
-
-    private MouseEvent getInitialGestureEvent() {
-        return pressEvent;
-    }
-
-    private final EventHandler<MouseEvent> onMousePressHandler = (event) -> {
-        // It would be nice to maintain a list of all the events that initiate
-        // a DnD gesture (see a comment in FXDragGestureRecognizer.fireEvent().
-        // For now, we simply use the initial PRESS event for this purpose.
-        pressEvent = event;
-        pressTime = System.currentTimeMillis();
-    };
-
-
-    private volatile FXDragSourceContextPeer activeDSContextPeer;
-
-    private final EventHandler<MouseEvent> onDragStartHandler = (event) -> {
-        // Call to AWT and determine the active DragSourceContextPeer
-        activeDSContextPeer = null;
-        final MouseEvent firstEv = getInitialGestureEvent();
-        SwingNodeHelper.runOnEDTAndWait(FXDnDInteropO.this, () -> fireEvent(
-                    (int)firstEv.getX(), (int)firstEv.getY(), pressTime,
-                    SwingEvents.fxMouseModsToMouseMods(firstEv)));
-        if (activeDSContextPeer == null) return;
-
-        // Since we're going to start DnD, consume the event.
-        event.consume();
-
-        Dragboard db = getNode().startDragAndDrop(SwingDnD.dropActionsToTransferModes(
-                    activeDSContextPeer.sourceActions).toArray(new TransferMode[1]));
-
-        // At this point the activeDSContextPeer.transferable contains all the data from AWT
-        Map<DataFormat, Object> fxData = new HashMap<>();
-        for (String mt : activeDSContextPeer.transferable.getMimeTypes()) {
-            DataFormat f = DataFormat.lookupMimeType(mt);
-            //TODO: what to do if f == null?
-            if (f != null) fxData.put(f, activeDSContextPeer.transferable.getData(mt));
-        }
-
-        final boolean hasContent = db.setContent(fxData);
-        if (!hasContent) {
-            // No data, no DnD, no onDragDoneHandler, so release the AWT loop now
-            if (!FXDnD.fxAppThreadIsDispatchThread) {
-                loop.exit();
-            }
-        }
-    };
-
-    private final EventHandler<DragEvent> onDragDoneHandler = (event) -> {
-        event.consume();
-
-        // Release FXDragSourceContextPeer.startDrag()
-        if (!FXDnD.fxAppThreadIsDispatchThread) {
-            loop.exit();
-        }
-
-        if (activeDSContextPeer != null) {
-            final TransferMode mode = event.getTransferMode();
-            activeDSContextPeer.dragDone(
-                    mode == null ? 0 : SwingDnD.transferModeToDropAction(mode),
-                    (int)event.getX(), (int)event.getY());
-        }
-    };
-
-
-    private final class FXDragSourceContextPeer extends SunDragSourceContextPeer {
-        private volatile int sourceActions = 0;
-
-        private final CachingTransferable transferable = new CachingTransferable();
-
-        @Override public void startSecondaryEventLoop(){
-            Toolkit.getToolkit().enterNestedEventLoop(this);
-        }
-        @Override public void quitSecondaryEventLoop(){
-            assert !Platform.isFxApplicationThread();
-            Platform.runLater(() -> Toolkit.getToolkit().exitNestedEventLoop(FXDragSourceContextPeer.this, null));
-        }
-
-        @Override protected void setNativeCursor(long nativeCtxt, Cursor c, int cType) {
-            //TODO
-        }
-
-
-        private void dragDone(int operation, int x, int y) {
-            dragDropFinished(operation != 0, operation, x, y);
-        }
-
-        FXDragSourceContextPeer(DragGestureEvent dge) {
-            super(dge);
-        }
-
-
-        // It's Map<Long, DataFlavor> actually, but javac complains if the type isn't erased...
-        @Override protected void startDrag(Transferable trans, long[] formats, Map formatMap)
-        {
-            activeDSContextPeer = this;
-
-            // NOTE: we ignore the formats[] and the formatMap altogether.
-            // AWT provides those to allow for more flexible representations of
-            // e.g. text data (in various formats, encodings, etc.) However, FX
-            // code isn't ready to handle those (e.g. it can't digest a
-            // StringReader as data, etc.) So instead we perform our internal
-            // translation.
-            // Note that fetchData == true. FX doesn't support delayed data
-            // callbacks yet anyway, so we have to fetch all the data from AWT upfront.
-            transferable.updateData(trans, true);
-
-            sourceActions = getDragSourceContext().getSourceActions();
-
-            // Release the FX nested loop to allow onDragDetected to start the actual DnD operation,
-            // and then start an AWT nested loop to wait until DnD finishes.
-            if (!FXDnD.fxAppThreadIsDispatchThread) {
-                loop = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().createSecondaryLoop();
-                SwingNodeHelper.leaveFXNestedLoop(FXDnDInteropO.this);
-                if (!loop.enter()) {
-                    // An error occured, but there's little we can do here...
-                }
-            }
-        }
-    };
-
-    ///////////////////////////////////////////////////////////////////////////
-    //     DROP TARGET IMPLEMENTATION
-    ///////////////////////////////////////////////////////////////////////////
-
-
-    private boolean isDropTargetListenerInstalled = false;
-    private volatile FXDropTargetContextPeer activeDTContextPeer = null;
-    private final Map<Component, DropTarget> dropTargets = new HashMap<>();
-
-    private final EventHandler<DragEvent> onDragEnteredHandler = (event) -> {
-        if (activeDTContextPeer == null) activeDTContextPeer = new FXDropTargetContextPeer();
-
-        int action = activeDTContextPeer.postDropTargetEvent(event);
-
-        // If AWT doesn't accept anything, let parent nodes handle the event
-        if (action != 0) event.consume();
-    };
-
-    private final EventHandler<DragEvent> onDragExitedHandler = (event) -> {
-        if (activeDTContextPeer == null) activeDTContextPeer = new FXDropTargetContextPeer();
-
-        activeDTContextPeer.postDropTargetEvent(event);
-
-        activeDTContextPeer = null;
-    };
-
-    private final EventHandler<DragEvent> onDragOverHandler = (event) -> {
-        if (activeDTContextPeer == null) activeDTContextPeer = new FXDropTargetContextPeer();
-
-        int action = activeDTContextPeer.postDropTargetEvent(event);
-
-        // If AWT doesn't accept anything, let parent nodes handle the event
-        if (action != 0) {
-            // NOTE: in FX the acceptTransferModes() may ONLY be called from DRAG_OVER.
-            // If the AWT app always reports NONE and suddenly decides to accept the
-            // data in its DRAG_DROPPED handler, this just won't work. There's no way
-            // to workaround this other than by modifing the AWT application code.
-            event.acceptTransferModes(SwingDnD.dropActionsToTransferModes(action).toArray(new TransferMode[1]));
-            event.consume();
-        }
-    };
-
-    private final EventHandler<DragEvent> onDragDroppedHandler = (event) -> {
-        if (activeDTContextPeer == null) activeDTContextPeer = new FXDropTargetContextPeer();
-
-        int action = activeDTContextPeer.postDropTargetEvent(event);
-
-        if (action != 0) {
-            // NOTE: the dropAction is ignored since we use the action last
-            // reported from the DRAG_OVER handler.
-            //
-            // We might want to:
-            //
-            //    assert activeDTContextPeer.dropAction == onDragDroppedHandler.currentAction;
-            //
-            // and maybe print a diagnostic message if they differ.
-            event.setDropCompleted(activeDTContextPeer.success);
-
-            event.consume();
-        }
-
-        activeDTContextPeer = null;
-    };
-
-    private final class FXDropTargetContextPeer implements DropTargetContextPeer {
-
-        private int targetActions = DnDConstants.ACTION_NONE;
-        private int currentAction = DnDConstants.ACTION_NONE;
-        private DropTarget dt = null;
-        private DropTargetContext ctx = null;
-
-        private final CachingTransferable transferable = new CachingTransferable();
-
-        // Drop result
-        private boolean success = false;
-        private int dropAction = 0;
-
-        @Override public synchronized void setTargetActions(int actions) { targetActions = actions; }
-        @Override public synchronized int getTargetActions() { return targetActions; }
-
-        @Override public synchronized DropTarget getDropTarget() { return dt; }
-
-        @Override public synchronized boolean isTransferableJVMLocal() { return false; }
-
-        @Override public synchronized DataFlavor[] getTransferDataFlavors() { return transferable.getTransferDataFlavors(); }
-        @Override public synchronized Transferable getTransferable() { return transferable; }
-
-        @Override public synchronized void acceptDrag(int dragAction) { currentAction = dragAction; }
-        @Override public synchronized void rejectDrag() { currentAction = DnDConstants.ACTION_NONE; }
-
-        @Override public synchronized void acceptDrop(int dropAction) { this.dropAction = dropAction; }
-        @Override public synchronized void rejectDrop() { dropAction = DnDConstants.ACTION_NONE; }
-
-        @Override public synchronized void dropComplete(boolean success) { this.success = success; }
-
-
-        private int postDropTargetEvent(DragEvent event)
-        {
-            ComponentMapper<DropTarget> mapper = mapComponent(dropTargets, (int)event.getX(), (int)event.getY());
-
-            final EventType<?> fxEvType = event.getEventType();
-
-            Dragboard db = event.getDragboard();
-            transferable.updateData(db, DragEvent.DRAG_DROPPED.equals(fxEvType));
-
-            final int sourceActions = SwingDnD.transferModesToDropActions(db.getTransferModes());
-            final int userAction = event.getTransferMode() == null ? DnDConstants.ACTION_NONE
-                : SwingDnD.transferModeToDropAction(event.getTransferMode());
-
-            // A target for the AWT DnD event
-            DropTarget target = mapper.object != null ? mapper.object : dt;
-
-            SwingNodeHelper.runOnEDTAndWait(FXDnDInteropO.this, () -> {
-                if (target != dt) {
-                    if (ctx != null) {
-                        AWTAccessor.getDropTargetContextAccessor().reset(ctx);
-                    }
-                    ctx = null;
-
-                    currentAction = dropAction = DnDConstants.ACTION_NONE;
-                }
-
-                if (target != null) {
-                    if (ctx == null) {
-                        ctx = target.getDropTargetContext();
-            AWTAccessor.getDropTargetContextAccessor()
-                            .setDropTargetContextPeer(ctx, FXDropTargetContextPeer.this);
-                    }
-
-                    DropTargetListener dtl = (DropTargetListener)target;
-
-                    if (DragEvent.DRAG_DROPPED.equals(fxEvType)) {
-                        DropTargetDropEvent awtEvent = new DropTargetDropEvent(
-                            ctx, new Point(mapper.x, mapper.y), userAction, sourceActions);
-
-                        dtl.drop(awtEvent);
-                    } else {
-                        DropTargetDragEvent awtEvent = new DropTargetDragEvent(
-                            ctx, new Point(mapper.x, mapper.y), userAction, sourceActions);
-
-                        if (DragEvent.DRAG_OVER.equals(fxEvType)) dtl.dragOver(awtEvent);
-                        else if (DragEvent.DRAG_ENTERED.equals(fxEvType)) dtl.dragEnter(awtEvent);
-                        else if (DragEvent.DRAG_EXITED.equals(fxEvType)) dtl.dragExit(awtEvent);
-                    }
-                }
-
-                dt = mapper.object;
-                if (dt == null) {
-                    // FIXME: once we switch to JDK 9 as the boot JDK
-                    // we need to re-implement the following using
-                    // available API.
-                    /*
-                    if (ctx != null) ctx.removeNotify();
-                    */
-                    ctx = null;
-
-                    currentAction = dropAction = DnDConstants.ACTION_NONE;
-                }
-                if (DragEvent.DRAG_DROPPED.equals(fxEvType) || DragEvent.DRAG_EXITED.equals(fxEvType)) {
-                    // This must be done to ensure that the data isn't being
-                    // cached in AWT. Otherwise subsequent DnD operations will
-                    // see the old data only.
-                    // FIXME: once we switch to JDK 9 as the boot JDK
-                    // we need to re-implement the following using
-                    // available API.
-                    /*
-                    if (ctx != null) ctx.removeNotify();
-                    */
-                    ctx = null;
-                }
-
-                SwingNodeHelper.leaveFXNestedLoop(FXDnDInteropO.this);
-            });
-
-            if (DragEvent.DRAG_DROPPED.equals(fxEvType)) return dropAction;
-
-            return currentAction;
-        }
-    }
-
-    public void addDropTarget(DropTarget dt, SwingNode node) {
-        dropTargets.put(dt.getComponent(), dt);
-        Platform.runLater(() -> {
-            if (!isDropTargetListenerInstalled) {
-                node.addEventHandler(DragEvent.DRAG_ENTERED, onDragEnteredHandler);
-                node.addEventHandler(DragEvent.DRAG_EXITED, onDragExitedHandler);
-                node.addEventHandler(DragEvent.DRAG_OVER, onDragOverHandler);
-                node.addEventHandler(DragEvent.DRAG_DROPPED, onDragDroppedHandler);
-
-                isDropTargetListenerInstalled = true;
-            }
-        });
-    }
-
-    public void removeDropTarget(DropTarget dt, SwingNode node) {
-        dropTargets.remove(dt.getComponent());
-        Platform.runLater(() -> {
-            if (isDropTargetListenerInstalled && dropTargets.isEmpty()) {
-                node.removeEventHandler(DragEvent.DRAG_ENTERED, onDragEnteredHandler);
-                node.removeEventHandler(DragEvent.DRAG_EXITED, onDragExitedHandler);
-                node.removeEventHandler(DragEvent.DRAG_OVER, onDragOverHandler);
-                node.removeEventHandler(DragEvent.DRAG_DROPPED, onDragDroppedHandler);
-
-                isDropTargetListenerInstalled = false;
-            }
-        });
-    }
-}
--- a/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/InteropFactoryO.java	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.embed.swing.oldimpl;
-
-import com.sun.javafx.embed.swing.FXDnDInterop;
-import com.sun.javafx.embed.swing.InteropFactory;
-import com.sun.javafx.embed.swing.JFXPanelInterop;
-import com.sun.javafx.embed.swing.SwingFXUtilsImplInterop;
-import com.sun.javafx.embed.swing.SwingNodeInterop;
-
-public class InteropFactoryO extends InteropFactory {
-
-    public InteropFactoryO() throws Exception {
-        Class qeSwingClass = Class.forName("sun.swing.JLightweightFrame");
-    }
-
-    @Override
-    public SwingNodeInterop createSwingNodeImpl() {
-        return new SwingNodeInteropO();
-    }
-
-    @Override
-    public JFXPanelInterop createJFXPanelImpl() {
-        return new JFXPanelInteropO();
-    }
-
-    @Override
-    public FXDnDInterop createFXDnDImpl() {
-        return new FXDnDInteropO();
-    }
-
-    @Override
-    public SwingFXUtilsImplInterop createSwingFXUtilsImpl() {
-        return new SwingFXUtilsImplInteropO();
-    }
-}
--- a/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/JFXPanelInteropO.java	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.embed.swing.oldimpl;
-
-import com.sun.javafx.embed.swing.JFXPanelInterop;
-import java.awt.AWTEvent;
-import java.awt.Toolkit;
-import java.awt.Window;
-import javafx.embed.swing.JFXPanel;
-import sun.awt.AppContext;
-import sun.awt.SunToolkit;
-
-public class JFXPanelInteropO extends JFXPanelInterop {
-    public void postEvent(JFXPanel panel, AWTEvent e) {
-        AppContext context = SunToolkit.targetToAppContext(panel);
-        if (context != null) {
-            SunToolkit.postEvent(context, e);
-        }
-    }
-
-    public boolean isUngrabEvent(AWTEvent event) {
-        return event instanceof sun.awt.UngrabEvent;
-    }
-
-    public long getMask() {
-        return SunToolkit.GRAB_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK;
-    }
-
-    public void grab(Toolkit toolkit, Window w) {
-        if (toolkit instanceof SunToolkit) {
-            ((SunToolkit)toolkit).grab(w);
-        }
-    }
-
-    public void ungrab(Toolkit toolkit, Window w) {
-        if (toolkit instanceof SunToolkit) {
-            ((SunToolkit)toolkit).ungrab(w);
-        }
-    }
-}
--- a/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/SwingFXUtilsImplInteropO.java	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.embed.swing.oldimpl;
-
-import com.sun.javafx.application.PlatformImpl;
-import com.sun.javafx.embed.swing.SwingFXUtilsImplInterop;
-import com.sun.javafx.tk.Toolkit;
-import java.awt.EventQueue;
-import java.awt.SecondaryLoop;
-import java.util.concurrent.atomic.AtomicBoolean;
-import javafx.application.Platform;
-import sun.awt.AWTAccessor;
-import sun.awt.FwDispatcher;
-
-public class SwingFXUtilsImplInteropO extends SwingFXUtilsImplInterop {
-
-    private static class FwSecondaryLoop implements SecondaryLoop {
-
-        private final AtomicBoolean isRunning = new AtomicBoolean(false);
-
-        @Override
-        public boolean enter() {
-            if (isRunning.compareAndSet(false, true)) {
-                PlatformImpl.runAndWait(() -> {
-                    Toolkit.getToolkit().enterNestedEventLoop(FwSecondaryLoop.this);
-                });
-                return true;
-            }
-            return false;
-        }
-
-        @Override
-        public boolean exit() {
-            if (isRunning.compareAndSet(true, false)) {
-                PlatformImpl.runAndWait(() -> {
-                    Toolkit.getToolkit().exitNestedEventLoop(FwSecondaryLoop.this, null);
-                });
-                return true;
-            }
-            return false;
-        }
-    }
-
-    private static class FXDispatcher implements FwDispatcher {
-
-        @Override
-        public boolean isDispatchThread() {
-            return Platform.isFxApplicationThread();
-        }
-
-        @Override
-        public void scheduleDispatch(Runnable runnable) {
-            Platform.runLater(runnable);
-        }
-
-        @Override
-        public SecondaryLoop createSecondaryLoop() {
-            return new FwSecondaryLoop();
-        }
-    }
-
-    public void setFwDispatcher(EventQueue eventQueue) {
-        AWTAccessor.getEventQueueAccessor().setFwDispatcher(eventQueue, new FXDispatcher());
-    }
-}
-
--- a/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/oldimpl/SwingNodeInteropO.java	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,420 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.embed.swing.oldimpl;
-
-import com.sun.javafx.PlatformUtil;
-import com.sun.javafx.embed.swing.DisposerRecord;
-import com.sun.javafx.embed.swing.FXDnD;
-import com.sun.javafx.embed.swing.SwingCursors;
-import com.sun.javafx.embed.swing.SwingNodeHelper;
-import com.sun.javafx.embed.swing.SwingNodeInterop;
-import com.sun.javafx.scene.NodeHelper;
-import com.sun.javafx.stage.WindowHelper;
-import java.awt.AWTEvent;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.DragGestureRecognizer;
-import java.awt.dnd.DragSource;
-import java.awt.dnd.DropTarget;
-import java.awt.dnd.InvalidDnDOperationException;
-import java.awt.dnd.peer.DragSourceContextPeer;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.WindowFocusListener;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Method;
-import javafx.embed.swing.SwingNode;
-import javafx.scene.Scene;
-import javax.swing.JComponent;
-import sun.awt.UngrabEvent;
-import sun.swing.JLightweightFrame;
-import sun.swing.LightweightContent;
-
-public class SwingNodeInteropO extends SwingNodeInterop {
-
-    private volatile JLightweightFrame lwFrame;
-
-    /**
-     * Calls LightweightFrameWrapper.notifyDisplayChanged.
-     * Must be called on EDT only.
-     */
-    private static OptionalMethod<JLightweightFrame> jlfNotifyDisplayChanged;
-    private static OptionalMethod<JLightweightFrame> jlfOverrideNativeWindowHandle;
-
-    static {
-        jlfNotifyDisplayChanged = new OptionalMethod<>(JLightweightFrame.class,
-                "notifyDisplayChanged", Double.TYPE, Double.TYPE);
-        if (!jlfNotifyDisplayChanged.isSupported()) {
-            jlfNotifyDisplayChanged = new OptionalMethod<>(
-                  JLightweightFrame.class,"notifyDisplayChanged", Integer.TYPE);
-        }
-
-        jlfOverrideNativeWindowHandle = new OptionalMethod<>(JLightweightFrame.class,
-            "overrideNativeWindowHandle", Long.TYPE, Runnable.class);
-    }
-
-    public Object createLightweightFrame() {
-        lwFrame = new JLightweightFrame();
-        return lwFrame;
-    }
-
-    public JLightweightFrame getLightweightFrame() { return lwFrame; }
-
-    public MouseEvent createMouseEvent(Object frame,
-                            int swingID, long swingWhen, int swingModifiers,
-                            int relX, int relY, int absX, int absY,
-                            int clickCount, boolean swingPopupTrigger,
-                            int swingButton) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        return new java.awt.event.MouseEvent(lwFrame, swingID,
-                swingWhen, swingModifiers, relX, relY, absX, absY,
-                clickCount, swingPopupTrigger, swingButton);
-    }
-
-    public MouseWheelEvent createMouseWheelEvent(Object frame,
-                            int swingModifiers, int x, int y, int wheelRotation) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        return new MouseWheelEvent(lwFrame, java.awt.event.MouseEvent.MOUSE_WHEEL,
-                       System.currentTimeMillis(), swingModifiers,
-                   x, y, 0, 0, 0, false, MouseWheelEvent.WHEEL_UNIT_SCROLL,
-                   1, wheelRotation);
-    }
-
-    public KeyEvent createKeyEvent(Object frame,
-                                   int swingID, long swingWhen,
-                                   int swingModifiers,
-                                   int swingKeyCode, char swingChar) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        return new java.awt.event.KeyEvent(lwFrame, swingID,
-                    swingWhen, swingModifiers, swingKeyCode,
-                    swingChar);
-    }
-
-    public AWTEvent createUngrabEvent(Object frame) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        return new UngrabEvent(lwFrame);
-    }
-
-    public void overrideNativeWindowHandle(Object frame, long handle, Runnable closeWindow) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        jlfOverrideNativeWindowHandle.invoke(lwFrame, handle, closeWindow);
-    }
-
-    public void notifyDisplayChanged(Object frame, double scaleX, double scaleY) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        if (jlfNotifyDisplayChanged.isIntegerApi()) {
-            jlfNotifyDisplayChanged.invoke(lwFrame, (int) scaleX);
-        } else {
-            jlfNotifyDisplayChanged.invoke(lwFrame, scaleX, scaleY);
-        }
-    }
-
-    public void setHostBounds(Object frame, int windowX, int windowY, int windowW, int windowH) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        jlfSetHostBounds.invoke(lwFrame, windowX, windowY, windowW, windowH);
-    }
-
-    public void setContent(Object frame, Object cnt) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        LightweightContent content = (LightweightContent)cnt;
-        lwFrame.setContent(content);
-    }
-
-    public void setVisible(Object frame, boolean visible) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        lwFrame.setVisible(visible);
-    }
-
-    public void setBounds(Object frame, int frameX, int frameY, int frameW, int frameH) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        lwFrame.setBounds(frameX, frameY, frameW, frameH);
-    }
-
-    public SwingNodeContent createSwingNodeContent(JComponent content, SwingNode node) {
-        return new SwingNodeContent(content, node);
-    }
-
-    public DisposerRecord createSwingNodeDisposer(Object frame) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        return new SwingNodeDisposer(lwFrame);
-    }
-
-    private static final class OptionalMethod<T> {
-        private final Method method;
-        private final boolean isIntegerAPI;
-
-        OptionalMethod(Class<T> cls, String name, Class<?>... args) {
-            Method m;
-            try {
-                m = cls.getMethod(name, args);
-            } catch (NoSuchMethodException ignored) {
-                // This means we're running with older JDK, simply skip the call
-                m = null;
-            } catch (Throwable ex) {
-                throw new RuntimeException("Error when calling " + cls.getName() + ".getMethod('" + name + "').", ex);
-            }
-            method = m;
-            isIntegerAPI = args != null && args.length > 0 &&
-                                                        args[0] == Integer.TYPE;
-        }
-
-        public boolean isSupported() {
-            return method != null;
-        }
-
-        public boolean isIntegerApi() {
-            return isIntegerAPI;
-        }
-
-        public Object invoke(T object, Object... args) {
-            if (method != null) {
-                try {
-                    return method.invoke(object, args);
-                } catch (Throwable ex) {
-                    throw new RuntimeException("Error when calling " + object.getClass().getName() + "." + method.getName() + "().", ex);
-                }
-            } else {
-                return null;
-            }
-        }
-    }
-
-    /**
-     * Calls LightweightFrameWrapper.setHostBounds.
-     * Must be called on EDT only.
-     */
-    private static final OptionalMethod<JLightweightFrame> jlfSetHostBounds =
-        new OptionalMethod<>(JLightweightFrame.class, "setHostBounds",
-                Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE);
-
-    public void emulateActivation(Object frame, boolean activate) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        lwFrame.emulateActivation(activate);
-    }
-
-    public void disposeFrame(Object frame) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        lwFrame.dispose();
-    }
-
-    public void addWindowFocusListener(Object frame, WindowFocusListener l) {
-        JLightweightFrame lwFrame = (JLightweightFrame)frame;
-        lwFrame.addWindowFocusListener(l);
-    }
-
-    private static class SwingNodeDisposer implements DisposerRecord {
-         JLightweightFrame lwFrame;
-
-         SwingNodeDisposer(JLightweightFrame ref) {
-             this.lwFrame = ref;
-         }
-         public void dispose() {
-             if (lwFrame != null) {
-                 lwFrame.dispose();
-                 lwFrame = null;
-             }
-         }
-    }
-
-    private static class SwingNodeContent implements LightweightContent {
-        private JComponent comp;
-        private volatile FXDnD dnd;
-        private WeakReference<SwingNode> swingNodeRef;
-
-        SwingNodeContent(JComponent comp, SwingNode swingNode) {
-            this.comp = comp;
-            this.swingNodeRef = new WeakReference<SwingNode>(swingNode);
-        }
-        @Override
-        public JComponent getComponent() {
-            return comp;
-        }
-        @Override
-        public void paintLock() {
-            SwingNode swingNode = swingNodeRef.get();
-            if (swingNode != null) {
-                SwingNodeHelper.getPaintLock(swingNode).lock();
-            }
-        }
-        @Override
-        public void paintUnlock() {
-            SwingNode swingNode = swingNodeRef.get();
-            if (swingNode != null) {
-                SwingNodeHelper.getPaintLock(swingNode).unlock();
-            }
-        }
-
-        @Override
-        public void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride) {
-            imageBufferReset(data, x, y, width, height, linestride, 1);
-        }
-        //@Override
-        public void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride, int scale) {
-            SwingNode swingNode = swingNodeRef.get();
-            if (swingNode != null) {
-                SwingNodeHelper.setImageBuffer(swingNode, data, x, y, width, height, linestride, scale, scale);
-            }
-        }
-        @Override
-        public void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride, double scaleX, double scaleY) {
-            SwingNode swingNode = swingNodeRef.get();
-            if (swingNode != null) {
-                SwingNodeHelper.setImageBuffer(swingNode, data, x, y, width, height, linestride, scaleX, scaleY);
-            }
-        }
-        @Override
-        public void imageReshaped(int x, int y, int width, int height) {
-            SwingNode swingNode = swingNodeRef.get();
-            if (swingNode != null) {
-                SwingNodeHelper.setImageBounds(swingNode, x, y, width, height);
-            }
-        }
-        @Override
-        public void imageUpdated(int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight) {
-            SwingNode swingNode = swingNodeRef.get();
-            if (swingNode != null) {
-                SwingNodeHelper.repaintDirtyRegion(swingNode, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
-            }
-        }
-        @Override
-        public void focusGrabbed() {
-            SwingNodeHelper.runOnFxThread(() -> {
-                // On X11 grab is limited to a single XDisplay connection,
-                // so we can't delegate it to another GUI toolkit.
-                if (PlatformUtil.isLinux()) return;
-
-                SwingNode swingNode = swingNodeRef.get();
-                if (swingNode != null) {
-                    Scene scene = swingNode.getScene();
-                    if (scene != null &&
-                            scene.getWindow() != null &&
-                            WindowHelper.getPeer(scene.getWindow()) != null) {
-                        WindowHelper.getPeer(scene.getWindow()).grabFocus();
-                        SwingNodeHelper.setGrabbed(swingNode, true);
-                    }
-                }
-            });
-        }
-        @Override
-        public void focusUngrabbed() {
-            SwingNodeHelper.runOnFxThread(() -> {
-                SwingNode swingNode = swingNodeRef.get();
-                if (swingNode != null) {
-                    Scene scene = swingNode.getScene();
-                    SwingNodeHelper.ungrabFocus(swingNode, false);
-                }
-            });
-        }
-        @Override
-        public void preferredSizeChanged(final int width, final int height) {
-            SwingNodeHelper.runOnFxThread(() -> {
-                SwingNode swingNode = swingNodeRef.get();
-                if (swingNode != null) {
-                    SwingNodeHelper.setSwingPrefWidth(swingNode, width);
-                    SwingNodeHelper.setSwingPrefHeight(swingNode, height);
-                    NodeHelper.notifyLayoutBoundsChanged(swingNode);
-                }
-            });
-        }
-        @Override
-        public void maximumSizeChanged(final int width, final int height) {
-            SwingNodeHelper.runOnFxThread(() -> {
-                SwingNode swingNode = swingNodeRef.get();
-                if (swingNode != null) {
-                    SwingNodeHelper.setSwingMaxWidth(swingNode, width);
-                    SwingNodeHelper.setSwingMaxHeight(swingNode, height);
-                    NodeHelper.notifyLayoutBoundsChanged(swingNode);
-                }
-            });
-        }
-        @Override
-        public void minimumSizeChanged(final int width, final int height) {
-            SwingNodeHelper.runOnFxThread(() -> {
-                SwingNode swingNode = swingNodeRef.get();
-                if (swingNode != null) {
-                    SwingNodeHelper.setSwingMinWidth(swingNode, width);
-                    SwingNodeHelper.setSwingMinHeight(swingNode, height);
-                    NodeHelper.notifyLayoutBoundsChanged(swingNode);
-                }
-            });
-        }
-
-        //@Override
-        public void setCursor(Cursor cursor) {
-            SwingNodeHelper.runOnFxThread(() -> {
-                SwingNode swingNode = swingNodeRef.get();
-                if (swingNode != null) {
-                    swingNode.setCursor(SwingCursors.embedCursorToCursor(cursor));
-                }
-            });
-        }
-
-        private void initDnD() {
-            // This is a part of AWT API, so the method may be invoked on any thread
-            synchronized (SwingNodeContent.this) {
-                if (this.dnd == null) {
-                    SwingNode swingNode = swingNodeRef.get();
-                    if (swingNode != null) {
-                        this.dnd = new FXDnD(swingNode);
-                    }
-                }
-            }
-        }
-
-        //@Override
-        public synchronized <T extends DragGestureRecognizer> T createDragGestureRecognizer(
-                Class<T> abstractRecognizerClass,
-                DragSource ds, Component c, int srcActions,
-                DragGestureListener dgl)
-        {
-            initDnD();
-            return dnd.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
-        }
-
-        //@Override
-        public DragSourceContextPeer createDragSourceContext(DragGestureEvent dge) throws InvalidDnDOperationException
-        {
-            initDnD();
-            return (DragSourceContextPeer)dnd.createDragSourceContext(dge);
-        }
-
-        //@Override
-        public void addDropTarget(DropTarget dt) {
-            initDnD();
-            dnd.addDropTarget(dt);
-        }
-
-        //@Override
-        public void removeDropTarget(DropTarget dt) {
-            initDnD();
-            dnd.removeDropTarget(dt);
-        }
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.swing/src/main/java/module-info.java	Fri Oct 05 05:59:03 2018 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Defines APIs for the JavaFX / Swing interop support included with the
+ * JavaFX UI toolkit, including {@link javafx.embed.swing.SwingNode} (for
+ * embedding Swing inside a JavaFX application) and
+ * {@link javafx.embed.swing.JFXPanel} (for embedding JavaFX inside a Swing
+ * application).
+ *
+ * @moduleGraph
+ * @since 9
+ */
+module javafx.swing {
+    requires java.datatransfer;
+    requires javafx.base;
+    requires jdk.unsupported.desktop;
+
+    requires transitive java.desktop;
+    requires transitive javafx.graphics;
+
+    exports javafx.embed.swing;
+
+    exports com.sun.javafx.embed.swing to
+        javafx.graphics;
+}
--- a/modules/javafx.swing/src/main/module-info/module-info.java	Fri Sep 14 08:35:48 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * Defines APIs for the JavaFX / Swing interop support included with the
- * JavaFX UI toolkit, including {@link javafx.embed.swing.SwingNode} (for
- * embedding Swing inside a JavaFX application) and
- * {@link javafx.embed.swing.JFXPanel} (for embedding JavaFX inside a Swing
- * application).
- *
- * @moduleGraph
- * @since 9
- */
-module javafx.swing {
-    requires java.datatransfer;
-    requires javafx.base;
-    requires static jdk.unsupported.desktop;
-
-    requires transitive java.desktop;
-    requires transitive javafx.graphics;
-
-    exports javafx.embed.swing;
-
-    exports com.sun.javafx.embed.swing to
-        javafx.graphics;
-}