Example usage for javafx.scene.text Text Text

List of usage examples for javafx.scene.text Text Text

Introduction

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

Prototype

public Text() 

Source Link

Document

Creates an empty instance of Text.

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 -> {//from ww w. java2 s. c  o  m
        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;
}