Search in sources :

Example 1 with TilePane

use of javafx.scene.layout.TilePane in project org.csstudio.display.builder by kasemir.

the class Palette method createWidgetCategoryPanes.

/**
 * Create a TilePane for each WidgetCategory
 *  @param parent Parent Pane
 *  @return Map of panes for each category
 */
private Map<WidgetCategory, Pane> createWidgetCategoryPanes(final Pane parent) {
    final Map<WidgetCategory, Pane> palette_groups = new HashMap<>();
    for (final WidgetCategory category : WidgetCategory.values()) {
        final TilePane palette_group = new TilePane();
        palette_group.getStyleClass().add("palette_group");
        palette_group.setPrefColumns(1);
        palette_group.setMaxWidth(Double.MAX_VALUE);
        palette_groups.put(category, palette_group);
        palette_group.setHgap(2);
        palette_group.setVgap(2);
        final TitledPane pane = new TitledPane(category.getDescription(), palette_group);
        pane.getStyleClass().add("palette_category");
        parent.getChildren().add(pane);
    }
    return palette_groups;
}
Also used : TitledPane(javafx.scene.control.TitledPane) HashMap(java.util.HashMap) TilePane(javafx.scene.layout.TilePane) WidgetCategory(org.csstudio.display.builder.model.WidgetCategory) ScrollPane(javafx.scene.control.ScrollPane) Pane(javafx.scene.layout.Pane) TitledPane(javafx.scene.control.TitledPane) TilePane(javafx.scene.layout.TilePane) BorderPane(javafx.scene.layout.BorderPane)

Example 2 with TilePane

use of javafx.scene.layout.TilePane in project phoenicis by PhoenicisOrg.

the class WinePrefixContainerWineToolsTab method populate.

private void populate(ApplicationDTO engineTools) {
    final VBox toolsPane = new VBox();
    final Text title = new TextWithStyle(tr("Wine tools"), TITLE_CSS_CLASS);
    toolsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
    toolsPane.getChildren().add(title);
    final TilePane toolsContentPane = new TilePane();
    toolsContentPane.setPrefColumns(3);
    toolsContentPane.getStyleClass().add("grid");
    for (ScriptDTO tool : engineTools.getScripts()) {
        Button toolButton = new Button(tool.getScriptName());
        toolButton.getStyleClass().addAll("toolButton");
        toolButton.setStyle("-fx-background-image: url('" + tool.getIcon() + "');");
        toolButton.setOnMouseClicked(event -> {
            this.lockAll();
            this.engineToolsManager.runTool(container.getEngine(), container.getName(), tool.getId(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
        });
        this.lockableElements.add(toolButton);
        toolsContentPane.getChildren().add(toolButton);
    }
    toolsPane.getChildren().add(toolsContentPane);
    this.setContent(toolsPane);
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) ScriptDTO(org.phoenicis.repository.dto.ScriptDTO) Button(javafx.scene.control.Button) TilePane(javafx.scene.layout.TilePane) Text(javafx.scene.text.Text) ErrorMessage(org.phoenicis.javafx.views.common.ErrorMessage) VBox(javafx.scene.layout.VBox)

Example 3 with TilePane

use of javafx.scene.layout.TilePane in project org.csstudio.display.builder by kasemir.

the class RGBFactoryDemo method start.

@Override
public void start(final Stage stage) {
    final TilePane layout = new TilePane();
    layout.setPrefColumns(3);
    final RGBFactory colors = new RGBFactory();
    int index = 0;
    for (int row = 0; row < 20; ++row) for (int col = 0; col < 3; ++col) {
        final Color color = colors.next();
        final Label text = new Label("COLOR " + (++index) + ": " + color);
        text.setTextFill(color);
        layout.getChildren().add(text);
    }
    final Scene scene = new Scene(layout);
    stage.setScene(scene);
    stage.show();
}
Also used : TilePane(javafx.scene.layout.TilePane) Color(javafx.scene.paint.Color) Label(javafx.scene.control.Label) Scene(javafx.scene.Scene)

Example 4 with TilePane

use of javafx.scene.layout.TilePane in project org.csstudio.display.builder by kasemir.

the class RadioRepresentation method createJFXNode.

@Override
public TilePane createJFXNode() throws Exception {
    final TilePane pane = new TilePane(5.0, 5.0, createRadioButton(null));
    pane.setTileAlignment(Pos.BASELINE_LEFT);
    return pane;
}
Also used : TilePane(javafx.scene.layout.TilePane)

Example 5 with TilePane

use of javafx.scene.layout.TilePane in project POL-POM-5 by PhoenicisOrg.

the class WinePrefixContainerToolsTab method populate.

private void populate() {
    final VBox toolsPane = new VBox();
    final Text title = new TextWithStyle(tr("Tools"), TITLE_CSS_CLASS);
    toolsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
    toolsPane.getChildren().add(title);
    final TilePane toolsContentPane = new TilePane();
    toolsContentPane.setPrefColumns(3);
    toolsContentPane.getStyleClass().add("grid");
    Button runExecutable = new Button(tr("Run executable"));
    runExecutable.getStyleClass().addAll("toolButton", "runExecutable");
    runExecutable.setOnMouseClicked(event -> {
        this.lockAll();
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle(tr("Choose executable"));
        File file = fileChooser.showOpenDialog(this.getContent().getScene().getWindow());
        if (file != null) {
            winePrefixContainerController.runInContainer(container, file.getAbsolutePath(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show()));
        }
    });
    this.lockableElements.add(runExecutable);
    toolsContentPane.getChildren().add(runExecutable);
    toolsPane.getChildren().addAll(toolsContentPane);
    this.setContent(toolsPane);
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) Button(javafx.scene.control.Button) TilePane(javafx.scene.layout.TilePane) FileChooser(javafx.stage.FileChooser) Text(javafx.scene.text.Text) ErrorMessage(org.phoenicis.javafx.views.common.ErrorMessage) VBox(javafx.scene.layout.VBox) File(java.io.File)

Aggregations

TilePane (javafx.scene.layout.TilePane)7 Button (javafx.scene.control.Button)4 VBox (javafx.scene.layout.VBox)4 Text (javafx.scene.text.Text)4 ErrorMessage (org.phoenicis.javafx.views.common.ErrorMessage)4 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)4 File (java.io.File)2 FileChooser (javafx.stage.FileChooser)2 ScriptDTO (org.phoenicis.repository.dto.ScriptDTO)2 HashMap (java.util.HashMap)1 Scene (javafx.scene.Scene)1 Label (javafx.scene.control.Label)1 ScrollPane (javafx.scene.control.ScrollPane)1 TitledPane (javafx.scene.control.TitledPane)1 BorderPane (javafx.scene.layout.BorderPane)1 Pane (javafx.scene.layout.Pane)1 Color (javafx.scene.paint.Color)1 WidgetCategory (org.csstudio.display.builder.model.WidgetCategory)1