Search in sources :

Example 16 with Text

use of javafx.scene.text.Text in project SmartCity-Market by TechnionYP5777.

the class DialogMessagesService method alertCreator.

private static void alertCreator(String title, String header, String content) {
    JFXDialogLayout dialogContent = new JFXDialogLayout();
    dialogContent.setHeading(new Text(header == null ? title : title + "\n" + header));
    dialogContent.setBody(new Text(content));
    JFXButton close = new JFXButton("Close");
    close.getStyleClass().add("JFXButton");
    dialogContent.setActions(close);
    JFXDialog dialog = new JFXDialog((StackPane) AbstractApplicationScreen.stage.getScene().getRoot(), dialogContent, JFXDialog.DialogTransition.CENTER);
    close.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent __) {
            dialog.close();
        }
    });
    dialog.show();
}
Also used : ActionEvent(javafx.event.ActionEvent) JFXDialog(com.jfoenix.controls.JFXDialog) Text(javafx.scene.text.Text) JFXButton(com.jfoenix.controls.JFXButton) JFXDialogLayout(com.jfoenix.controls.JFXDialogLayout)

Example 17 with Text

use of javafx.scene.text.Text in project Smartcity-Smarthouse by TechnionYP5777.

the class Controller method printUpdateMessage.

private void printUpdateMessage() {
    final ObservableList<Node> children = console.getChildren();
    Text text = new Text("Sending update message: {on: ");
    text.setStyle(STYLE_REG);
    children.add(0, text);
    text = new Text(on + "");
    text.setStyle(on ? STYLE_ON : STYLE_OFF);
    children.add(1, text);
    text = new Text(", temperature: ");
    text.setStyle(STYLE_REG);
    children.add(2, text);
    text = new Text((int) tempSlider.getValue() + "");
    text.setStyle(STYLE_TEMP);
    children.add(3, text);
    text = new Text("}\n");
    text.setStyle(STYLE_REG);
    children.add(4, text);
}
Also used : Node(javafx.scene.Node) Text(javafx.scene.text.Text)

Example 18 with Text

use of javafx.scene.text.Text in project POL-POM-5 by PlayOnLinux.

the class WinePrefixContainerDisplayTab method populate.

