當前位置: 首頁>>代碼示例>>Java>>正文


Java VBox.setBackground方法代碼示例

本文整理匯總了Java中javafx.scene.layout.VBox.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java VBox.setBackground方法的具體用法?Java VBox.setBackground怎麽用?Java VBox.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.layout.VBox的用法示例。


在下文中一共展示了VBox.setBackground方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import javafx.scene.layout.VBox; //導入方法依賴的package包/類
@Override
public void start(Stage stage) {
  this.stage = stage;

  stage.initStyle(StageStyle.TRANSPARENT);

  VBox box = new VBox(20);
  box.setMaxWidth(Region.USE_PREF_SIZE);
  box.setMaxHeight(Region.USE_PREF_SIZE);
  box.setBackground(Background.EMPTY);
  String style = "-fx-background-color: rgba(255, 255, 255, 0.5);";
  box.setStyle(style);

  box.setPadding(new Insets(50));
  BorderPane root = new BorderPane(box);
  root.setStyle(style);
  root.setBackground(Background.EMPTY);
  Scene scene = new Scene(root);
  scene.setFill(Color.TRANSPARENT);
  stage.setScene(scene);

  ImageView splashView = new ImageView(splashImage);
  box.getChildren().addAll(splashView, new Label("ST Verification Studio is loading.."));
  stage.show();
  Rectangle2D primScreenBounds = Screen.getPrimary().getVisualBounds();
  stage.setX((primScreenBounds.getWidth() - stage.getWidth()) / 2);
  stage.setY((primScreenBounds.getHeight() - stage.getHeight()) / 2);
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:29,代碼來源:StvsPreloader.java

示例2: start

import javafx.scene.layout.VBox; //導入方法依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
    Parent pane = root.get();

    double width = size.width;
    double height = size.height;

    VBox box = new VBox(pane);
    VBox.setVgrow(pane, ALWAYS);
    box.setMinSize(width, height);
    box.setPrefSize(width, height);
    box.setMaxSize(width, height);

    box.setBackground(new Background(new BackgroundFill(fill, null, null)));

    ScrollPane scroll = new ScrollPane(box);
    Scene scene = new Scene(scroll);

    stage.setScene(scene);
    stage.show();
}
 
開發者ID:testing-av,項目名稱:testing-video,代碼行數:22,代碼來源:FxDisplay.java

示例3: TimelineDiffViewerRenderer

import javafx.scene.layout.VBox; //導入方法依賴的package包/類
public TimelineDiffViewerRenderer() {

		nbStates = new SimpleIntegerProperty();
		statesRange = new SimpleIntegerProperty();
		nbDisplayableStates = new SimpleIntegerProperty();
		nbDisplayableStates.bind(widthProperty().divide(UNIT));
		statesRange.bind(nbStates.subtract(nbDisplayableStates));

		nbDisplayableStates.addListener((v, o, n) -> {
			refresh();
		});

		setupBox(eqBox, "Toggle identical traces", eqLines);
		setupBox(substBox, "Toggle similar traces", substLines);
		setupBox(inBox, "Toggle inserted traces", inLines);
		setupBox(delBox, "Toggle deleted traces", delLines);

		ScrollPane scrollPane = new ScrollPane(rootVBox);
		scrollPane.minWidthProperty().bind(widthProperty());
		scrollPane.maxWidthProperty().bind(widthProperty());
		scrollPane.prefWidthProperty().bind(widthProperty());
		scrollPane.setFitToWidth(true);
		scrollPane.setBorder(Border.EMPTY);

		VBox headerPane = new VBox();
		headerPane.minWidthProperty().bind(widthProperty());
		headerPane.maxWidthProperty().bind(widthProperty());
		headerPane.setBackground(HEADER_BACKGROUND);

		scrollPane.translateYProperty().bind(headerPane.heightProperty());
		scrollPane.maxHeightProperty().bind(heightProperty().subtract(headerPane.heightProperty()));

		getChildren().add(headerPane);
		getChildren().add(scrollPane);
		minHeightProperty().bind(headerPane.heightProperty().add(scrollPane.heightProperty()));
		prefHeightProperty().bind(headerPane.heightProperty().add(scrollPane.heightProperty()));
		maxHeightProperty().bind(headerPane.heightProperty().add(scrollPane.heightProperty()));

		scrollBar.setVisibleAmount(1);
		scrollBar.setBlockIncrement(10);
		scrollBar.setMin(0);
		scrollBar.disableProperty().bind(statesRange.lessThanOrEqualTo(0));
		scrollBar.maxProperty().bind(statesRange);
		scrollBar.valueProperty().addListener((v, o, n) -> {
			if (o.intValue() != n.intValue() && n.intValue() != currentState) {
				currentState = n.intValue();
				refresh();
			}
		});

		headerPane.getChildren().add(scrollBar);
		headerPane.getChildren().add(line1);
		headerPane.getChildren().add(line2);

		setBackground(WHITE_BACKGROUND);
		scrollPane.setBackground(WHITE_BACKGROUND);
		rootVBox.setBackground(WHITE_BACKGROUND);
	}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:59,代碼來源:TimelineDiffViewerRenderer.java


注:本文中的javafx.scene.layout.VBox.setBackground方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。