Search in sources :

Example 61 with GridPane

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);
}
Also used : HBox(javafx.scene.layout.HBox) GridPane(javafx.scene.layout.GridPane) ScrollPane(javafx.scene.control.ScrollPane) Text(javafx.scene.text.Text) VBox(javafx.scene.layout.VBox) Observable(javafx.beans.Observable)

Example 62 with GridPane

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);
}
Also used : ColumnConstraintsWithPercentage(org.phoenicis.javafx.views.common.ColumnConstraintsWithPercentage) GridPane(javafx.scene.layout.GridPane) ColumnConstraints(javafx.scene.layout.ColumnConstraints) ArrayList(java.util.ArrayList) Label(javafx.scene.control.Label)

Example 63 with GridPane

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);
}
Also used : HBox(javafx.scene.layout.HBox) GridPane(javafx.scene.layout.GridPane) Region(javafx.scene.layout.Region) VBox(javafx.scene.layout.VBox) Observable(javafx.beans.Observable)

Example 64 with GridPane

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);
}
Also used : ColumnConstraintsWithPercentage(org.phoenicis.javafx.views.common.ColumnConstraintsWithPercentage) GridPane(javafx.scene.layout.GridPane) ColumnConstraints(javafx.scene.layout.ColumnConstraints) ArrayList(java.util.ArrayList) Label(javafx.scene.control.Label)

Example 65 with GridPane

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;
}
Also used : ColumnConstraintsWithPercentage(org.phoenicis.javafx.views.common.ColumnConstraintsWithPercentage) GridPane(javafx.scene.layout.GridPane) ColumnConstraints(javafx.scene.layout.ColumnConstraints) Observable(javafx.beans.Observable)

Aggregations

GridPane (javafx.scene.layout.GridPane)147 Label (javafx.scene.control.Label)83 Insets (javafx.geometry.Insets)67 Button (javafx.scene.control.Button)46 TextField (javafx.scene.control.TextField)42 VBox (javafx.scene.layout.VBox)37 Scene (javafx.scene.Scene)36 HBox (javafx.scene.layout.HBox)26 ButtonType (javafx.scene.control.ButtonType)25 Text (javafx.scene.text.Text)24 Node (javafx.scene.Node)23 Dialog (javafx.scene.control.Dialog)23 ColumnConstraints (javafx.scene.layout.ColumnConstraints)18 Stage (javafx.stage.Stage)18 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)17 List (java.util.List)16 CheckBox (javafx.scene.control.CheckBox)16 ImageView (javafx.scene.image.ImageView)14 ActionEvent (javafx.event.ActionEvent)13 ComboBox (javafx.scene.control.ComboBox)13