Search in sources :

Example 21 with JFXPanel

use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.

the class SwingCore method wrapDirect.

/**
 * Wrap a pane into a JFXPanel on the actual thread, the user must be aware, that this must be run on the JavaFx Thread.
 *
 * @param pane a Pane to be wrapped.
 * @return a CompletableFuture creating the JFXPanel
 */
public static JFXPanel wrapDirect(Pane pane) {
    JFXPanel fxp = jfxPanel();
    fxp.setScene(new Scene(pane, Color.TRANSPARENT));
    SWING_PARENT_HELPER.put(fxp.getScene(), fxp);
    return fxp;
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) Scene(javafx.scene.Scene)

Example 22 with JFXPanel

use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.

the class BuilderUtil method wrapPane.

/**
 * Plafrom.runlater() : Wraps a pane into a jfxpanel, which must have been set on the in.getPanel.
 *
 * @param in
 * @return modified in.
 */
static UiParameter wrapPane(UiParameter in) {
    if (!(in.getJPanel() instanceof JFXPanel))
        throw new IllegalArgumentException("JPanel not instance of JFXPanel : " + in);
    JFXPanel fxp = (JFXPanel) in.getJPanel();
    fxp.setScene(new Scene(in.getPane(), Color.TRANSPARENT));
    SwingCore.mapParent(fxp);
    return in;
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) Scene(javafx.scene.Scene)

Example 23 with JFXPanel

use of javafx.embed.swing.JFXPanel 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)

Example 24 with JFXPanel

use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.

the class RevenueReportSelectorPane method main.

public static void main(String[] args) throws InterruptedException {
    final JFXPanel p = new JFXPanel();
    final CountDownLatch block = new CountDownLatch(1);
    Platform.runLater(() -> {
        RevenueReportSelectorPane pane = new RevenueReportSelectorPane();
        Stage stage = new Stage();
        stage.setScene(new Scene(pane));
        stage.showAndWait();
        block.countDown();
    });
    block.await();
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) Stage(javafx.stage.Stage) CountDownLatch(java.util.concurrent.CountDownLatch) Scene(javafx.scene.Scene)

Example 25 with JFXPanel

use of javafx.embed.swing.JFXPanel in project sakuli by ConSol.

the class AbstractUiTestApplicationIT method startUiApplication.

/**
 * Starts the example {@link UiTestApplication}
 */
protected Stage startUiApplication() {
    logger.info("............................START");
    final UiTestApplication uiTestApplication = new UiTestApplication();
    new JFXPanel();
    Platform.runLater(uiTestApplication);
    return UiTestApplication.stage;
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) UiTestApplication(org.sakuli.integration.ui.app.UiTestApplication)

Aggregations

JFXPanel (javafx.embed.swing.JFXPanel)50 Scene (javafx.scene.Scene)16 Test (org.junit.Test)16 CountDownLatch (java.util.concurrent.CountDownLatch)11 Dimension (java.awt.Dimension)6 BorderPane (javafx.scene.layout.BorderPane)6 Stage (javafx.stage.Stage)6 FXMLLoader (javafx.fxml.FXMLLoader)5 WebView (javafx.scene.web.WebView)5 BaseDocumentTest (com.kasirgalabs.etumulator.document.BaseDocumentTest)4 BorderLayout (java.awt.BorderLayout)4 WindowAdapter (java.awt.event.WindowAdapter)4 WindowEvent (java.awt.event.WindowEvent)4 ExecutorService (java.util.concurrent.ExecutorService)4 JFrame (javax.swing.JFrame)4 WebEngine (javafx.scene.web.WebEngine)3 PropertyChangeEvent (java.beans.PropertyChangeEvent)2 Random (java.util.Random)2 FutureTask (java.util.concurrent.FutureTask)2 Memory (php.runtime.Memory)2