當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。