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


Java JavaFXPlatform类代码示例

本文整理汇总了Java中com.gluonhq.charm.down.common.JavaFXPlatform的典型用法代码示例。如果您正苦于以下问题:Java JavaFXPlatform类的具体用法?Java JavaFXPlatform怎么用?Java JavaFXPlatform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JavaFXPlatform类属于com.gluonhq.charm.down.common包,在下文中一共展示了JavaFXPlatform类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUniqueId

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
private String getUniqueId() {
    String uniqueId;
    if (JavaFXPlatform.isDesktop()) {
        try {
            InetAddress      ip      = InetAddress.getLocalHost();
            NetworkInterface network = NetworkInterface.getByInetAddress(ip);
            byte[]           mac     = network.getHardwareAddress();
            StringBuilder    sb      = new StringBuilder();
            for (int i = 0; i < mac.length; i++) { sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); }
            uniqueId = sb.toString();
        } catch (UnknownHostException | SocketException e) {
            uniqueId = "MoodFXDesktop" + RND.nextInt(1000);
        }
    } else if (JavaFXPlatform.isAndroid()) {
        uniqueId = "MoodFXAndroid" + RND.nextInt(1000);
    } else if (JavaFXPlatform.isIOS()) {
        uniqueId = "MoodFXiOS" + RND.nextInt(1000);
    } else {
        uniqueId = "MoodFX" + RND.nextInt(1000);
    }
    return uniqueId;
}
 
开发者ID:HanSolo,项目名称:MoodFX,代码行数:23,代码来源:ConfigView.java

示例2: postInit

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
@Override public void postInit(Scene scene) {
    scene.getStylesheets().add(MoodFX.class.getResource("styles.css").toExternalForm());
    Swatch.BLUE_GREY.assignTo(scene);
    ((Stage) scene.getWindow()).getIcons().add(new Image(MoodFX.class.getResourceAsStream("/icon.png")));

    // Size to FullScreen on Desktop and Embedded
    if (JavaFXPlatform.isDesktop()) {
        if (System.getProperty("os.arch").toUpperCase().contains("ARM")) {
            ((Stage) scene.getWindow()).setFullScreen(true);
            ((Stage) scene.getWindow()).setFullScreenExitHint("");
        } else {
            (scene.getWindow()).setWidth(500);
            (scene.getWindow()).setHeight(550);
        }
    }
}
 
开发者ID:HanSolo,项目名称:MoodFX,代码行数:17,代码来源:MoodFX.java

示例3: init

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
private void init() {
    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);
        }
    }
    if (Double.compare(getMinWidth(), 0.0) <= 0 || Double.compare(getMinHeight(), 0.0) <= 0) {
        setMinSize(MINIMUM_WIDTH, MINIMUM_HEIGHT);
    }
    if (Double.compare(getMaxWidth(), 0.0) <= 0 || Double.compare(getMaxHeight(), 0.0) <= 0) {
        if (JavaFXPlatform.isIOS()) {
            setMaxSize(350, 350);
        } else {
            setMaxSize(MAXIMUM_WIDTH, MAXIMUM_HEIGHT);
        }
    }
}
 
开发者ID:HanSolo,项目名称:MoodFX,代码行数:21,代码来源:ColorRegulator.java

示例4: postInit

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
@Override
public void postInit(Scene scene) {
    Swatch.TEAL.assignTo(scene);
    
    if (JavaFXPlatform.isDesktop()) {
        scene.getWindow().setWidth(350);
        scene.getWindow().setHeight(650);
    }
    
    PlatformFactory.getPlatform().setOnLifecycleEvent(p -> {
        if (controlPresenter != null) {
            switch (p) {
                case PAUSE: 
                case STOP: stop(); break;
                case RESUME: controlPresenter.start(); break;
            }
        }
        return null;
    });
}
 
开发者ID:TRIPJavaFXClientBraintrust,项目名称:TRIPfx,代码行数:21,代码来源:TRIPMobile.java

示例5: getPlatformClassName

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
private static String getPlatformClassName() {
    switch (JavaFXPlatform.getCurrent()) {
        case ANDROID:
            return "com.zeiss.quarkfx.AndroidPlatform";
        case IOS:
            return "com.zeiss.quarkfx.IosPlatform";
        default:
            return "com.zeiss.quarkfx.DesktopPlatform";
    }
}
 
开发者ID:Ciruman,项目名称:QuarkFX,代码行数:11,代码来源:NativePlatformFactory.java

示例6: moveToFoV

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
private void moveToFoV(final Node NODE, final boolean WAS_FOCUSED, final boolean IS_FOCUSED) {
    if (IS_FOCUSED && !WAS_FOCUSED) {         // Got Focus
        if (!JavaFXPlatform.isDesktop()) configPane.setTranslateY(-NODE.getLayoutY());
    } else if (WAS_FOCUSED && !IS_FOCUSED) {  // Lost Focus
        resetFoV();
        saveConfig();
    }
}
 
开发者ID:HanSolo,项目名称:MoodFX,代码行数:9,代码来源:ConfigView.java

示例7: resetFoV

import com.gluonhq.charm.down.common.JavaFXPlatform; //导入依赖的package包/类
private void resetFoV() { if (!JavaFXPlatform.isDesktop()) configPane.setTranslateY(0); } 
开发者ID:HanSolo,项目名称:MoodFX,代码行数:2,代码来源:ConfigView.java


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