Search in sources :

Example 66 with ScrollPane

use of javafx.scene.control.ScrollPane in project jvarkit by lindenb.

the class VcfStage method buildJavascriptPane.

private Tab buildJavascriptPane() {
    final ScrollPane scroll = new ScrollPane(super.javascriptArea);
    scroll.setFitToWidth(true);
    scroll.setFitToHeight(true);
    final BorderPane pane = new BorderPane(scroll);
    if (this.owner.javascriptCompiler.isPresent()) {
        final HBox flowPane = new HBox(new Label("set following FILTER on rejection:"), javascriptFILTERfield);
        this.javascriptFILTERfield.setPrefColumnCount(30);
        this.javascriptFILTERfield.setPromptText("If not empty , don't discard the variant but set the FILTER");
        flowPane.getChildren().addAll(super.makeJavascriptButtons());
        pane.setTop(flowPane);
    }
    final FlowPane bottom = new FlowPane(new TextFlow(new Text("The script injects:\n" + "* '" + HEADER_CONTEXT_KEY + "' an instance of  "), javadocFor(VCFHeader.class), new Text("\n" + "* '" + VARIANT_CONTEXT_KEY + "' an instance of "), javadocFor(VariantContext.class), new Text(" )\n" + "* '" + PEDIGREE_CONTEXT_KEY + "' an instance of "), javadocFor(PedFile.class), new Text("\n" + "* '" + TOOL_CONTEXT_KEY + "' an instance of "), javadocFor(VcfTools.class), new Text("\n" + "The script should return a boolean: true (accept variant) or false (reject variant)")));
    pane.setBottom(bottom);
    final Tab tab = new Tab(JAVASCRIPT_TAB_KEY, pane);
    tab.setClosable(false);
    return tab;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) Tab(javafx.scene.control.Tab) ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) FlowPane(javafx.scene.layout.FlowPane) TextFlow(javafx.scene.text.TextFlow) Text(javafx.scene.text.Text)

Example 67 with ScrollPane

use of javafx.scene.control.ScrollPane in project jvarkit by lindenb.

the class JfxLauncher method displayAlert.

protected void displayAlert(final Throwable err) {
    final Alert alert = new Alert(AlertType.ERROR);
    alert.setHeaderText("Cannot create Command.");
    alert.setContentText(String.valueOf(err.getMessage()));
    // Create expandable Exception.
    final StringWriter sw = new StringWriter();
    final PrintWriter pw = new PrintWriter(sw);
    err.printStackTrace(pw);
    final TextArea textArea = new TextArea(sw.toString());
    textArea.setEditable(false);
    textArea.setWrapText(true);
    final BorderPane pane = new BorderPane(new ScrollPane(textArea));
    alert.getDialogPane().setExpandableContent(pane);
    alert.showAndWait();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) StringWriter(java.io.StringWriter) TextArea(javafx.scene.control.TextArea) ScrollPane(javafx.scene.control.ScrollPane) Alert(javafx.scene.control.Alert) PrintWriter(java.io.PrintWriter)

Example 68 with ScrollPane

use of javafx.scene.control.ScrollPane in project POL-POM-5 by PhoenicisOrg.

the class StepRepresentationMessage method drawStepContent.

@Override
protected void drawStepContent() {
    Text textWidget = new Text(textToShow);
    textWidget.setId("stepText");
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setId("stepScrollPane");
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setFitToWidth(true);
    scrollPane.setContent(new TextFlow(textWidget));
    this.addToContentPane(scrollPane);
    VBox.setVgrow(scrollPane, Priority.ALWAYS);
}
Also used : ScrollPane(javafx.scene.control.ScrollPane) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow)

Example 69 with ScrollPane

use of javafx.scene.control.ScrollPane in project POL-POM-5 by PhoenicisOrg.

the class ApplicationInformationPanelSkin method initialise.

/**
 * {@inheritDoc}
 */
