use of javafx.scene.web.WebView in project loinc2hpo by monarch-initiative.
the class PopUps method showHtmlContent.
public static void showHtmlContent(String windowTitle, String resourcePath, Stage ownerWindow) {
Stage window = getPopUpStage(windowTitle);
Stage adjWindow = adjustStagePosition(window, ownerWindow);
adjWindow.initStyle(StageStyle.DECORATED);
adjWindow.setResizable(true);
WebView browser = new WebView();
WebEngine engine = browser.getEngine();
engine.load(PopUps.class.getResource(resourcePath).toString());
adjWindow.setScene(new Scene(browser));
adjWindow.showAndWait();
}
use of javafx.scene.web.WebView in project loinc2hpo by monarch-initiative.
the class SettingsViewFactory method openSettingsDialog.
/**
* Open a dialog that provides concise help for using PhenoteFX.
*/
public static void openSettingsDialog(Model model) {
Stage window;
String windowTitle = "LOINC2HPO Biocuration App Settings";
window = new Stage();
window.setOnCloseRequest(event -> {
window.close();
});
window.setTitle(windowTitle);
Pane pane = new Pane();
VBox vbox = new VBox();
vbox.setPrefHeight(600);
vbox.setPrefWidth(800);
WebView wview = new WebView();
wview.getEngine().loadContent(getHTML(model));
pane.getChildren().add(vbox);
HBox hbox = new HBox();
hbox.setPrefHeight(40);
hbox.setPrefWidth(800);
Region region = new Region();
region.setPrefHeight(40);
region.setPrefWidth(400);
hbox.setHgrow(region, Priority.ALWAYS);
Button button = new Button("Close");
HBox.setMargin(button, new Insets(10, 10, 10, 0));
button.setOnAction(e -> window.close());
hbox.getChildren().addAll(region, button);
vbox.getChildren().addAll(wview, hbox);
Scene scene = new Scene(pane, 800, 600);
String css = SettingsViewFactory.class.getResource("/css/loinc2hpo.css").toExternalForm();
scene.getStylesheets().add(css);
window.setScene(scene);
window.showAndWait();
}
use of javafx.scene.web.WebView in project loinc2hpo by monarch-initiative.
the class HelpViewFactory method openHelpDialog.
/**
* Open a dialog that provides concise help for using PhenoteFX.
*/
public static void openHelpDialog() {
Stage window;
String windowTitle = "LOINC2HPO Biocuration App Help";
window = new Stage();
window.setOnCloseRequest(event -> {
window.close();
});
window.setTitle(windowTitle);
Pane pane = new Pane();
VBox vbox = new VBox();
vbox.setPrefHeight(600);
vbox.setPrefWidth(800);
WebView wview = new WebView();
wview.getEngine().loadContent(getHTML());
pane.getChildren().add(vbox);
HBox hbox = new HBox();
hbox.setPrefHeight(30);
hbox.setPrefWidth(800);
Region region = new Region();
region.setPrefHeight(30);
region.setPrefWidth(400);
hbox.setHgrow(region, Priority.ALWAYS);
Button button = new Button("Close");
button.setOnAction(e -> window.close());
hbox.getChildren().addAll(region, button);
vbox.getChildren().addAll(wview, hbox);
Scene scene = new Scene(pane, 800, 600);
window.setScene(scene);
window.showAndWait();
}
use of javafx.scene.web.WebView in project selenium_java by sergueik.
the class LoginFrame method initMainPanel.
@Override
protected JComponent initMainPanel() {
JFXPanel panel = new JFXPanel();
Platform.runLater(() -> {
webView = new WebView();
WebEngine engine = webView.getEngine();
engine.setJavaScriptEnabled(true);
engine.setUserAgent(USER_AGENT);
addChangeListener(LoginFrame.this);
panel.setScene(new Scene(webView));
});
return panel;
}
use of javafx.scene.web.WebView in project phoenicis by PhoenicisOrg.
the class StepRepresentationHtmlPresentation method drawStepContent.
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
WebView webView = new WebView();
VBox.setVgrow(webView, Priority.ALWAYS);
webView.getEngine().loadContent(htmlToShow);
final URL style = getClass().getResource(String.format("/org/phoenicis/javafx/themes/%s/description.css", getParent().getThemeManager().getCurrentTheme().getShortName()));
webView.getEngine().setUserStyleSheetLocation(style.toString());
contentPane.getChildren().addAll(webView);
getParent().getRoot().setCenter(contentPane);
}
Aggregations