本文整理汇总了Java中javafx.scene.layout.BorderStrokeStyle.SOLID属性的典型用法代码示例。如果您正苦于以下问题:Java BorderStrokeStyle.SOLID属性的具体用法?Java BorderStrokeStyle.SOLID怎么用?Java BorderStrokeStyle.SOLID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.layout.BorderStrokeStyle
的用法示例。
在下文中一共展示了BorderStrokeStyle.SOLID属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGraphics
@Override protected void initGraphics() {
super.initGraphics();
final ZonedDateTime TIME = tile.getTime();
titleText = new Text(MONTH_YEAR_FORMATTER.format(TIME));
titleText.setFill(tile.getTitleColor());
clickHandler = e -> checkClick(e);
labels = new ArrayList<>(56);
for (int i = 0 ; i < 56 ; i++) {
Label label = new Label();
label.setManaged(false);
label.setVisible(false);
label.setAlignment(Pos.CENTER);
label.addEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler);
labels.add(label);
}
weekBorder = new Border(new BorderStroke(Color.TRANSPARENT,
Tile.GRAY,
Color.TRANSPARENT,
Color.TRANSPARENT,
BorderStrokeStyle.NONE,
BorderStrokeStyle.SOLID,
BorderStrokeStyle.NONE,
BorderStrokeStyle.NONE,
CornerRadii.EMPTY, BorderWidths.DEFAULT,
Insets.EMPTY));
text = new Text(DAY_FORMATTER.format(TIME));
text.setFill(tile.getTextColor());
getPane().getChildren().addAll(titleText, text);
getPane().getChildren().addAll(labels);
}
示例2: getSimpleBorder
public static Border getSimpleBorder(Paint p, double width) {
return new Border(new BorderStroke(p, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(width)));
}
示例3: start
public static Border start() {
return new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT));
}
示例4: end
public static Border end() {
return new Border(new BorderStroke(Color.YELLOW, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT));
}
示例5: resize
@Override protected void resize() {
width = gauge.getWidth() - gauge.getInsets().getLeft() - gauge.getInsets().getRight();
height = gauge.getHeight() - gauge.getInsets().getTop() - gauge.getInsets().getBottom();
if (aspectRatio * width > height) {
width = 1 / (aspectRatio / height);
} else if (1 / (aspectRatio / height) > width) {
height = aspectRatio * width;
}
if (width > 0 && height > 0) {
pane.setMaxSize(width, height);
pane.setPrefSize(width, height);
pane.relocate((gauge.getWidth() - width) * 0.5, (gauge.getHeight() - height) * 0.5);
pane.setSpacing(width * 0.01960784);
double barWidth = 0;
for (int i = 0 ; i < 12 ; i++) {
bars[i].setPrefSize(0.3030303 * height, (0.3030303 * height + i * 0.06060606 * height));
Bounds bounds = bars[i].getLayoutBounds();
barWidth = bounds.getWidth();
if (barWidth == 0) return;
BarColor barColor;
if (i < 2) {
barColor = BarColor.RED;
} else if (i < 9) {
barColor = BarColor.ORANGE;
} else {
barColor = BarColor.GREEN;
}
barBackgrounds[i] = new Background(new BackgroundFill[] {
new BackgroundFill(Color.WHITE, new CornerRadii(1024), Insets.EMPTY),
new BackgroundFill(new LinearGradient(0, bounds.getMinY(), 0, bounds.getMaxY(), false, CycleMethod.NO_CYCLE, new Stop(0.0, barColor.COLOR_FROM), new Stop(1.0, barColor.COLOR_TO)), new CornerRadii(1024), new Insets(0.15 * barWidth))
});
barBackgrounds[i + 12] = new Background(new BackgroundFill[] {
new BackgroundFill(Color.WHITE, new CornerRadii(1024), Insets.EMPTY),
new BackgroundFill(new LinearGradient(0, bounds.getMinY(), 0, bounds.getMaxY(), false, CycleMethod.NO_CYCLE, new Stop(0.0, BarColor.GRAY.COLOR_FROM), new Stop(1.0, BarColor.GRAY.COLOR_TO)), new CornerRadii(1024), new Insets(0.15 * barWidth))
});
}
barBorder = new Border(new BorderStroke(Color.rgb(102, 102, 102), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(0.05 * barWidth)));
}
redraw();
}