Exemplo n.º 1
0
  private Group createButtonArea(final Scene scene) {
    // create button area
    final Group buttonGroup = new Group();
    // rounded rect
    Rectangle buttonArea =
        RectangleBuilder.create()
            .arcWidth(15)
            .arcHeight(20)
            .fill(new Color(0, 0, 0, .55))
            .x(0)
            .y(0)
            .width(60)
            .height(30)
            .stroke(Color.rgb(255, 255, 255, .70))
            .build();
    buttonGroup.getChildren().add(buttonArea);

    // move button group when scene is resized
    buttonGroup
        .translateXProperty()
        .bind(scene.widthProperty().subtract(buttonArea.getWidth() + 6));
    buttonGroup
        .translateYProperty()
        .bind(scene.heightProperty().subtract(buttonArea.getHeight() + 6));
    return buttonGroup;
  }
Exemplo n.º 2
0
 private Node createBackground(Scene scene) {
   // application area
   Rectangle applicationArea =
       RectangleBuilder.create()
           .arcWidth(20)
           .arcHeight(20)
           .fill(Color.rgb(0, 0, 0, .80))
           .x(0)
           .y(0)
           .strokeWidth(2)
           .stroke(Color.rgb(255, 255, 255, .70))
           .build();
   applicationArea.widthProperty().bind(scene.widthProperty());
   applicationArea.heightProperty().bind(scene.heightProperty());
   return applicationArea;
 }