Search in sources :

Example 1 with DwPreloader

use of eu.ggnet.dwoss.assembly.remote.DwPreloader in project dwoss by gg-net.

the class DwPreloaderTryout method tryoutPreloader.

@Test
public void tryoutPreloader() throws InterruptedException {
    JFXPanel p = new JFXPanel();
    final CountDownLatch cdl = new CountDownLatch(1);
    DwPreloader pre = new DwPreloader();
    Platform.runLater(() -> {
        try {
            Stage stage = new Stage();
            stage.initStyle(StageStyle.UNDECORATED);
            pre.start(stage);
            cdl.countDown();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    });
    cdl.await();
    Thread.sleep(2000);
    final CountDownLatch cdl2 = new CountDownLatch(1);
    Platform.runLater(() -> {
        pre.handleStateChangeNotification(new StateChangeNotification(StateChangeNotification.Type.BEFORE_START));
        cdl2.countDown();
    });
    cdl2.await();
    Thread.sleep(2000);
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) DwPreloader(eu.ggnet.dwoss.assembly.remote.DwPreloader) CountDownLatch(java.util.concurrent.CountDownLatch) StateChangeNotification(javafx.application.Preloader.StateChangeNotification) Test(org.junit.Test)

Aggregations

DwPreloader (eu.ggnet.dwoss.assembly.remote.DwPreloader)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 StateChangeNotification (javafx.application.Preloader.StateChangeNotification)1 JFXPanel (javafx.embed.swing.JFXPanel)1 Test (org.junit.Test)1