use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.
the class SwingCore method wrap.
public static JFXPanel wrap(Pane p) throws InterruptedException {
final JFXPanel fxp = jfxPanel();
final CountDownLatch cdl = new CountDownLatch(1);
if (Platform.isFxApplicationThread()) {
fxp.setScene(new Scene(p, Color.TRANSPARENT));
SWING_PARENT_HELPER.put(fxp.getScene(), fxp);
cdl.countDown();
} else {
Platform.runLater(() -> {
fxp.setScene(new Scene(p));
SWING_PARENT_HELPER.put(fxp.getScene(), fxp);
cdl.countDown();
});
}
cdl.await();
return fxp;
}
use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.
the class SwingCore method ensurePlatformIsRunning.
public static void ensurePlatformIsRunning() {
if (!started) {
startHelper = new JFXPanel();
started = true;
}
}
use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.
the class ShipmentUpdateTryout method tryout.
@Test
public void tryout() throws InterruptedException {
Dl.remote().add(Mandators.class, new Mandators() {
@Override
public Mandator loadMandator() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public DefaultCustomerSalesdata loadSalesdata() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ReceiptCustomers loadReceiptCustomers() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public SpecialSystemCustomers loadSystemCustomers() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Contractors loadContractors() {
return new Contractors(EnumSet.allOf(TradeName.class), EnumSet.allOf(TradeName.class));
}
@Override
public PostLedger loadPostLedger() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ShippingTerms loadShippingTerms() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
});
// To start the platform
new JFXPanel();
Shipment s = new Shipment();
Platform.runLater(() -> {
ShipmentUpdateStage stage = new ShipmentUpdateStage(s);
stage.showAndWait();
System.out.println(stage.getShipment());
complete = true;
});
while (!complete) {
Thread.sleep(500);
}
}
use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.
the class DocumentUpdateView method initFxComponents.
private void initFxComponents() {
final JFXPanel jfxp = new JFXPanel();
positionPanelFx.add(jfxp, BorderLayout.CENTER);
Platform.runLater(() -> {
BorderPane pane = new BorderPane();
Scene scene = new Scene(pane, Color.ALICEBLUE);
positionsFxList = new ListView<>();
positionsFxList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
positionsFxList.setCellFactory(new PositionListCell.Factory());
positionsFxList.setItems(positions);
positionsFxList.setOnMouseClicked((mouseEvent) -> {
if (mouseEvent.getButton().equals(MouseButton.PRIMARY) && mouseEvent.getClickCount() == 2) {
if (isChangeAllowed()) {
Ui.exec(() -> {
controller.editPosition(positionsFxList.getSelectionModel().getSelectedItem());
Platform.runLater(() -> positionsFxList.refresh());
});
} else {
Ui.build(this).alert("Ă„nderung an Positionen ist nicht erlaubt.");
}
}
});
pane.setCenter(positionsFxList);
jfxp.setScene(scene);
});
}
use of javafx.embed.swing.JFXPanel in project dwoss by gg-net.
the class ReportHtmlTryout method tryout.
@Test
public void tryout() throws InterruptedException, InvocationTargetException, MalformedURLException {
Report report = new Report("TestReport", ALSO, _2011_10_01, _2011_10_07);
report.setComment("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");
// Implicit start the platform.
new JFXPanel();
Platform.runLater(() -> {
Stage stage = new Stage();
stage.setTitle("HtmlViewer");
WebView view = new WebView();
view.getEngine().loadContent(Css.toHtml5WithStyle(report.toHtml()));
BorderPane p = new BorderPane(view);
Scene scene = new Scene(p, Color.ALICEBLUE);
stage.setScene(scene);
stage.showAndWait();
complete = true;
});
while (!complete) {
Thread.sleep(500);
}
}
Aggregations