< prev index next >

modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/SwingFXUtilsImpl.java

Print this page

        

*** 31,42 **** import java.awt.SecondaryLoop; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.concurrent.atomic.AtomicBoolean; import javafx.application.Platform; ! import sun.awt.AWTAccessor; ! import sun.awt.FwDispatcher; public class SwingFXUtilsImpl { private static class FwSecondaryLoop implements SecondaryLoop { --- 31,41 ---- import java.awt.SecondaryLoop; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.concurrent.atomic.AtomicBoolean; import javafx.application.Platform; ! import jdk.swing.interop.DispatcherWrapper; public class SwingFXUtilsImpl { private static class FwSecondaryLoop implements SecondaryLoop {
*** 63,73 **** } return false; } } ! private static class FXDispatcher implements FwDispatcher { @Override public boolean isDispatchThread() { return Platform.isFxApplicationThread(); } --- 62,72 ---- } return false; } } ! private static class FXDispatcher extends DispatcherWrapper { @Override public boolean isDispatchThread() { return Platform.isFxApplicationThread(); }
*** 88,100 **** (PrivilegedAction<EventQueue>) () -> java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue()); } //Called with reflection from PlatformImpl to avoid dependency public static void installFwEventQueue() { ! AWTAccessor.getEventQueueAccessor().setFwDispatcher(getEventQueue(), new FXDispatcher()); } //Called with reflection from PlatformImpl to avoid dependency public static void removeFwEventQueue() { ! AWTAccessor.getEventQueueAccessor().setFwDispatcher(getEventQueue(), null); } } --- 87,99 ---- (PrivilegedAction<EventQueue>) () -> java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue()); } //Called with reflection from PlatformImpl to avoid dependency public static void installFwEventQueue() { ! DispatcherWrapper.setFwDispatcher(getEventQueue(), new FXDispatcher()); } //Called with reflection from PlatformImpl to avoid dependency public static void removeFwEventQueue() { ! DispatcherWrapper.setFwDispatcher(getEventQueue(), null); } }
< prev index next >