JDK-8211249 : Refactor javafx.swing implementation to get rid of unneeded abstraction layer
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: swing
  • Affected Version: openjfx12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-09-27
  • Updated: 2018-12-18
  • Resolved: 2018-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx12Fixed
Related Reports
Blocks :  
Description
As part of decoupling JavaFX from the JDK we needed to change the implementation of FX / Swing interop to use public API provided in JDK 11 in the jdk.unsupported.desktop module.

As a transitional step, we allow building and running openjfx 11 with either JDK 10 or JDK 11. To achieve this, we created an abstraction layer with a few abstract classes, and an InteropFactory that provides one of two concrete implementations: an "old" JDK-10-based implementation and a "new", JDK-11-based implementation.

The old implementation is removed in openjfx12 by JDK-8210092, leaving only the new, JDK-11-based implementation. We could clean up the code by removing the abstraction layer and the factory class, and creating and using the new implementation classes directly.

The following classes make up the abstraction layer:
    SwingNodeInterop
    JFXPanelInterop
    FXDnDInterop
    SwingFXUtilsImplInterop
Comments
Changeset: 1f990b4b789a Author: psadhukhan Date: 2018-12-17 11:35 +0530 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/1f990b4b789a
17-12-2018

+1 Since this is a safe refactoring, you don't need a second reviewer.
14-12-2018

Yes, I changed in intentionally. In SwingNode, JFXPanel it was an instance variable. I guess it should be created every time FXDnD object is created just as we do for SwingNode,JFXPanel object.
14-12-2018

In FXDnD.java you have changed fxdndiop from a static variable to an instance variable. Was this intentional? The rest looks fine, but I haven't tested it yet.
13-12-2018

Webrev: http://cr.openjdk.java.net/~psadhukhan/fx/8211249/webrev.0/
13-12-2018