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;
}
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);
}
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();
}
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;
}
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);
}
Aggregations