本文整理匯總了Java中javafx.scene.layout.BorderPane.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java BorderPane.setBackground方法的具體用法?Java BorderPane.setBackground怎麽用?Java BorderPane.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.layout.BorderPane
的用法示例。
在下文中一共展示了BorderPane.setBackground方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
import javafx.scene.layout.BorderPane; //導入方法依賴的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: overlay
import javafx.scene.layout.BorderPane; //導入方法依賴的package包/類
protected Parent overlay(int window, int yCode) {
EncoderParameters params = getEncoderParameters();
double ye = params.matrix.fromLumaCode(yCode);
double yo = params.transfer.eotf(ye);
CIExy xy = getColor(yo);
String text = format("HDR10 grayscale CIE(x=%.4f, y=%.4f) %.1f%% Y%d,"
+ " %.1f nit", xy.x, xy.y, ye * 100.0, yCode, yo * 10000.0);
Label label = new Label(text);
label.setFont(font(40));
label.setTextFill(gray(max(0.25, min(0.5, ye))));
BorderPane.setMargin(label, new Insets(20));
BorderPane layout = new BorderPane();
layout.setBackground(EMPTY);
layout.setBottom(label);
return layout;
}
示例3: overlay
import javafx.scene.layout.BorderPane; //導入方法依賴的package包/類
private static Parent overlay(int version, int display,
YCbCr params, int yCode, String suffix) {
double ye = params.fromLumaCode(yCode);
Label label = new Label(getLabel(version, display, params, yCode,
suffix));
label.setFont(font(40));
label.setTextFill(gray(max(0.25, min(0.5, ye))));
BorderPane.setMargin(label, new Insets(20));
BorderPane layout = new BorderPane();
layout.setBackground(EMPTY);
layout.setBottom(label);
return layout;
}