Q: Including scale factor in layoutBounds in JavaFX I'm using JavaFx 8.
From the JavaDoc of javafx.scene.Node.scaleYProperty():

[...] This scale factor is not included in layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account. [...]

How can I include the scaling factor in layoutBounds, though?
Some context:
In the following example, when pressing the button I would like the GridPane to react also to the scaling of the HBox whithout having to hardcode the prefHeight of the RowConstraints.
Being able to include the scaling factor into the layoutBounds probably would do the trick, but other solutions are welcome as well.
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ToggleButton;
import javafx.scene.layout.*;
import javafx.stage.Stage;

public class ScalingStandAlone extends Application {

    private VBox vBox = new VBox();
    private GridPane gridPane = new GridPane();
    private HBox  hBox = new HBox();
    private ToggleButton button = new ToggleButton("Click to scale");
    private Label firstRowLabel = new Label("Some content in text form");
    private Label secondRowLabel = new Label("Some content for scaling");
    private Label thirdRowLabel = new Label("Some moving content");

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void start(Stage stage) throws Exception {
        AnchorPane root = new AnchorPane();
        AnchorPane.setTopAnchor(vBox, 5.);
        AnchorPane.setLeftAnchor(vBox, 5.);
        AnchorPane.setRightAnchor(vBox, 5.);
        root.autosize();
        Scene scene = new Scene(root);
        stage.setTitle("GridRow Scale Demo");
        stage.setWidth(400);
        stage.setHeight(300);
        stage.setScene(scene);
        stage.show();

        root.getChildren().add(vBox);
        vBox.setAlignment(Pos.CENTER);
        vBox.getChildren().add(gridPane);
        vBox.getChildren().add(button);
        vBox.setStyle("-fx-spacing: 15;");

        configureGridPane(root);

        button.setOnAction(event -> {
            hBox.setScaleY(button.isSelected() ? 2 : 1);
        });
    }

    private void configureGridPane(Pane root) {
        hBox.getChildren().add(secondRowLabel);

        // Styling //
        firstRowLabel.setStyle("-fx-padding: 5;");
        hBox.setStyle("-fx-background-color: #800000; -fx-padding: 5;");
        secondRowLabel.setStyle("-fx-text-fill: white; -fx-padding: 5;");
        thirdRowLabel.setStyle("-fx-padding: 5;");

        gridPane.add(firstRowLabel, 0, 0);
        gridPane.add(hBox, 0, 1);
        gridPane.add(thirdRowLabel, 0, 2);
        gridPane.setGridLinesVisible(true);
        gridPane.getColumnConstraints().add(new ColumnConstraints());
        gridPane.getColumnConstraints().get(0).setPercentWidth(100);
    }
}


A: From the Javadocs for Group:

Any transform, effect, or state applied to a Group will be applied to
  all children of that group. Such transforms and effects will NOT be
  included in this Group's layout bounds, however if transforms and
  effects are set directly on children of this Group, those will be
  included in this Group's layout bounds.

(my emphasis added).
Therefore, if you simply wrap your HBox in a Group, you will achieve the desired effect:
    // gridPane.add(hBox, 0, 1);
    gridPane.add(new Group(hBox), 0, 1);

