本文整理汇总了Java中javafx.scene.layout.BorderStroke类的典型用法代码示例。如果您正苦于以下问题:Java BorderStroke类的具体用法?Java BorderStroke怎么用?Java BorderStroke使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BorderStroke类属于javafx.scene.layout包,在下文中一共展示了BorderStroke类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initButtonByInventory
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
public void initButtonByInventory() {
inventoryGroup.getToggles().remove(0, inventoryGroup.getToggles().size());
if (core.getCurrentPlayer() == 0) {
inventoryPlayer1.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3))));
inventoryPlayer2.setBorder(Border.EMPTY);
inventoryPlayer1.setStyle("-fx-effect: none");
inventoryPlayer2.setStyle("-fx-effect: innershadow(one-pass-box, lightblue, 100, 0.1, 1, 1);");
namePlayer1.setText(core.getPlayers()[0].getName() + " à vous de jouer !");
namePlayer2.setText(core.getPlayers()[1].getName() + " attend !");
} else {
inventoryPlayer1.setBorder(Border.EMPTY);
inventoryPlayer2.setStyle("-fx-effect: none");
inventoryPlayer1.setStyle("-fx-effect: innershadow(one-pass-box, lightgrey, 100, 0.1, 1, 1);");
inventoryPlayer2.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3))));
namePlayer1.setText(core.getPlayers()[0].getName() + " attend !");
namePlayer2.setText(core.getPlayers()[1].getName() + " à vous de jouer !");
}
initPlayer1Button();
initPlayer2Button();
}
示例2: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
private void initGraphics() {
backgroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
backgroundCtx = backgroundCanvas.getGraphicsContext2D();
foregroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
foregroundCtx = foregroundCanvas.getGraphicsContext2D();
ledInnerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 0.2 * PREFERRED_WIDTH, 0, 0, 0);
ledDropShadow = new DropShadow(BlurType.TWO_PASS_BOX, getSkinnable().getBarColor(), 0.3 * PREFERRED_WIDTH, 0, 0, 0);
pane = new Pane(backgroundCanvas, foregroundCanvas);
pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
getChildren().setAll(pane);
}
示例3: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
protected void initGraphics() {
// Set initial size
if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 ||
Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0.0) <= 0) {
if (tile.getPrefWidth() > 0 && tile.getPrefHeight() > 0) {
tile.setPrefSize(tile.getPrefWidth(), tile.getPrefHeight());
} else {
tile.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 3, 0, 0, 0);
notifyRegion = new NotifyRegion();
enableNode(notifyRegion, false);
pane = new Pane(notifyRegion);
pane.setBorder(new Border(new BorderStroke(tile.getBorderColor(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(tile.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(tile.getBackgroundColor(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY)));
getChildren().setAll(pane);
}
示例4: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
private void initGraphics() {
// Set initial size
if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
} else {
getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
pane = new Pane();
pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(getSkinnable().getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
getChildren().setAll(pane);
}
示例5: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
private void initGraphics() {
if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
Double.compare(getHeight(), 0.0) <= 0) {
if (getPrefWidth() > 0 && getPrefHeight() > 0) {
setPrefSize(getPrefWidth(), getPrefHeight());
} else {
setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
segmentPane = new Pane();
chartCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
chartCanvas.setMouseTransparent(true);
chartCtx = chartCanvas.getGraphicsContext2D();
pane = new Pane(segmentPane, chartCanvas);
pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));
getChildren().setAll(pane);
prepareData();
}
示例6: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
private void initGraphics() {
// Set initial size
if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
} else {
getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
node = new Region();
node.getStyleClass().setAll("node");
pane = new Pane(node);
pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));
getChildren().setAll(pane);
}
示例7: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@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);
}
示例8: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
private void initGraphics() {
// Set initial size
if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
} else {
getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
pane = new Pane();
pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
getChildren().setAll(pane);
}
示例9: redraw
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
barColor = gauge.getBarColor();
valueColor = gauge.getValueColor();
unitColor = gauge.getUnitColor();
sectionsVisible = gauge.getSectionsVisible();
drawBackground();
resizeStaticText();
setBar(gauge.getCurrentValue());
titleText.setText(gauge.getTitle());
titleText.setFill(gauge.getTitleColor());
titleText.relocate((size - titleText.getLayoutBounds().getWidth()) * 0.5, size * 0.22180451);
valueBkgText.setFill(Helper.getTranslucentColorFrom(valueColor, 0.1));
valueText.setFill(valueColor);
}
示例10: redraw
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(size * 0.025), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(size * 0.025), Insets.EMPTY)));
locale = gauge.getLocale();
formatString = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString();
titleText.setText(gauge.getTitle());
subTitleText.setText(gauge.getSubTitle());
resizeStaticText();
titleText.setFill(gauge.getTitleColor());
valueText.setFill(gauge.getValueColor());
averageText.setFill(gauge.getAverageColor());
highText.setFill(gauge.getValueColor());
lowText.setFill(gauge.getValueColor());
subTitleText.setFill(gauge.getSubTitleColor());
sparkLine.setStroke(gauge.getBarColor());
stdDeviationArea.setFill(Helper.getTranslucentColorFrom(gauge.getAverageColor(), 0.1));
averageLine.setStroke(gauge.getAverageColor());
dot.setFill(gauge.getBarColor());
}
示例11: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void initGraphics() {
// Set initial size
if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
} else {
clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
canvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ctx = canvas.getGraphicsContext2D();
pane = new Pane(canvas);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
getChildren().setAll(pane);
}
示例12: redraw
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
ZonedDateTime time = clock.getTime();
hourColor = clock.getHourColor();
minuteColor = clock.getMinuteColor();
fiveMinuteColor = minuteColor.darker();
secondColor = clock.getSecondColor();
titleColor = clock.getTitleColor();
textColor = clock.getTextColor();
dateColor = clock.getDateColor();
alarmColor = clock.getAlarmColor();
drawBackground();
drawForeground(time);
drawHours(time);
drawMinutes(time);
drawSeconds(time);
}
示例13: redraw
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth() / 250 * size))));
pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
colorGradientEnabled = gauge.isGradientBarEnabled();
noOfGradientStops = gauge.getGradientBarStops().size();
sectionsVisible = gauge.getSectionsVisible();
barBackground.setFill(gauge.getBarBackgroundColor());
barBackground.setEffect(gauge.isShadowsEnabled() ? innerShadow : null);
setBarColor(gauge.getCurrentValue());
dataBar.setEffect(gauge.isShadowsEnabled() ? innerShadow : null);
threshold.setStroke(gauge.getThresholdColor());
double thresholdInnerRadius = 0.3 * height;
double thresholdOuterRadius = 0.675 * height;
double thresholdAngle = Helper.clamp(90.0, 270.0, (gauge.getThreshold() - minValue) * angleStep + 90.0);
threshold.setStartX(centerX + thresholdInnerRadius * Math.sin(-Math.toRadians(thresholdAngle)));
threshold.setStartY(centerX + thresholdInnerRadius * Math.cos(-Math.toRadians(thresholdAngle)));
threshold.setEndX(centerX + thresholdOuterRadius * Math.sin(-Math.toRadians(thresholdAngle)));
threshold.setEndY(centerX + thresholdOuterRadius * Math.cos(-Math.toRadians(thresholdAngle)));
redrawText();
}
示例14: initGraphics
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void initGraphics() {
// Set initial size
if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
} else {
clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
timeText = new Text();
timeText.setTextOrigin(VPos.CENTER);
timeText.setFill(textColor);
dateText = new Text();
dateText.setTextOrigin(VPos.CENTER);
dateText.setFill(dateColor);
pane = new Pane(timeText, dateText);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY)));
getChildren().setAll(pane);
}
示例15: redraw
import javafx.scene.layout.BorderStroke; //导入依赖的package包/类
@Override protected void redraw() {
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
shadowGroup.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
// Tick Marks
tickCanvas.setCache(false);
drawTicks();
tickCanvas.setCache(true);
tickCanvas.setCacheHint(CacheHint.QUALITY);
needle.setStroke(clock.getHourColor());
ZonedDateTime time = clock.getTime();
updateTime(time);
}