Example usage for javafx.scene.text TextFlow setPadding

List of usage examples for javafx.scene.text TextFlow setPadding

Introduction

In this page you can find the example usage for javafx.scene.text TextFlow setPadding.

Prototype

public final void setPadding(Insets value) 

Source Link

Usage

From source file:de.pixida.logtest.designer.testrun.TestRunEditor.java

public TitledPane createPanelForLaunchingTests() {
    final Button startBtn = new Button("Run Test");
    startBtn.disableProperty().bind(this.testRunService.runningProperty());
    final double startButtonPadding = 8d;
    startBtn.setPadding(new Insets(startButtonPadding));
    startBtn.setGraphic(Icons.getIconGraphics("control_play_blue"));
    HBox.setHgrow(startBtn, Priority.ALWAYS);
    startBtn.setMaxWidth(Double.MAX_VALUE);
    startBtn.setOnAction(event -> {// ww  w.  ja  v  a 2 s . com
        final Job job = this.createJobFromConfig();
        this.testRunService.setJob(job);
        this.testRunService.start();
    });
    final HBox startLine = new HBox();
    startLine.getChildren().add(startBtn);
    final VBox runLines = new VBox();
    final double linesSpacing = 10d;
    runLines.setSpacing(linesSpacing);
    final TextFlow resultBar = new TextFlow();
    resultBar.backgroundProperty().bind(this.resultBarBackgroundProperty);
    this.resultBarBackgroundProperty.set(RESULT_BAR_BACKGROUND_IDLE);
    resultBar.setStyle("-fx-border-color: black; -fx-border-width:1");
    final Text resultBarText = new Text();
    resultBarText.textProperty().bind(this.resultBarTextProperty);
    this.resultBarTextProperty.set("Idle");
    resultBar.getChildren().add(resultBarText);
    resultBar.setTextAlignment(TextAlignment.CENTER);
    final double resultBarPadding = 2d;
    resultBar.setPadding(new Insets(resultBarPadding));
    final int logOutputLinesSize = 25;
    this.resultLogOutputText.setPrefRowCount(logOutputLinesSize);
    this.resultLogOutputText.setEditable(false);
    this.resultLogOutputText.setStyle("-fx-font-family: monospace");
    HBox.setHgrow(this.resultLogOutputText, Priority.ALWAYS);
    runLines.getChildren().addAll(startLine, new Text("Recent results:"), resultBar, this.resultLogOutputText);
    final TitledPane runPane = new TitledPane("Run", runLines);
    runPane.setGraphic(Icons.getIconGraphics("lightning_go"));
    runPane.setCollapsible(false);
    return runPane;
}