use of javafx.scene.layout.GridPane in project POL-POM-5 by PlayOnLinux.
the class ContainerVerbsPanelSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final Text title = new Text(tr("Verbs"));
title.getStyleClass().add("title");
final GridPane verbs = new GridPane();
verbs.getStyleClass().add("verb-grid");
// ensure that the shown verbs are always up to date
getControl().getVerbScripts().addListener((Observable invalidation) -> updateVerbs(verbs));
// ensure that the shown verbs are correctly initialized
updateVerbs(verbs);
final ScrollPane verbScrollPanel = new ScrollPane(verbs);
verbScrollPanel.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
verbScrollPanel.setFitToWidth(true);
VBox.setVgrow(verbScrollPanel, Priority.ALWAYS);
final HBox verbManagementButtons = createVerbManagementButtons(verbs);
verbManagementButtons.getStyleClass().add("verb-management-button-container");
final VBox container = new VBox(title, verbScrollPanel, verbManagementButtons);
container.getStyleClass().addAll("container-details-panel", "container-verbs-panel");
getChildren().setAll(container);
}
use of javafx.scene.layout.GridPane in project POL-POM-5 by PlayOnLinux.
the class DetailsListElementSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final GridPane container = new GridPane();
container.getStyleClass().add("detailsListElement");
final List<ColumnConstraints> constraints = new ArrayList<>();
// add the title label
container.add(createTitle(), 0, 0);
constraints.add(new ColumnConstraintsWithPercentage(30));
// TODO: the skin should react to changes done to the additional information list
// TODO: the skin should react to changes done to the detailed information list
Stream.concat(getControl().getAdditionalInformation().stream(), getControl().getDetailedInformation().stream()).forEach(information -> {
final Label informationLabel = new Label(information.getContent());
informationLabel.setWrapText(true);
informationLabel.getStyleClass().add("information");
container.add(informationLabel, constraints.size(), 0);
constraints.add(new ColumnConstraintsWithPercentage(information.getWidth()));
});
// set the last constraint to fill the remaining space
constraints.set(constraints.size() - 1, new ColumnConstraints());
container.getColumnConstraints().setAll(constraints);
getChildren().addAll(container);
}
use of javafx.scene.layout.GridPane in project POL-POM-5 by PlayOnLinux.
the class EngineInformationPanelSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final GridPane informationContentPane = new GridPane();
informationContentPane.getStyleClass().add("grid");
engineUserData.addListener((Observable invalidation) -> updateUserData(informationContentPane));
updateUserData(informationContentPane);
final HBox buttonBox = createEngineButtons();
final Region informationContentSpacer = new Region();
informationContentSpacer.getStyleClass().add("engineSpacer");
final Region buttonBoxSpacer = new Region();
buttonBoxSpacer.getStyleClass().add("engineSpacer");
final VBox container = new VBox(informationContentPane, informationContentSpacer, buttonBox, buttonBoxSpacer);
getChildren().add(container);
}
use of javafx.scene.layout.GridPane in project POL-POM-5 by PlayOnLinux.
the class CompactListElementSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final GridPane container = new GridPane();
container.getStyleClass().add("compactListElement");
List<ColumnConstraints> constraints = new ArrayList<>();
// add the miniature icon
container.add(createMiniature(), 0, 0);
constraints.add(new ColumnConstraints());
// add the title label
container.add(createTitle(), 1, 0);
constraints.add(new ColumnConstraintsWithPercentage(40));
// add the additional information
getControl().getAdditionalInformation().forEach(information -> {
final Label informationLabel = new Label(information.getContent());
informationLabel.getStyleClass().add("information");
container.add(informationLabel, constraints.size(), 0);
constraints.add(new ColumnConstraintsWithPercentage(information.getWidth()));
});
// set the last constraint to fill the remaining space
constraints.set(constraints.size() - 1, new ColumnConstraints());
container.getColumnConstraints().setAll(constraints);
getChildren().addAll(container);
}
use of javafx.scene.layout.GridPane in project POL-POM-5 by PlayOnLinux.
the class ShortcutInformationPanelSkin method createPropertiesGrid.
/**
* Creates a new {@link GridPane} containing the properties of the selected shortcut
*
* @return a new {@link GridPane} containing the properties of the selected shortcut
*/
private GridPane createPropertiesGrid() {
final GridPane propertiesGrid = new GridPane();
propertiesGrid.getStyleClass().add("grid");
ColumnConstraints titleColumn = new ColumnConstraintsWithPercentage(30);
ColumnConstraints valueColumn = new ColumnConstraintsWithPercentage(70);
propertiesGrid.getColumnConstraints().addAll(titleColumn, valueColumn);
// ensure that changes to the shortcutProperties map result in updates to the GridPane
shortcutProperties.addListener((Observable invalidation) -> updateProperties(propertiesGrid));
// initialize the properties grid correctly
updateProperties(propertiesGrid);
return propertiesGrid;
}
Aggregations