当前位置: 首页>>代码示例>>Java>>正文


Java LcdClock类代码示例

本文整理汇总了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();
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:17,代码来源:LcdClockSkin.java

示例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);
}
 
开发者ID:HanSolo,项目名称:javafxdemo,代码行数:15,代码来源:Main.java

示例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));
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:47,代码来源:LcdClockSkin.java

示例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");
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:46,代码来源:LcdClockSkin.java


注:本文中的eu.hansolo.enzo.lcd.LcdClock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。