本文整理汇总了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); }