Search in sources :

Example 31 with WebView

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();
}
Also used : WebView(javafx.scene.web.WebView) Scene(javafx.scene.Scene) WebEngine(javafx.scene.web.WebEngine)

Example 32 with WebView

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();
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Stage(javafx.stage.Stage) WebView(javafx.scene.web.WebView) Scene(javafx.scene.Scene)

Example 33 with WebView

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();
}
Also used : Button(javafx.scene.control.Button) Stage(javafx.stage.Stage) WebView(javafx.scene.web.WebView) Scene(javafx.scene.Scene)

Example 34 with WebView

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;
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) WebView(javafx.scene.web.WebView) Scene(javafx.scene.Scene) WebEngine(javafx.scene.web.WebEngine)

Example 35 with WebView

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);
}
Also used : Label(javafx.scene.control.Label) WebView(javafx.scene.web.WebView) VBox(javafx.scene.layout.VBox) URL(java.net.URL)

Aggregations

WebView (javafx.scene.web.WebView)50 Scene (javafx.scene.Scene)31 WebEngine (javafx.scene.web.WebEngine)15 BorderPane (javafx.scene.layout.BorderPane)10 Button (javafx.scene.control.Button)9 URL (java.net.URL)8 ObservableValue (javafx.beans.value.ObservableValue)7 Label (javafx.scene.control.Label)7 Tooltip (javafx.scene.control.Tooltip)7 StackPane (javafx.scene.layout.StackPane)6 VBox (javafx.scene.layout.VBox)6 Stage (javafx.stage.Stage)6 State (javafx.concurrent.Worker.State)5 JFXPanel (javafx.embed.swing.JFXPanel)5 ScrollPane (javafx.scene.control.ScrollPane)5 JFrame (javax.swing.JFrame)5 URI (java.net.URI)4 InvalidationListener (javafx.beans.InvalidationListener)4 FXCollections (javafx.collections.FXCollections)4 javafx.scene.layout (javafx.scene.layout)4