Package javafx.scene.layout

Examples of javafx.scene.layout.Region


                    stage.setX(event.getScreenX() - mouseDragOffsetX);
                    stage.setY(event.getScreenY() - mouseDragOffsetY);
              }
            }
        });
        final Region titleBarLeft = new Region();
        titleBarLeft.setId("title-bar-left");
        titleBarLeft.setPrefWidth(TOP_LEFT_WIDTH);
        titleBarLeft.setMaxWidth(TOP_LEFT_WIDTH);
      titleBarCenter = new HBox(0);
      titleBarCenter.setId("title-bar");
      titleBarCenter.setAlignment(Pos.TOP_LEFT);
      updateTitleBarItems(titleBarItems);
        HBox.setHgrow(titleBarCenter, Priority.ALWAYS);
      final HBox titleBarRight = newMinMaxClose(stage);
      titleBarRight.setId("title-bar-right");
      titleBarRight.setPrefWidth(TOP_RIGHT_WIDTH);
        titleBarRight.setMaxWidth(TOP_RIGHT_WIDTH);
      //titleBarRight.getChildren().add(newMinMaxClose(stage, 0, TOP_BORDER_HEIGHT / 2 + TOP_MIN_MAX_CLOSE_Y));
        titleBar.getChildren().addAll(titleBarLeft, titleBarCenter, titleBarRight);
     
      final VBox leftBar = new VBox();
      leftBar.setId("border-left");
      leftBar.setPrefWidth(LEFT_BORDER_WIDTH);
      leftBar.setMaxWidth(LEFT_BORDER_WIDTH);
      leftBar.setTranslateX(1);
      Bindings.bindBidirectional(leftBar.translateYProperty(), content.translateYProperty());
      Bindings.bindBidirectional(leftBar.maxHeightProperty(), content.maxHeightProperty());
     
      final VBox rightBar = new VBox();
      rightBar.setId("border-right");
      rightBar.setPrefWidth(RIGHT_BORDER_WIDTH);
      rightBar.setMaxWidth(RIGHT_BORDER_WIDTH);
      Bindings.bindBidirectional(rightBar.translateYProperty(), content.translateYProperty());
      Bindings.bindBidirectional(rightBar.maxHeightProperty(), content.maxHeightProperty());
     
      final HBox statusBar = new HBox();
      //statusBar.setStyle("-fx-background-color: black;");
      statusBar.setPrefHeight(BOTTOM_BORDER_HEIGHT);
      statusBar.setMaxHeight(BOTTOM_BORDER_HEIGHT);
        final Region statusBarLeft = new Region();
        statusBarLeft.setId("status-bar-left");
        statusBarLeft.setPrefWidth(BOTTOM_LEFT_WIDTH);
        statusBarLeft.setMaxWidth(BOTTOM_LEFT_WIDTH);
      final Region statusBarCenter = new Region();
      statusBarCenter.setId("status-bar");
        HBox.setHgrow(statusBarCenter, Priority.ALWAYS);
      final HBox statusBarRight = new HBox();
      statusBarRight.setAlignment(Pos.BOTTOM_RIGHT);
      statusBarRight.setId("status-bar-right");
      statusBarRight.setPrefWidth(BOTTOM_RIGHT_WIDTH);
View Full Code Here


        if (GuiUtil.isPrimaryPress(event)) {
          runnable.run();
        }
      }
    });
    final Region graphic = new Region();
    graphic.getStyleClass().setAll(new String[] { function.getCssClass() });
    setGraphic(graphic);
  }
