Search in sources :

Example 16 with JFXPanel

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

the class OperatorManagmentControllerTest method testJavaFxFxml.

@Test
public void testJavaFxFxml() throws IOException {
    if (GraphicsEnvironment.isHeadless())
        return;
    // Implizit start of JavaFx.
    new JFXPanel();
    FXMLLoader loader = new FXMLLoader(OperatorManagmentController.loadFxml());
    loader.load();
    assertThat((OperatorManagmentController) loader.getController()).isNotNull();
}
Also used : OperatorManagmentController(eu.ggnet.dwoss.rights.OperatorManagmentController) JFXPanel(javafx.embed.swing.JFXPanel) FXMLLoader(javafx.fxml.FXMLLoader) Test(org.junit.Test)

Example 17 with JFXPanel

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

the class RightsManagmentControllerTest method testJavaFxFxml.

@Test
public void testJavaFxFxml() throws IOException {
    if (GraphicsEnvironment.isHeadless())
        return;
    // Implizit start of JavaFx.
    new JFXPanel();
    Dl.remote().add(RightsAgent.class, new RightsAgentStub());
    FXMLLoader loader = new FXMLLoader(RightsManagmentController.loadFxml());
    loader.load();
    assertThat((RightsManagmentController) loader.getController()).isNotNull();
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) RightsAgentStub(tryout.stub.RightsAgentStub) FXMLLoader(javafx.fxml.FXMLLoader) Test(org.junit.Test)

Example 18 with JFXPanel

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

the class ClientView method initFxComponents.

private void initFxComponents() {
    try {
        progressIndicator = new ProgressIndicator();
        progressIndicator.setProgress(0);
        BorderPane pane = new BorderPane(progressIndicator);
        JFXPanel wrap = SwingCore.wrap(pane);
        extraProgressPanel.add(wrap, BorderLayout.CENTER);
    } catch (InterruptedException ex) {
        Ui.handle(ex);
    }
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) ProgressIndicator(javafx.scene.control.ProgressIndicator)

Example 19 with JFXPanel

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

the class ClientTryout method tryout.

@Test
public void tryout() throws InterruptedException {
    JFXPanel p = new JFXPanel();
    CountDownLatch cdl = new CountDownLatch(1);
    final SwingClient ac = new SwingClient() {

        @Override
        protected void close() {
            System.out.println("closing");
            cdl.countDown();
        }
    };
    ac.init();
    EventQueue.invokeLater(new Runnable() {

        @Override
        public void run() {
            ac.show("Tryout", null);
        }
    });
    cdl.await();
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) CountDownLatch(java.util.concurrent.CountDownLatch) SwingClient(eu.ggnet.saft.runtime.SwingClient) Test(org.junit.Test)

Example 20 with JFXPanel

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

the class SwingCore method jfxPanel.

private static JFXPanel jfxPanel() {
    // HINT: Be sure, that this can be run on any thread.
    JFXPanel result;
    if (startHelper != null) {
        result = startHelper;
        startHelper = null;
    } else {
        result = new JFXPanel();
    }
    return result;
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel)

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