本文整理汇总了Java中eu.hansolo.enzo.lcd.LcdClock类的典型用法代码示例。如果您正苦于以下问题:Java LcdClock类的具体用法?Java LcdClock怎么用?Java LcdClock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LcdClock类属于eu.hansolo.enzo.lcd包,在下文中一共展示了LcdClock类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LcdClockSkin
import eu.hansolo.enzo.lcd.LcdClock; //导入依赖的package包/类
public LcdClockSkin(final LcdClock CONTROL) {
super(CONTROL);
aspectRatio = PREFERRED_HEIGHT / PREFERRED_WIDTH;
valueOffsetRight = 0.0;
digitalFontSizeFactor = 1.0;
backgroundTextBuilder = new StringBuilder();
FOREGROUND_SHADOW.setOffsetX(0);
FOREGROUND_SHADOW.setOffsetY(1);
FOREGROUND_SHADOW.setColor(Color.rgb(0, 0, 0, 0.5));
FOREGROUND_SHADOW.setBlurType(BlurType.TWO_PASS_BOX);
FOREGROUND_SHADOW.setRadius(2);
adjustDateFormat();
init();
initGraphics();
registerListeners();
}
示例2: initLcdClockPane
import eu.hansolo.enzo.lcd.LcdClock; //导入依赖的package包/类
private void initLcdClockPane() {
lcdClock = LcdClockBuilder.create()
.prefSize(500, 500)
.styleClass(LcdClock.STYLE_CLASS_GREEN_DARKGREEN)
.title("JavaFX")
.build();
lcdClockPane = new StackPane(lcdClock);
AnchorPane.setLeftAnchor(lcdClockPane, 20d);
AnchorPane.setTopAnchor(lcdClockPane, 50d);
AnchorPane.setRightAnchor(lcdClockPane, 20d);
unManageNode(lcdClockPane);
}
示例3: updateFonts
import eu.hansolo.enzo.lcd.LcdClock; //导入依赖的package包/类
private void updateFonts() {
digitalFontSizeFactor = 1.0;
switch(getSkinnable().getTimeFont()) {
case LCD:
digitalFontSizeFactor = 1.05;
timeFont = Font.font("Digital-7", (0.7 * height));
secondFont = Font.font("Digital-7", FontWeight.NORMAL, (0.2 * height));
break;
case DIGITAL:
digitalFontSizeFactor = 0.7;
timeFont = Font.font("Digital Readout Upright", (0.7 * height));
secondFont = Font.font("Digital Readout Upright", FontWeight.NORMAL, (0.2 * height));
break;
case DIGITAL_BOLD:
digitalFontSizeFactor = 0.7;
timeFont = Font.font("Digital Readout Thick Upright", (0.7 * height));
secondFont = Font.font("Digital Readout Thick Upright", FontWeight.NORMAL, (0.2 * height));
break;
case ELEKTRA:
digitalFontSizeFactor = 0.8;
timeFont = Font.font("Elektra", (0.7 * height));
secondFont = Font.font("Elektra", FontWeight.NORMAL, (0.186 * height));
break;
case STANDARD:
default:
digitalFontSizeFactor = 0.7;
timeFont = Font.font("Open Sans", FontWeight.NORMAL, (0.6 * height));
secondFont = Font.font("Open Sans", FontWeight.NORMAL, (0.2 * height));
break;
}
backgroundTimeText.setFont(timeFont);
backgroundTimeText.setOpacity((LcdClock.LcdFont.LCD == getSkinnable().getTimeFont() ||
LcdClock.LcdFont.DIGITAL == getSkinnable().getTimeFont() ||
LcdClock.LcdFont.DIGITAL_BOLD == getSkinnable().getTimeFont() ||
LcdClock.LcdFont.ELEKTRA == getSkinnable().getTimeFont()) ? 1 : 0);
backgroundSecondText.setFont(secondFont);
backgroundSecondText.setOpacity((LcdClock.LcdFont.LCD == getSkinnable().getTimeFont() ||
LcdClock.LcdFont.DIGITAL == getSkinnable().getTimeFont() ||
LcdClock.LcdFont.DIGITAL_BOLD == getSkinnable().getTimeFont() ||
LcdClock.LcdFont.ELEKTRA == getSkinnable().getTimeFont()) ? 1 : 0);
timeText.setFont(timeFont);
titleFont = Font.font(getSkinnable().getTitleFont(), FontWeight.BOLD, (0.15 * height));
smallFont = Font.font(getSkinnable().getSmallFont(), FontWeight.NORMAL, (0.12 * height));
}
示例4: updateBackgroundText
import eu.hansolo.enzo.lcd.LcdClock; //导入依赖的package包/类
private void updateBackgroundText() {
// Setup the semitransparent background timeText
backgroundTimeText.setTextOrigin(VPos.BASELINE);
backgroundTimeText.setTextAlignment(TextAlignment.RIGHT);
backgroundSecondText.setTextOrigin(VPos.BASELINE);
backgroundSecondText.setTextAlignment(TextAlignment.RIGHT);
// Setup the semitransparent background timeText
// Width of one time segment
oneTimeSegment.setFont(timeFont);
if (LcdClock.LcdFont.LCD == getSkinnable().getTimeFont()) {
oneTimeSegment.setText("8");
} else if (LcdClock.LcdFont.DIGITAL == getSkinnable().getTimeFont()) {
oneTimeSegment.setText("_");
} else if (LcdClock.LcdFont.DIGITAL_BOLD == getSkinnable().getTimeFont()) {
oneTimeSegment.setText("_");
} else if (LcdClock.LcdFont.ELEKTRA == getSkinnable().getTimeFont()) {
oneTimeSegment.setText("_");
}
// Width of one time segment
oneSecondSegment.setFont(secondFont);
if (LcdClock.LcdFont.LCD == getSkinnable().getTimeFont()) {
oneSecondSegment.setText("8");
} else if (LcdClock.LcdFont.DIGITAL == getSkinnable().getTimeFont()) {
oneSecondSegment.setText("_");
} else if (LcdClock.LcdFont.DIGITAL_BOLD == getSkinnable().getTimeFont()) {
oneSecondSegment.setText("_");
} else if (LcdClock.LcdFont.ELEKTRA == getSkinnable().getTimeFont()) {
oneSecondSegment.setText("_");
}
// Add segments to background timeText
backgroundTextBuilder.setLength(0);
backgroundTextBuilder.append(oneTimeSegment.getText());
backgroundTextBuilder.append(oneTimeSegment.getText());
backgroundTextBuilder.append(":");
backgroundTextBuilder.append(oneTimeSegment.getText());
backgroundTextBuilder.append(oneTimeSegment.getText());
backgroundTimeText.setText(backgroundTextBuilder.toString());
backgroundSecondText.setText("88");
}