本文整理匯總了Java中com.gluonhq.charm.down.common.JavaFXPlatform.isDesktop方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaFXPlatform.isDesktop方法的具體用法?Java JavaFXPlatform.isDesktop怎麽用?Java JavaFXPlatform.isDesktop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.gluonhq.charm.down.common.JavaFXPlatform
的用法示例。
在下文中一共展示了JavaFXPlatform.isDesktop方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例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);
}
}
}
示例3: 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;
});
}
示例4: 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();
}
}
示例5: resetFoV
import com.gluonhq.charm.down.common.JavaFXPlatform; //導入方法依賴的package包/類
private void resetFoV() { if (!JavaFXPlatform.isDesktop()) configPane.setTranslateY(0); }