本文整理汇总了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);
}
示例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();
}
示例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);
}