Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211249

Refactor javafx.swing implementation to get rid of unneeded abstraction layer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx12
    • jfx12
    • javafx

      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

            psadhukhan Prasanta Sadhukhan
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: