下面列出了javafx.scene.effect.DropShadow#setBlurType ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public Toast(final String msg) {
label = new Label(msg);
String style = "-fx-background-color:black;" +
"-fx-background-radius:10;" +
"-fx-font: 16px \"Microsoft YaHei\";" +
"-fx-text-fill:white;-fx-padding:10;";
label.setStyle(style);
DropShadow dropShadow = new DropShadow();
dropShadow.setBlurType(BlurType.THREE_PASS_BOX);
dropShadow.setWidth(40);
dropShadow.setHeight(40);
dropShadow.setRadius(19.5);
dropShadow.setOffsetX(0);
dropShadow.setOffsetY(00);
dropShadow.setColor(Color.color(0, 0, 0));
label.setEffect(dropShadow);
}
@Override
public Node buildIcon(StringFormat format, byte[] value) {
Text t = new Text(format.format(format.value(value)));
t.setFont(Font.font(ExternalFonts.SOURCESANSPRO_BLACK, FontWeight.BOLD, 32.0));
t.setFill(Color.WHITE);
DropShadow dropShadow = new DropShadow();
dropShadow.setRadius(4.0);
dropShadow.setColor(Color.BLACK /* valueOf("#4b5157")*/);
dropShadow.setBlurType(BlurType.ONE_PASS_BOX);
t.setEffect(dropShadow);
return t;
}
public DropShadow getDropShadow() {
DropShadow shadow = new DropShadow();
if (use) {
shadow.setColor(getColor());
} else {
shadow.setColor(Color.TRANSPARENT);
}
shadow.setOffsetX(getOffsetX());
shadow.setOffsetY(getOffsetY());
shadow.setSpread(getSpread());
shadow.setRadius(getRadius());
shadow.setBlurType(BlurType.GAUSSIAN);
return shadow;
}
private void initGraphics() {
size = getSkinnable().getPrefWidth() < getSkinnable().getPrefHeight() ? getSkinnable().getPrefWidth() : getSkinnable().getPrefHeight();
frame = new Circle(0.5 * size, 0.5 * size, 0.5 * size);
frame.setStroke(null);
frame.setVisible(getSkinnable().isFrameVisible());
main = new Circle(0.5 * size, 0.5 * size, 0.36 * size);
main.setStroke(null);
innerShadow = new InnerShadow();
innerShadow.setRadius(0.090 * main.getLayoutBounds().getWidth());
innerShadow.setColor(Color.BLACK);
innerShadow.setBlurType(BlurType.GAUSSIAN);
innerShadow.setInput(null);
glow = new DropShadow();
glow.setRadius(0.45 * main.getLayoutBounds().getWidth());
glow.setColor((Color) getSkinnable().getLedColor());
glow.setBlurType(BlurType.GAUSSIAN);
glow.setInput(innerShadow);
highlight = new Circle(0.5 * size, 0.5 * size, 0.29 * size);
highlight.setStroke(null);
getChildren().setAll(frame, main, highlight);
}
@Override protected void initGraphics() {
super.initGraphics();
currentValueListener = o -> {
if (tile.isRunning()) { return; } // Update time only if clock is not already running
updateTime(ZonedDateTime.ofInstant(Instant.ofEpochSecond(tile.getCurrentTime()), ZoneId.of(ZoneId.systemDefault().getId())));
};
timeListener = o -> updateTime(tile.getTime());
dateFormatter = DateTimeFormatter.ofPattern("EE d", tile.getLocale());
sectionMap = new HashMap<>(tile.getTimeSections().size());
for (TimeSection section : tile.getTimeSections()) { sectionMap.put(section, new Arc()); }
minuteRotate = new Rotate();
hourRotate = new Rotate();
secondRotate = new Rotate();
sectionsPane = new Pane();
sectionsPane.getChildren().addAll(sectionMap.values());
Helper.enableNode(sectionsPane, tile.getSectionsVisible());
minuteTickMarks = new Path();
minuteTickMarks.setFillRule(FillRule.EVEN_ODD);
minuteTickMarks.setFill(null);
minuteTickMarks.setStroke(tile.getMinuteColor());
minuteTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);
hourTickMarks = new Path();
hourTickMarks.setFillRule(FillRule.EVEN_ODD);
hourTickMarks.setFill(null);
hourTickMarks.setStroke(tile.getHourColor());
hourTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);
hour = new Rectangle(3, 60);
hour.setArcHeight(3);
hour.setArcWidth(3);
hour.setStroke(tile.getHourColor());
hour.getTransforms().setAll(hourRotate);
minute = new Rectangle(3, 96);
minute.setArcHeight(3);
minute.setArcWidth(3);
minute.setStroke(tile.getMinuteColor());
minute.getTransforms().setAll(minuteRotate);
second = new Rectangle(1, 96);
second.setArcHeight(1);
second.setArcWidth(1);
second.setStroke(tile.getSecondColor());
second.getTransforms().setAll(secondRotate);
second.setVisible(tile.isSecondsVisible());
second.setManaged(tile.isSecondsVisible());
knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
knob.setStroke(Color.web("#282a3280"));
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second, knob);
shadowGroupHour.setEffect(tile.isShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(tile.isShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(tile.isShadowsEnabled() ? dropShadow : null);
titleText = new Text("");
titleText.setTextOrigin(VPos.TOP);
Helper.enableNode(titleText, !tile.getTitle().isEmpty());
amPmText = new Text(tile.getTime().get(ChronoField.AMPM_OF_DAY) == 0 ? "AM" : "PM");
dateText = new Text("");
Helper.enableNode(dateText, tile.isDateVisible());
text = new Text("");
Helper.enableNode(text, tile.isTextVisible());
getPane().getChildren().addAll(sectionsPane, hourTickMarks, minuteTickMarks, titleText, amPmText, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
}
@Override protected void initGraphics() {
super.initGraphics();
currentValueListener = o -> {
if (tile.isRunning()) { return; } // Update time only if clock is not already running
updateTime(ZonedDateTime.ofInstant(Instant.ofEpochSecond(tile.getCurrentTime()), ZoneId.of(ZoneId.systemDefault().getId())));
};
timeListener = o -> updateTime(tile.getTime());
dateFormatter = DateTimeFormatter.ofPattern("EE d", tile.getLocale());
sectionMap = new HashMap<>(tile.getTimeSections().size());
for (TimeSection section : tile.getTimeSections()) { sectionMap.put(section, new Arc()); }
minuteRotate = new Rotate();
hourRotate = new Rotate();
secondRotate = new Rotate();
sectionsPane = new Pane();
sectionsPane.getChildren().addAll(sectionMap.values());
Helper.enableNode(sectionsPane, tile.getSectionsVisible());
minuteTickMarks = new Path();
minuteTickMarks.setFillRule(FillRule.EVEN_ODD);
minuteTickMarks.setFill(null);
minuteTickMarks.setStroke(tile.getMinuteColor());
minuteTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);
hourTickMarks = new Path();
hourTickMarks.setFillRule(FillRule.EVEN_ODD);
hourTickMarks.setFill(null);
hourTickMarks.setStroke(tile.getHourColor());
hourTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);
hour = new Rectangle(3, 60);
hour.setArcHeight(3);
hour.setArcWidth(3);
hour.setStroke(tile.getHourColor());
hour.getTransforms().setAll(hourRotate);
minute = new Rectangle(3, 96);
minute.setArcHeight(3);
minute.setArcWidth(3);
minute.setStroke(tile.getMinuteColor());
minute.getTransforms().setAll(minuteRotate);
second = new Rectangle(1, 96);
second.setArcHeight(1);
second.setArcWidth(1);
second.setStroke(tile.getSecondColor());
second.getTransforms().setAll(secondRotate);
second.setVisible(tile.isSecondsVisible());
second.setManaged(tile.isSecondsVisible());
knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
knob.setStroke(Color.web("#282a3280"));
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second, knob);
shadowGroupHour.setEffect(tile.isShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(tile.isShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(tile.isShadowsEnabled() ? dropShadow : null);
titleText = new Text("");
titleText.setTextOrigin(VPos.TOP);
Helper.enableNode(titleText, !tile.getTitle().isEmpty());
amPmText = new Text(tile.getTime().get(ChronoField.AMPM_OF_DAY) == 0 ? "AM" : "PM");
dateText = new Text("");
Helper.enableNode(dateText, tile.isDateVisible());
text = new Text("");
Helper.enableNode(text, tile.isTextVisible());
getPane().getChildren().addAll(sectionsPane, hourTickMarks, minuteTickMarks, titleText, amPmText, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
}
private void initGraphics() {
// Set initial size
if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
} else {
gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();
ledCanvas = new Canvas();
led = ledCanvas.getGraphicsContext2D();
thresholdTooltip = new Tooltip("Threshold\n(" + String.format(locale, formatString, gauge.getThreshold()) + ")");
thresholdTooltip.setTextAlignment(TextAlignment.CENTER);
threshold = new Path();
Helper.enableNode(threshold, gauge.isThresholdVisible());
Tooltip.install(threshold, thresholdTooltip);
average = new Path();
Helper.enableNode(average, gauge.isAverageVisible());
markerPane = new Pane();
needleRotate = new Rotate(180 - START_ANGLE);
needleRotate.setAngle(needleRotate.getAngle() + (gauge.getValue() - oldValue - gauge.getMinValue()) * angleStep);
needleMoveTo1 = new MoveTo();
needleCubicCurveTo2 = new CubicCurveTo();
needleCubicCurveTo3 = new CubicCurveTo();
needleCubicCurveTo4 = new CubicCurveTo();
needleLineTo5 = new LineTo();
needleCubicCurveTo6 = new CubicCurveTo();
needleClosePath7 = new ClosePath();
needle = new Path(needleMoveTo1, needleCubicCurveTo2, needleCubicCurveTo3, needleCubicCurveTo4, needleLineTo5, needleCubicCurveTo6, needleClosePath7);
needle.setFillRule(FillRule.EVEN_ODD);
needle.getTransforms().setAll(needleRotate);
needle.getStyleClass().add("needle");
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroup = new Group(needle);
shadowGroup.setEffect(gauge.isShadowsEnabled() ? dropShadow : null);
shadowGroup.getStyleClass().add("shadow-group");
unitText = new Text(gauge.getUnit());
unitText.setMouseTransparent(true);
unitText.setTextOrigin(VPos.CENTER);
unitText.getStyleClass().add("unit");
lcd = new Rectangle(0.3 * PREFERRED_WIDTH, 0.1 * PREFERRED_HEIGHT);
lcd.setArcWidth(0.0125 * PREFERRED_HEIGHT);
lcd.setArcHeight(0.0125 * PREFERRED_HEIGHT);
lcd.relocate((PREFERRED_WIDTH - lcd.getWidth()) * 0.5, 0.66 * PREFERRED_HEIGHT);
lcd.getStyleClass().add("lcd");
Helper.enableNode(lcd, gauge.isLcdVisible() && gauge.isValueVisible());
lcdText = new Label(String.format(locale, "%." + gauge.getDecimals() + "f", gauge.getValue()));
lcdText.setAlignment(Pos.CENTER_RIGHT);
lcdText.setVisible(gauge.isValueVisible());
lcdText.getStyleClass().add("lcd-foreground");
// Set initial value
angleStep = ANGLE_RANGE / gauge.getRange();
double targetAngle = 180 - START_ANGLE + (gauge.getValue() - gauge.getMinValue()) * angleStep;
targetAngle = clamp(180 - START_ANGLE, 180 - START_ANGLE + ANGLE_RANGE, targetAngle);
needleRotate.setAngle(targetAngle);
// Add all nodes
pane = new Pane();
pane.getChildren().setAll(ticksAndSectionsCanvas,
markerPane,
ledCanvas,
unitText,
lcd,
lcdText,
shadowGroup);
pane.getStyleClass().add("background-pane");
getChildren().setAll(pane);
}
private void initGraphics() {
// Set initial size
if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
} else {
gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();
ledCanvas = new Canvas();
led = ledCanvas.getGraphicsContext2D();
thresholdTooltip = new Tooltip("Threshold\n(" + String.format(locale, formatString, gauge.getThreshold()) + ")");
thresholdTooltip.setTextAlignment(TextAlignment.CENTER);
threshold = new Path();
Helper.enableNode(threshold, gauge.isThresholdVisible());
Tooltip.install(threshold, thresholdTooltip);
average = new Path();
Helper.enableNode(average, gauge.isAverageVisible());
markerPane = new Pane();
needleRotate = new Rotate(180 - START_ANGLE);
needleRotate.setAngle(needleRotate.getAngle() + (gauge.getValue() - oldValue - gauge.getMinValue()) * angleStep);
needleMoveTo1 = new MoveTo();
needleCubicCurveTo2 = new CubicCurveTo();
needleCubicCurveTo3 = new CubicCurveTo();
needleCubicCurveTo4 = new CubicCurveTo();
needleLineTo5 = new LineTo();
needleCubicCurveTo6 = new CubicCurveTo();
needleClosePath7 = new ClosePath();
needle = new Path(needleMoveTo1, needleCubicCurveTo2, needleCubicCurveTo3, needleCubicCurveTo4, needleLineTo5, needleCubicCurveTo6, needleClosePath7);
needle.setFillRule(FillRule.EVEN_ODD);
needle.getTransforms().setAll(needleRotate);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroup = new Group(needle);
shadowGroup.setEffect(gauge.isShadowsEnabled() ? dropShadow : null);
unitText = new Text(gauge.getUnit());
unitText.setMouseTransparent(true);
unitText.setTextOrigin(VPos.CENTER);
lcd = new Rectangle(0.3 * PREFERRED_WIDTH, 0.1 * PREFERRED_HEIGHT);
lcd.setArcWidth(0.0125 * PREFERRED_HEIGHT);
lcd.setArcHeight(0.0125 * PREFERRED_HEIGHT);
lcd.relocate((PREFERRED_WIDTH - lcd.getWidth()) * 0.5, 0.66 * PREFERRED_HEIGHT);
Helper.enableNode(lcd, gauge.isLcdVisible() && gauge.isValueVisible());
lcdText = new Label(String.format(locale, "%." + gauge.getDecimals() + "f", gauge.getValue()));
lcdText.setAlignment(Pos.CENTER_RIGHT);
lcdText.setVisible(gauge.isValueVisible());
// Set initial value
angleStep = ANGLE_RANGE / gauge.getRange();
double targetAngle = 180 - START_ANGLE + (gauge.getValue() - gauge.getMinValue()) * angleStep;
targetAngle = clamp(180 - START_ANGLE, 180 - START_ANGLE + ANGLE_RANGE, targetAngle);
needleRotate.setAngle(targetAngle);
// Add all nodes
pane = new Pane();
pane.getChildren().setAll(ticksAndSectionsCanvas,
markerPane,
ledCanvas,
unitText,
lcd,
lcdText,
shadowGroup);
getChildren().setAll(pane);
}
@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);
}
}
sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D();
tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
tickCtx = tickCanvas.getGraphicsContext2D();
alarmPane = new Pane();
hour = new Rectangle(3, 60);
hour.setArcHeight(3);
hour.setArcWidth(3);
hour.setStroke(null);
hour.setFill(clock.getHourColor());
hour.getTransforms().setAll(hourRotate);
minute = new Rectangle(3, 96);
minute.setArcHeight(3);
minute.setArcWidth(3);
minute.setStroke(null);
minute.setFill(clock.getMinuteColor());
minute.getTransforms().setAll(minuteRotate);
second = new Path();
second.setFillRule(FillRule.EVEN_ODD);
second.setStroke(null);
second.setFill(clock.getSecondColor());
second.getTransforms().setAll(secondRotate);
enableNode(second, clock.isSecondsVisible());
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
knob.setStroke(null);
knob.setFill(clock.getKnobColor());
knob.setEffect(dropShadow);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second);
shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setVisible(clock.isTitleVisible());
title.setManaged(clock.isTitleVisible());
text = new Text("");
text.setVisible(clock.isTextVisible());
text.setManaged(clock.isTextVisible());
pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond, knob);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
getChildren().setAll(pane);
}
private void initGraphics() {
// Set initial size
if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
} else {
gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();
ledCanvas = new Canvas();
led = ledCanvas.getGraphicsContext2D();
thresholdTooltip = new Tooltip("Threshold\n(" + String.format(locale, formatString, gauge.getThreshold()) + ")");
thresholdTooltip.setTextAlignment(TextAlignment.CENTER);
threshold = new Path();
Helper.enableNode(threshold, gauge.isThresholdVisible());
Tooltip.install(threshold, thresholdTooltip);
average = new Path();
Helper.enableNode(average, gauge.isAverageVisible());
markerPane = new Pane();
needleRotate = new Rotate(180 - START_ANGLE);
needleRotate.setAngle(needleRotate.getAngle() + (gauge.getValue() - oldValue - gauge.getMinValue()) * angleStep);
needleMoveTo1 = new MoveTo();
needleCubicCurveTo2 = new CubicCurveTo();
needleCubicCurveTo3 = new CubicCurveTo();
needleCubicCurveTo4 = new CubicCurveTo();
needleLineTo5 = new LineTo();
needleCubicCurveTo6 = new CubicCurveTo();
needleClosePath7 = new ClosePath();
needle = new Path(needleMoveTo1, needleCubicCurveTo2, needleCubicCurveTo3, needleCubicCurveTo4, needleLineTo5, needleCubicCurveTo6, needleClosePath7);
needle.setFillRule(FillRule.EVEN_ODD);
needle.getTransforms().setAll(needleRotate);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroup = new Group(needle);
shadowGroup.setEffect(gauge.isShadowsEnabled() ? dropShadow : null);
titleText = new Text(gauge.getTitle());
titleText.setTextOrigin(VPos.CENTER);
titleText.setFill(gauge.getTitleColor());
Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
unitText = new Text(gauge.getUnit());
unitText.setMouseTransparent(true);
unitText.setTextOrigin(VPos.CENTER);
lcd = new Rectangle(0.3 * PREFERRED_WIDTH, 0.1 * PREFERRED_HEIGHT);
lcd.setArcWidth(0.0125 * PREFERRED_HEIGHT);
lcd.setArcHeight(0.0125 * PREFERRED_HEIGHT);
lcd.relocate((PREFERRED_WIDTH - lcd.getWidth()) * 0.5, 0.44 * PREFERRED_HEIGHT);
Helper.enableNode(lcd, gauge.isLcdVisible() && gauge.isValueVisible());
lcdText = new Label(String.format(locale, "%." + gauge.getDecimals() + "f", gauge.getValue()));
lcdText.setAlignment(Pos.CENTER_RIGHT);
lcdText.setVisible(gauge.isValueVisible());
// Set initial value
angleStep = ANGLE_RANGE / gauge.getRange();
double targetAngle = 180 - START_ANGLE + (gauge.getValue() - gauge.getMinValue()) * angleStep;
targetAngle = clamp(180 - START_ANGLE, 180 - START_ANGLE + ANGLE_RANGE, targetAngle);
needleRotate.setAngle(targetAngle);
lightEffect = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.65), 2, 0.0, 0.0, 2.0);
foreground = new SVGPath();
foreground.setContent("M 26 26.5 C 26 20.2432 26.2432 20 32.5 20 L 277.5 20 C 283.7568 20 284 20.2432 284 26.5 L 284 143.5 C 284 149.7568 283.7568 150 277.5 150 L 32.5 150 C 26.2432 150 26 149.7568 26 143.5 L 26 26.5 ZM 0 6.7241 L 0 253.2758 C 0 260 0 260 6.75 260 L 303.25 260 C 310 260 310 260 310 253.2758 L 310 6.7241 C 310 0 310 0 303.25 0 L 6.75 0 C 0 0 0 0 0 6.7241 Z");
foreground.setEffect(lightEffect);
// Add all nodes
pane = new Pane();
pane.getChildren().setAll(ticksAndSectionsCanvas,
markerPane,
ledCanvas,
unitText,
lcd,
lcdText,
shadowGroup,
foreground,
titleText);
getChildren().setAll(pane);
}
@Override protected 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);
}
}
sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D();
tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
tickCtx = tickCanvas.getGraphicsContext2D();
alarmPane = new Pane();
hour = new Rectangle(3, 60);
hour.setArcHeight(3);
hour.setArcWidth(3);
hour.setStroke(getSkinnable().getHourColor());
hour.getTransforms().setAll(hourRotate);
minute = new Rectangle(3, 96);
minute.setArcHeight(3);
minute.setArcWidth(3);
minute.setStroke(getSkinnable().getMinuteColor());
minute.getTransforms().setAll(minuteRotate);
second = new Rectangle(1, 96);
second.setArcHeight(1);
second.setArcWidth(1);
second.setStroke(getSkinnable().getSecondColor());
second.getTransforms().setAll(secondRotate);
second.setVisible(getSkinnable().isSecondsVisible());
second.setManaged(getSkinnable().isSecondsVisible());
knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
knob.setStroke(Color.web("#282a3280"));
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second, knob);
shadowGroupHour.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setVisible(getSkinnable().isTitleVisible());
title.setManaged(getSkinnable().isTitleVisible());
dateText = new Text("");
dateText.setVisible(getSkinnable().isDateVisible());
dateText.setManaged(getSkinnable().isDateVisible());
text = new Text("");
text.setVisible(getSkinnable().isTextVisible());
text.setManaged(getSkinnable().isTextVisible());
pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(getSkinnable().getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
getChildren().setAll(pane);
}
@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);
}
}
sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D();
tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
tickCtx = tickCanvas.getGraphicsContext2D();
alarmPane = new Pane();
hour = new Path();
hour.setFillRule(FillRule.EVEN_ODD);
hour.setStroke(null);
hour.setFill(clock.getHourColor());
hour.getTransforms().setAll(hourRotate);
minute = new Path();
minute.setFillRule(FillRule.EVEN_ODD);
minute.setStroke(null);
minute.setFill(clock.getMinuteColor());
minute.getTransforms().setAll(minuteRotate);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroup = new Group(hour, minute);
shadowGroup.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setVisible(clock.isTitleVisible());
title.setManaged(clock.isTitleVisible());
dateText = new Text("");
dateText.setVisible(clock.isDateVisible());
dateText.setManaged(clock.isDateVisible());
text = new Text("");
text.setVisible(clock.isTextVisible());
text.setManaged(clock.isTextVisible());
pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, text, shadowGroup);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
getChildren().setAll(pane);
}
@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);
}
}
sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D();
tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
tickCtx = tickCanvas.getGraphicsContext2D();
alarmPane = new Pane();
hour = new Path();
hour.setFillRule(FillRule.EVEN_ODD);
hour.setStroke(null);
hour.getTransforms().setAll(hourRotate);
minute = new Path();
minute.setFillRule(FillRule.EVEN_ODD);
minute.setStroke(null);
minute.getTransforms().setAll(minuteRotate);
second = new Path();
second.setFillRule(FillRule.EVEN_ODD);
second.setStroke(null);
second.getTransforms().setAll(secondRotate);
second.setVisible(clock.isSecondsVisible());
second.setManaged(clock.isSecondsVisible());
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second);
shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setVisible(clock.isTitleVisible());
title.setManaged(clock.isTitleVisible());
dateText = new Text("");
dateText.setVisible(clock.isDateVisible());
dateText.setManaged(clock.isDateVisible());
dateNumber = new Text("");
dateNumber.setVisible(clock.isDateVisible());
dateNumber.setManaged(clock.isDateVisible());
text = new Text("");
text.setVisible(clock.isTextVisible());
text.setManaged(clock.isTextVisible());
pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, dateNumber, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
getChildren().setAll(pane);
}
@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);
}
}
sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D();
tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
tickCtx = tickCanvas.getGraphicsContext2D();
alarmPane = new Pane();
hour = new Path();
hour.setFillRule(FillRule.EVEN_ODD);
hour.setStroke(null);
hour.getTransforms().setAll(hourRotate);
minute = new Path();
minute.setFillRule(FillRule.EVEN_ODD);
minute.setStroke(null);
minute.getTransforms().setAll(minuteRotate);
second = new Path();
second.setFillRule(FillRule.EVEN_ODD);
second.setStroke(null);
second.getTransforms().setAll(secondRotate);
second.setVisible(clock.isSecondsVisible());
second.setManaged(clock.isSecondsVisible());
centerDot = new Circle();
centerDot.setFill(Color.WHITE);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second);
shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setVisible(clock.isTitleVisible());
title.setManaged(clock.isTitleVisible());
dateText = new Text("");
dateText.setVisible(clock.isDateVisible());
dateText.setManaged(clock.isDateVisible());
dateNumber = new Text("");
dateNumber.setVisible(clock.isDateVisible());
dateNumber.setManaged(clock.isDateVisible());
text = new Text("");
text.setVisible(clock.isTextVisible());
text.setManaged(clock.isTextVisible());
pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, dateNumber, text, shadowGroupMinute, shadowGroupHour, shadowGroupSecond, centerDot);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
getChildren().setAll(pane);
}
@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);
}
}
sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D();
tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
tickCtx = tickCanvas.getGraphicsContext2D();
alarmPane = new Pane();
hour = new Path();
hour.setFillRule(FillRule.EVEN_ODD);
hour.setStroke(null);
hour.getTransforms().setAll(hourRotate);
minute = new Path();
minute.setFillRule(FillRule.EVEN_ODD);
minute.setStroke(null);
minute.getTransforms().setAll(minuteRotate);
second = new Path();
second.setFillRule(FillRule.EVEN_ODD);
second.setStroke(null);
second.getTransforms().setAll(secondRotate);
second.setVisible(clock.isSecondsVisible());
second.setManaged(clock.isSecondsVisible());
knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.0148448);
knob.setStroke(null);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second, knob);
shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setVisible(clock.isTitleVisible());
title.setManaged(clock.isTitleVisible());
dateNumber = new Text("");
dateNumber.setVisible(clock.isDateVisible());
dateNumber.setManaged(clock.isDateVisible());
text = new Text("");
text.setVisible(clock.isTextVisible());
text.setManaged(clock.isTextVisible());
pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateNumber, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));
getChildren().setAll(pane);
}
@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);
}
}
minuteTickMarks = new Path();
minuteTickMarks.setFillRule(FillRule.EVEN_ODD);
minuteTickMarks.setFill(null);
minuteTickMarks.setStroke(clock.getMinuteColor());
minuteTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);
hourTickMarks = new Path();
hourTickMarks.setFillRule(FillRule.EVEN_ODD);
hourTickMarks.setFill(null);
hourTickMarks.setStroke(clock.getHourColor());
hourTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);
hour = new Rectangle(3, 60);
hour.setArcHeight(3);
hour.setArcWidth(3);
hour.setStroke(clock.getHourColor());
hour.getTransforms().setAll(hourRotate);
minute = new Rectangle(3, 96);
minute.setArcHeight(3);
minute.setArcWidth(3);
minute.setStroke(clock.getMinuteColor());
minute.getTransforms().setAll(minuteRotate);
second = new Rectangle(1, 96);
second.setArcHeight(1);
second.setArcWidth(1);
second.setStroke(clock.getSecondColor());
second.getTransforms().setAll(secondRotate);
second.setVisible(clock.isSecondsVisible());
second.setManaged(clock.isSecondsVisible());
knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
knob.setStroke(Color.web("#282a3280"));
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroupHour = new Group(hour);
shadowGroupMinute = new Group(minute);
shadowGroupSecond = new Group(second, knob);
shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
title = new Text("");
title.setTextOrigin(VPos.TOP);
Helper.enableNode(title, clock.isTitleVisible());
amPmText = new Text(clock.getTime().get(ChronoField.AMPM_OF_DAY) == 0 ? "AM" : "PM");
dateText = new Text("");
Helper.enableNode(dateText, clock.isDateVisible());
text = new Text("");
Helper.enableNode(text, clock.isTextVisible());
pane = new Pane(hourTickMarks, minuteTickMarks, title, amPmText, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(clock.getBorderWidth()))));
pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY)));
getChildren().setAll(pane);
}
private void initGraphics() {
frame = new Region();
frame.getStyleClass().setAll("frame");
frameInnerShadow0 = new InnerShadow();
frameInnerShadow0.setOffsetX(0);
frameInnerShadow0.setOffsetY(1);
frameInnerShadow0.setRadius(0);
frameInnerShadow0.setColor(Color.web("0x333333a6"));
frameInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
frameInnerShadow1 = new InnerShadow();
frameInnerShadow1.setOffsetX(0);
frameInnerShadow1.setOffsetY(-1);
frameInnerShadow1.setRadius(0);
frameInnerShadow1.setColor(Color.web("0xeeeeeea6"));
frameInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
frameInnerShadow1.setInput(frameInnerShadow0);
frame.setEffect(frameInnerShadow1);
deselected = new Region();
deselected.getStyleClass().setAll("deselected");
deselectedInnerShadow0 = new InnerShadow();
deselectedInnerShadow0.setOffsetX(0);
deselectedInnerShadow0.setOffsetY(-1);
deselectedInnerShadow0.setRadius(0);
deselectedInnerShadow0.setColor(Color.web("0x4b4e52a6"));
deselectedInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
deselectedInnerShadow1 = new InnerShadow();
deselectedInnerShadow1.setOffsetX(0);
deselectedInnerShadow1.setOffsetY(1);
deselectedInnerShadow1.setRadius(0);
deselectedInnerShadow1.setColor(Color.web("0xeeeeeea6"));
deselectedInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
deselectedInnerShadow1.setInput(deselectedInnerShadow0);
deselectedDropShadow = new DropShadow();
deselectedDropShadow.setOffsetX(0);
deselectedDropShadow.setOffsetY(3);
deselectedDropShadow.setRadius(3.0 / 128.0 * PREFERRED_WIDTH);
deselectedDropShadow.setColor(Color.web("0x000000a6"));
deselectedDropShadow.setBlurType(BlurType.TWO_PASS_BOX);
deselectedDropShadow.setInput(deselectedInnerShadow1);
deselected.setEffect(deselectedDropShadow);
selected = new Region();
selected.getStyleClass().setAll("selected");
selectedInnerShadow0 = new InnerShadow();
selectedInnerShadow0.setOffsetX(0);
selectedInnerShadow0.setOffsetY(-1);
selectedInnerShadow0.setRadius(0);
selectedInnerShadow0.setColor(Color.web("0x4b4e52a6"));
selectedInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
selectedInnerShadow1 = new InnerShadow();
selectedInnerShadow1.setOffsetX(0);
selectedInnerShadow1.setOffsetY(1);
selectedInnerShadow1.setRadius(0);
selectedInnerShadow1.setColor(Color.web("0xeeeeeea6"));
selectedInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
selectedInnerShadow1.setInput(selectedInnerShadow0);
selectedDropShadow = new DropShadow();
selectedDropShadow.setOffsetX(0);
selectedDropShadow.setOffsetY(0);
selectedDropShadow.setRadius(2.0 / 128.0 * PREFERRED_WIDTH);
selectedDropShadow.setColor(Color.web("0x000000a6"));
selectedDropShadow.setBlurType(BlurType.TWO_PASS_BOX);
selectedDropShadow.setInput(selectedInnerShadow1);
selected.setEffect(selectedDropShadow);
icon = new Region();
icon.getStyleClass().setAll("icon");
pane.getChildren().setAll(frame,
deselected,
selected,
icon);
// Adjust visibility dependent on settings
updateStatus();
getChildren().setAll(pane);
resize();
}