本文整理汇总了Java中javafx.scene.layout.BackgroundRepeat.NO_REPEAT属性的典型用法代码示例。如果您正苦于以下问题:Java BackgroundRepeat.NO_REPEAT属性的具体用法?Java BackgroundRepeat.NO_REPEAT怎么用?Java BackgroundRepeat.NO_REPEAT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.layout.BackgroundRepeat
的用法示例。
在下文中一共展示了BackgroundRepeat.NO_REPEAT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawBackground
protected void drawBackground (String url) {
if (url == null) {
return;
}
Image img = getImage(url);
BackgroundImage background = new BackgroundImage(img,
BackgroundRepeat.NO_REPEAT,
BackgroundRepeat.NO_REPEAT,
BackgroundPosition.DEFAULT,
BackgroundSize.DEFAULT);
myPane.setBackground(new Background(background));
myPane.setMinWidth(img.getWidth());
myPane.setMinHeight(img.getHeight());
}
示例2: CustomExtractIcon
public CustomExtractIcon(final InternalWindow w) {
getStyleClass().setAll("custom-close-icon");
BackgroundImage img = new BackgroundImage(
new Image(FileUtils.getResourceToExternalForm("/img/extract.png"), 15, 15, false, true),
BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER,
BackgroundSize.DEFAULT);
setBackground(new Background(img));
setOnAction((e) -> w.toggleWindowExtracted());
}
示例3: hideCard
private void hideCard(boolean hide) {
topPane.setVisible(!hide);
centerPane.setVisible(!hide);
bottomPane.setVisible(!hide);
if (hide) {
BackgroundSize size = new BackgroundSize(getWidth(), getHeight(), false, false, true, false);
BackgroundImage image = new BackgroundImage(IconFactory.getDefaultCardBack(), BackgroundRepeat.NO_REPEAT,
BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, size);
Background background = new Background(image);
setBackground(background);
}
}
示例4: setBackground
/**
* Effect: sets the background image of a region to be white with a
* specified image on top of it.
*
* @param n
* the node
* @param i
* the image
*/
private static void setBackground(Region n, Image i) {
BackgroundImage back = new BackgroundImage(i, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(100, 100, true, true, true, false));
Platform.runLater(() -> n.setBackground(new Background(new BackgroundFill[] { new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY) }, new BackgroundImage[] { back })));
}