View Full Code Here

          null);
      final VBox stepperBar = new VBox(NUMERIC_STEPPER_QUARTER_HEIGHT);
      stepperBar.getChildren().addAll(createArrowButton(true),
          createArrowButton(false));

      final Region digitsDisplay = GuiUtil.createBackgroundDisplay(
          new Insets(NUMERIC_STEPPER_EIGHTH_HEIGHT,
              NUMERIC_STEPPER_QUARTER_HEIGHT,
              NUMERIC_STEPPER_EIGHTH_HEIGHT,
              NUMERIC_STEPPER_QUARTER_HEIGHT),
          NUMERIC_STEPPER_QUARTER_HEIGHT, 2, true,
View Full Code Here

        rightButton = new StackPane();
        rightButton.getStyleClass().setAll("right-button");
        rightButton.setFocusTraversable(false);

        rightButtonGraphic = new Region();
        rightButtonGraphic.getStyleClass().setAll("right-button-graphic");
        rightButtonGraphic.setFocusTraversable(false);

        rightButtonGraphic.setMaxWidth(Region.USE_PREF_SIZE);
        rightButtonGraphic.setMaxHeight(Region.USE_PREF_SIZE);
View Full Code Here

    return menuBar;
  }
 
  public ToolBar createToolbar() {
    ToolBar toolBar = new ToolBar();
    Region spacer = new Region();
    spacer.getStyleClass().setAll("spacer");

    HBox buttonBar = new HBox();
    buttonBar.setAlignment(Pos.CENTER);
    HBox.setHgrow(buttonBar, Priority.ALWAYS);
    buttonBar.getStyleClass().setAll("segmented-button-bar");
View Full Code Here

                @Override public void invalidated(Observable valueModel) {
                    titleLabel.setText(getTitle());
                }
            });

            Region spacer = new Region();
            HBox.setHgrow(spacer, Priority.ALWAYS);

            // add close min max
            Button closeButton = createWindowButton("close");
            closeButton.setOnAction(new EventHandler() {
View Full Code Here

    Pane buttonsPane;
    if (verticalRightButton){
      VBox vbox = new VBox();
      vbox.setAlignment(Pos.TOP_LEFT);
      vbox.setSpacing(3);
      Region spacer = new Region();
      VBox.setMargin(spacer, new Insets(1.5));
      vbox.getChildren().add(spacer);
      buttonsPane=vbox;
    } else {
      HBox hbox = new HBox();
View Full Code Here

                        if (empty || gradient == null) {
                            setText(null);
                            setGraphic(null);
                        } else {
                            setText(gradient.getName());
                            Region preview = new Region();
                            preview.setPrefSize(30, 30);
                            preview.setStyle("-fx-border-color: black; -fx-background-color: "+gradient.getCss());
                            setGraphic(preview);
                        }
                    }
                };
                cell.setStyle("-fx-cell-size: 40;");
View Full Code Here

            { bind(derivationSlider.valueProperty()); }
            @Override protected String computeValue() {
                return String.format("%3.1f%%", derivationSlider.getValue());
            }
        });
        derivedResultColor = new Region();
        derivedResultColor.setPrefSize(50, 20);
        derivedResultLabel.setGraphic(derivedResultColor);
        derivedResultColor.styleProperty().bind(new StringBinding() {
            { bind(derivationSlider.valueProperty(),baseColorPicker.colorProperty()); }
            @Override protected String computeValue() {
                return "-fx-border-color: black; -fx-background-color: derive("+baseColorPicker.getWebColor()+", "+derivationSlider.getValue()+"%);";
            }
        });
        derivedResultLabel.textProperty().bind(new StringBinding() {
            { bind(derivationSlider.valueProperty(),baseColorPicker.colorProperty()); }
            @Override protected String computeValue() {
                Color base = baseColorPicker.getColor();
                double derivation = derivationSlider.getValue();
                Color result = Utils.deriveColor(base, derivation/100);
                return getColorString(result);
            }
        });
        // BACKWARD
        reverseResultColor = new Region();
        reverseResultColor.setPrefSize(50, 20);
        reverseResultLabel.setGraphic(reverseResultColor);
        ChangeListener<Color> updateReverse = new ChangeListener<Color>() {
            @Override public void changed(ObservableValue<? extends Color> ov, Color t, Color desiredColor) {
                updateReverse();
View Full Code Here

            // Show the stage
            this.stageMap.get(stageKey).show();

        } else {

            final Region rootPane = getRootPane(swb);
            final Scene scene = getScene(swb, rootPane);
            final Stage stage = getStage(swb, scene);

            // Show the stage
            this.stageMap.put(stageKey, stage);
View Full Code Here

TOP

Related Classes of javafx.scene.layout.Region

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.