@@ -0,0 +1,3129 @@
+package org.csstudio.display.builder.representation.javafx.sandbox;%0A%0Aimport javafx.application.Application;%0Aimport javafx.scene.Group;%0Aimport javafx.scene.Scene;%0Aimport javafx.scene.input.KeyEvent;%0Aimport javafx.scene.layout.Pane;%0Aimport javafx.scene.layout.Priority;%0Aimport javafx.scene.layout.VBox;%0Aimport javafx.scene.paint.Color;%0Aimport javafx.scene.shape.Rectangle;%0Aimport javafx.stage.Stage;%0A%0A/** From http://stackoverflow.com/questions/30901185/difference-between-pane-and-group%0A *%0A *  %3E%3EA Group is not resizable (meaning that its size is not managed by its parent in the scene graph),%0A *  and takes on the union of the bounds of its child nodes.%0A *  (So, in other words, the local bounds of a Group will be the smallest rectangle%0A *  containing the bounds of all the child nodes).%0A *  If it is larger than the space it is allocated in its parent, it will be clipped.%0A *%0A *  By contrast, a Pane is resizable, so its size is set by its parent, which essentially determine its bounds.%0A *%0A *  Here is a quick demo. The Group is on top and the Pane below.%0A *  Both contain a fixed blue square at (100,100) and a green square which is moved by pressing%0A *  the left/right arrow keys.%0A *  Note how at the beginning, the blue square appears in the top left corner of the group,%0A *  because the local bounds of the group start at the top-leftmost point of all its child nodes%0A *  (i.e. the local bounds of the group extend from (100, 100) right and down).%0A *  As you move the green rectangles %22off screen%22, the group adjusts its bounds to incorporate the changes,%0A *  wherever possible, whereas the pane remains fixed.%3C%3C%0A */%0Apublic class GroupVsPaneDemo extends Application%0A%7B%0A    @Override%0A    public void start(Stage primaryStage)%0A    %7B%0A        Pane pane = new Pane();%0A        Group group = new Group();%0A%0A        VBox.setVgrow(group, Priority.NEVER);%0A        VBox.setVgrow(pane, Priority.NEVER);%0A%0A        VBox vbox = new VBox(group, pane);%0A%0A        Rectangle rect1 = new Rectangle(100, 100, 100, 100);%0A        Rectangle rect2 = new Rectangle(100, 100, 100, 100);%0A        Rectangle rect3 = new Rectangle(200, 200, 100, 100);%0A        Rectangle rect4 = new Rectangle(200, 200, 100, 100);%0A        rect1.setFill(Color.BLUE);%0A        rect2.setFill(Color.BLUE);%0A        rect3.setFill(Color.GREEN);%0A        rect4.setFill(Color.GREEN);%0A%0A        group.getChildren().addAll(rect1, rect3);%0A        pane.getChildren().addAll(rect2, rect4);%0A%0A        Scene scene = new Scene(vbox, 800, 800);%0A        scene.addEventHandler(KeyEvent.KEY_PRESSED, e -%3E%0A        %7B%0A            double deltaX ;%0A            switch(e.getCode())%0A            %7B%0A                case LEFT:%0A                    deltaX = -10 ;%0A                    break ;%0A                case RIGHT:%0A                    deltaX = 10 ;%0A                    break ;%0A                default:%0A                    deltaX = 0 ;%0A            %7D%0A            rect3.setX(rect3.getX() + deltaX);%0A            rect4.setX(rect4.getX() + deltaX);%0A        %7D);%0A%0A        primaryStage.setScene(scene);%0A        primaryStage.show();%0A    %7D%0A%0A    public static void main(String%5B%5D args)%0A    %7B%0A        launch(args);%0A    %7D%0A%7D

Add Group vs. Pane demo