private void populate() {
    final VBox displayPane = new VBox();
    final Text title = new TextWithStyle(tr("Display settings"), TITLE_CSS_CLASS);
    displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
    displayPane.getChildren().add(title);
    final GridPane displayContentPane = new GridPane();
    displayContentPane.getStyleClass().add("grid");
    final ComboBox<UseGLSL> glslComboBox = new ComboBox<>();
    glslComboBox.setMaxWidth(Double.MAX_VALUE);
    glslComboBox.setValue(container.getUseGlslValue());
    glslComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(glslComboBox, UseGLSL.class);
    displayContentPane.add(new TextWithStyle(tr("GLSL support"), CAPTION_TITLE_CSS_CLASS), 0, 0);
    displayContentPane.add(glslComboBox, 1, 0);
    final ComboBox<DirectDrawRenderer> directDrawRendererComboBox = new ComboBox<>();
    directDrawRendererComboBox.setMaxWidth(Double.MAX_VALUE);
    directDrawRendererComboBox.setValue(container.getDirectDrawRenderer());
    directDrawRendererComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(directDrawRendererComboBox, DirectDrawRenderer.class);
    displayContentPane.add(new TextWithStyle(tr("Direct Draw Renderer"), CAPTION_TITLE_CSS_CLASS), 0, 1);
    displayContentPane.add(directDrawRendererComboBox, 1, 1);
    final ComboBox<VideoMemorySize> videoMemorySizeComboBox = new ComboBox<>();
    videoMemorySizeComboBox.setMaxWidth(Double.MAX_VALUE);
    videoMemorySizeComboBox.setValue(container.getVideoMemorySize());
    videoMemorySizeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItemsVideoMemorySize(videoMemorySizeComboBox);
    displayContentPane.add(new TextWithStyle(tr("Video memory size"), CAPTION_TITLE_CSS_CLASS), 0, 2);
    displayContentPane.add(videoMemorySizeComboBox, 1, 2);
    final ComboBox<OffscreenRenderingMode> offscreenRenderingModeComboBox = new ComboBox<>();
    offscreenRenderingModeComboBox.setMaxWidth(Double.MAX_VALUE);
    offscreenRenderingModeComboBox.setValue(container.getOffscreenRenderingMode());
    offscreenRenderingModeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(offscreenRenderingModeComboBox, OffscreenRenderingMode.class);
    displayContentPane.add(new TextWithStyle(tr("Offscreen rendering mode"), CAPTION_TITLE_CSS_CLASS), 0, 3);
    displayContentPane.add(offscreenRenderingModeComboBox, 1, 3);
    final ComboBox<RenderTargetModeLock> renderTargetModeLockComboBox = new ComboBox<>();
    renderTargetModeLockComboBox.setMaxWidth(Double.MAX_VALUE);
    renderTargetModeLockComboBox.setValue(container.getRenderTargetModeLock());
    renderTargetModeLockComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(renderTargetModeLockComboBox, RenderTargetModeLock.class);
    displayContentPane.add(new TextWithStyle(tr("Render target lock mode"), CAPTION_TITLE_CSS_CLASS), 0, 4);
    displayContentPane.add(renderTargetModeLockComboBox, 1, 4);
    final ComboBox<Multisampling> multisamplingComboBox = new ComboBox<>();
    multisamplingComboBox.setMaxWidth(Double.MAX_VALUE);
    multisamplingComboBox.setValue(container.getMultisampling());
    multisamplingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(multisamplingComboBox, Multisampling.class);
    displayContentPane.add(new TextWithStyle(tr("Multisampling"), CAPTION_TITLE_CSS_CLASS), 0, 5);
    displayContentPane.add(multisamplingComboBox, 1, 5);
    final ComboBox<StrictDrawOrdering> strictDrawOrderingComboBox = new ComboBox<>();
    strictDrawOrderingComboBox.setMaxWidth(Double.MAX_VALUE);
    strictDrawOrderingComboBox.setValue(container.getStrictDrawOrdering());
    strictDrawOrderingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(strictDrawOrderingComboBox, StrictDrawOrdering.class);
    displayContentPane.add(new TextWithStyle(tr("Strict Draw Ordering"), CAPTION_TITLE_CSS_CLASS), 0, 6);
    displayContentPane.add(strictDrawOrderingComboBox, 1, 6);
    final ComboBox<AlwaysOffscreen> alwaysOffscreenComboBox = new ComboBox<>();
    alwaysOffscreenComboBox.setMaxWidth(Double.MAX_VALUE);
    alwaysOffscreenComboBox.setValue(container.getAlwaysOffscreen());
    alwaysOffscreenComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(alwaysOffscreenComboBox, AlwaysOffscreen.class);
    displayContentPane.add(new TextWithStyle(tr("Always Offscreen"), CAPTION_TITLE_CSS_CLASS), 0, 7);
    displayContentPane.add(alwaysOffscreenComboBox, 1, 7);
    Region spacer = new Region();
    GridPane.setHgrow(spacer, Priority.ALWAYS);
    displayContentPane.add(spacer, 2, 0);
    displayPane.getChildren().addAll(displayContentPane);
    this.setContent(displayPane);
    lockableElements.addAll(Arrays.asList(glslComboBox, directDrawRendererComboBox, offscreenRenderingModeComboBox, renderTargetModeLockComboBox, multisamplingComboBox, strictDrawOrderingComboBox, alwaysOffscreenComboBox, videoMemorySizeComboBox));
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) GridPane(javafx.scene.layout.GridPane) ComboBox(javafx.scene.control.ComboBox) Text(javafx.scene.text.Text) Region(javafx.scene.layout.Region) VBox(javafx.scene.layout.VBox)

Example 19 with Text

use of javafx.scene.text.Text in project POL-POM-5 by PlayOnLinux.

the class WinePrefixContainerInformationTab method populate.

