Example usage for javafx.scene Group setStyle

List of usage examples for javafx.scene Group setStyle

Introduction

In this page you can find the example usage for javafx.scene Group setStyle.

Prototype

public final void setStyle(String value) 

Source Link

Document

A string representation of the CSS style associated with this specific Node .

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    BorderPane root = new BorderPane();

    Pane parentContainer = new Pane();
    parentContainer.setPrefSize(500, 500);
    parentContainer.setPickOnBounds(false);

    //Pane parent = new Pane();
    Group parent = new Group();
    boundsLayoutNode = parent;/*from   w  w  w  . ja  va  2 s .  c o  m*/
    //parent.setPrefSize(300, 200);
    parent.setLayoutX(200);
    parent.setLayoutY(200);
    parent.setStyle("-fx-background-color:white;");
    parent.getChildren().addAll(new Group(localXAxisGroup, localYAxisGroup),
            new Group(parentXAxisGroup, parentYAxisGroup),
            new Group(parentBoundsRect, PARENT_BOUNDS_PATH_CIRCLE),
            new Group(localBoundsRect, LOCAL_BOUNDS_PATH_CIRCLE),
            new Group(layoutBoundsRect, LAYOUT_BOUNDS_PATH_CIRCLE), new Group(mainRect));

    parentContainer.getChildren().addAll(parent);

    VBox transformsControls = getTransformationControls();
    VBox resultsControls = getResultsControls();

    BorderPane nestedPane = new BorderPane();
    nestedPane.setCenter(parentContainer);
    nestedPane.setBottom(resultsControls);
    //nestedPane.setTop(printDataTextArea);
    //printDataTextArea.setPrefColumnCount(40);
    //printDataTextArea.setPrefRowCount(3);
    root.setCenter(nestedPane);

    root.setRight(transformsControls);
    //root.setBottom(resultsControls);
    //root.setCenter(parentContainer);

    // Attach event handlers
    attachEventHandlers();

    Scene scene = new Scene(root); //, 600, 400);
    stage.setScene(scene);
    stage.setTitle("Bounds of a Node");
    Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
    stage.setX(visualBounds.getMinX());
    stage.setY(visualBounds.getMinY());
    stage.setWidth(visualBounds.getWidth());
    stage.setHeight(visualBounds.getHeight());
    stage.show();

    // Make sure everything is in sync
    relayout();
}