@Override
public void initialise() {
    final WebView appDescription = new WebView();
    appDescription.getEngine().userStyleSheetLocationProperty().bind(getControl().webEngineStylesheetProperty());
    VBox.setVgrow(appDescription, Priority.ALWAYS);
    getControl().applicationProperty().addListener((Observable invalidation) -> updateDescription(appDescription));
    updateDescription(appDescription);
    final Label installers = new Label(tr("Installers"));
    installers.getStyleClass().add("descriptionTitle");
    final GridPane scriptGrid = new GridPane();
    filteredScripts.addListener((InvalidationListener) change -> updateScripts(scriptGrid));
    getControl().showScriptSourceProperty().addListener((Observable invalidation) -> updateScripts(scriptGrid));
    updateScripts(scriptGrid);
    final HBox miniaturesPane = new HBox();
    miniaturesPane.getStyleClass().add("appPanelMiniaturesPane");
    Bindings.bindContent(miniaturesPane.getChildren(), miniatures);
    final ScrollPane miniaturesPaneWrapper = new ScrollPane(miniaturesPane);
    miniaturesPaneWrapper.getStyleClass().add("appPanelMiniaturesPaneWrapper");
    miniatureHeight.bind(miniaturesPaneWrapper.heightProperty().multiply(0.8));
    final VBox container = new VBox(appDescription, installers, scriptGrid, miniaturesPaneWrapper);
    getChildren().add(container);
    // ensure that the content of the details panel changes when the to be shown application changes
    getControl().applicationProperty().addListener((Observable invalidation) -> updateApplication());
    // initialise the content of the details panel correct
    updateApplication();
}
Also used : Button(javafx.scene.control.Button) OperatingSystem(org.phoenicis.entities.OperatingSystem) javafx.scene.layout(javafx.scene.layout) MappedList(org.phoenicis.javafx.collections.MappedList) FXCollections(javafx.collections.FXCollections) DoubleProperty(javafx.beans.property.DoubleProperty) Bindings(javafx.beans.binding.Bindings) InvalidationListener(javafx.beans.InvalidationListener) ErrorDialog(org.phoenicis.javafx.dialogs.ErrorDialog) ScrollPane(javafx.scene.control.ScrollPane) URI(java.net.URI) Tooltip(javafx.scene.control.Tooltip) SkinBase(org.phoenicis.javafx.components.common.skin.SkinBase) WebView(javafx.scene.web.WebView) Label(javafx.scene.control.Label) Value(org.graalvm.polyglot.Value) FilteredList(javafx.collections.transformation.FilteredList) Localisation.tr(org.phoenicis.configuration.localisation.Localisation.tr) Observable(javafx.beans.Observable) ApplicationInformationPanel(org.phoenicis.javafx.components.application.control.ApplicationInformationPanel) ApplicationDTO(org.phoenicis.repository.dto.ApplicationDTO) Platform(javafx.application.Platform) Installer(org.phoenicis.scripts.Installer) ImageView(javafx.scene.image.ImageView) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) OperatingSystemFetcher(org.phoenicis.tools.system.OperatingSystemFetcher) ObservableList(javafx.collections.ObservableList) Image(javafx.scene.image.Image) ScriptDTO(org.phoenicis.repository.dto.ScriptDTO) ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) WebView(javafx.scene.web.WebView) Observable(javafx.beans.Observable)

Example 70 with ScrollPane

use of javafx.scene.control.ScrollPane in project POL-POM-5 by PhoenicisOrg.

the class ContainerEngineSettingsPanelSkin method initialise.

/**
 * {@inheritDoc}
 */
@Override
public void initialise() {
    final Text title = new Text(tr("Engine Settings"));
    title.getStyleClass().add("title");
    final GridPane engineSettingsGrid = new GridPane();
    engineSettingsGrid.getStyleClass().add("engine-settings-grid");
    // ensure that the shown engine settings are always up to date
    getControl().containerProperty().addListener((Observable invalidation) -> updateEngineSettingsGrid(engineSettingsGrid));
    getControl().getEngineSettings().addListener((Observable invalidation) -> updateEngineSettingsGrid(engineSettingsGrid));
    // ensure that the shown engine settings are correctly initialized
    updateEngineSettingsGrid(engineSettingsGrid);
    final ScrollPane engineSettingsScrollPane = new ScrollPane(engineSettingsGrid);
    engineSettingsScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    engineSettingsScrollPane.setFitToWidth(true);
    VBox.setVgrow(engineSettingsScrollPane, Priority.ALWAYS);
    final VBox container = new VBox(title, engineSettingsScrollPane);
    container.getStyleClass().addAll("container-details-panel", "container-engine-settings-panel");
    getChildren().setAll(container);
}
Also used : GridPane(javafx.scene.layout.GridPane) ScrollPane(javafx.scene.control.ScrollPane) Text(javafx.scene.text.Text) VBox(javafx.scene.layout.VBox) Observable(javafx.beans.Observable)

Aggregations

ScrollPane (javafx.scene.control.ScrollPane)71 VBox (javafx.scene.layout.VBox)18 Text (javafx.scene.text.Text)15 Scene (javafx.scene.Scene)14 Label (javafx.scene.control.Label)13 Insets (javafx.geometry.Insets)11 Button (javafx.scene.control.Button)11 BorderPane (javafx.scene.layout.BorderPane)11 HBox (javafx.scene.layout.HBox)10 GridPane (javafx.scene.layout.GridPane)9 TextFlow (javafx.scene.text.TextFlow)8 FXCollections (javafx.collections.FXCollections)7 Node (javafx.scene.Node)7 TextArea (javafx.scene.control.TextArea)7 javafx.scene.layout (javafx.scene.layout)7 Pane (javafx.scene.layout.Pane)7 InvalidationListener (javafx.beans.InvalidationListener)6 Observable (javafx.beans.Observable)6 ObservableList (javafx.collections.ObservableList)6 Alert (javafx.scene.control.Alert)6