private void populate() {
    final VBox informationPane = new VBox();
    final Text title = new TextWithStyle(tr("Information"), TITLE_CSS_CLASS);
    informationPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
    informationPane.getChildren().add(title);
    final GridPane informationContentPane = new GridPane();
    informationContentPane.getStyleClass().add("grid");
    informationContentPane.add(new TextWithStyle(tr("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0);
    Label name = new Label(container.getName());
    name.setWrapText(true);
    informationContentPane.add(name, 1, 0);
    informationContentPane.add(new TextWithStyle(tr("Path:"), CAPTION_TITLE_CSS_CLASS), 0, 1);
    Label path = new Label(container.getPath());
    path.setWrapText(true);
    informationContentPane.add(path, 1, 1);
    informationContentPane.add(new TextWithStyle(tr("Wine version:"), CAPTION_TITLE_CSS_CLASS), 0, 2);
    Label version = new Label(container.getVersion());
    version.setWrapText(true);
    informationContentPane.add(version, 1, 2);
    informationContentPane.add(new TextWithStyle(tr("Wine architecture:"), CAPTION_TITLE_CSS_CLASS), 0, 3);
    Label architecture = new Label(container.getArchitecture());
    architecture.setWrapText(true);
    informationContentPane.add(architecture, 1, 3);
    informationContentPane.add(new TextWithStyle(tr("Wine distribution:"), CAPTION_TITLE_CSS_CLASS), 0, 4);
    Label distribution = new Label(container.getDistribution());
    distribution.setWrapText(true);
    informationContentPane.add(distribution, 1, 4);
    Region spacer = new Region();
    spacer.setPrefHeight(20);
    VBox.setVgrow(spacer, Priority.NEVER);
    ComboBox<EngineVersionDTO> changeEngineComboBox = new ComboBox<EngineVersionDTO>(FXCollections.observableList(engineVersions));
    changeEngineComboBox.setConverter(new StringConverter<EngineVersionDTO>() {

        @Override
        public String toString(EngineVersionDTO object) {
            return object.getVersion();
        }

        @Override
        public EngineVersionDTO fromString(String string) {
            return engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(string)).findFirst().get();
        }
    });
    changeEngineComboBox.getSelectionModel().select(engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(container.getVersion())).findFirst().get());
    Button deleteButton = new Button(tr("Delete container"));
    deleteButton.setOnMouseClicked(event -> this.onDeletePrefix.accept(container));
    informationPane.getChildren().addAll(informationContentPane, spacer, changeEngineComboBox, deleteButton);
    this.setContent(informationPane);
}
Also used : Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) FXCollections(javafx.collections.FXCollections) Localisation.tr(org.phoenicis.configuration.localisation.Localisation.tr) StringConverter(javafx.util.StringConverter) VBox(javafx.scene.layout.VBox) EngineVersionDTO(org.phoenicis.engines.dto.EngineVersionDTO) Text(javafx.scene.text.Text) Consumer(java.util.function.Consumer) Priority(javafx.scene.layout.Priority) List(java.util.List) Region(javafx.scene.layout.Region) ComboBox(javafx.scene.control.ComboBox) Tab(javafx.scene.control.Tab) WinePrefixContainerDTO(org.phoenicis.containers.dto.WinePrefixContainerDTO) GridPane(javafx.scene.layout.GridPane) TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) GridPane(javafx.scene.layout.GridPane) ComboBox(javafx.scene.control.ComboBox) Label(javafx.scene.control.Label) Text(javafx.scene.text.Text) EngineVersionDTO(org.phoenicis.engines.dto.EngineVersionDTO) Button(javafx.scene.control.Button) Region(javafx.scene.layout.Region) VBox(javafx.scene.layout.VBox)

Example 20 with Text

use of javafx.scene.text.Text in project POL-POM-5 by PlayOnLinux.

the class WinePrefixContainerToolsTab method wineToolCaption.

private Text wineToolCaption(String caption) {
    final Text text = new TextWithStyle(caption, "wineToolCaption");
    GridPane.setHalignment(text, HPos.CENTER);
    GridPane.setValignment(text, VPos.CENTER);
    lockableElements.add(text);
    return text;
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) Text(javafx.scene.text.Text)

Aggregations

Text (javafx.scene.text.Text)313 VBox (javafx.scene.layout.VBox)55 TextFlow (javafx.scene.text.TextFlow)55 Label (javafx.scene.control.Label)51 Pane (javafx.scene.layout.Pane)34 Font (javafx.scene.text.Font)30 Button (javafx.scene.control.Button)25 Region (javafx.scene.layout.Region)25 Group (javafx.scene.Group)23 GridPane (javafx.scene.layout.GridPane)23 List (java.util.List)22 Rectangle (javafx.scene.shape.Rectangle)22 HBox (javafx.scene.layout.HBox)21 StackPane (javafx.scene.layout.StackPane)20 Color (javafx.scene.paint.Color)20 Insets (javafx.geometry.Insets)17 Canvas (javafx.scene.canvas.Canvas)17 Circle (javafx.scene.shape.Circle)17 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)17 ScrollPane (javafx.scene.control.ScrollPane)16