本文整理了Java中com.jme3.system.AppSettings.load()
方法的一些代码示例,展示了AppSettings.load()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppSettings.load()
方法的具体详情如下:
包路径:com.jme3.system.AppSettings
类名称:AppSettings
方法名:load
[英]Loads the settings from the given properties input stream.
[中]从给定的属性输入流加载设置。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
try {
in = appCfg.openStream();
settings.load(in);
in.close();
} catch (IOException ex){
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
try {
InputStream in = appCfg.openStream();
settings.load(in);
in.close();
} catch (IOException ex){
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
try {
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
loadedSettings.load(bais);
} catch (IOException ex) {
ex.printStackTrace();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
registrySettings.load(appTitle);
} catch (BackingStoreException ex) {
logger.log(Level.WARNING,
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Tests preference based AppSettings.
*/
private static void testPreferenceSettings() {
AppSettings settings = new AppSettings(false);
settings.putBoolean("TestBool", true);
settings.putInteger("TestInt", 123);
settings.putString("TestStr", "HelloWorld");
settings.putFloat("TestFloat", 123.567f);
settings.put("TestObj", new Mesh()); // Objects not supported by preferences
try {
settings.save(APPSETTINGS_KEY);
} catch (BackingStoreException ex) {
ex.printStackTrace();
}
AppSettings loadedSettings = new AppSettings(false);
try {
loadedSettings.load(APPSETTINGS_KEY);
} catch (BackingStoreException ex) {
ex.printStackTrace();
}
assertEqual(loadedSettings.getBoolean("TestBool"), true);
assertEqual(loadedSettings.getInteger("TestInt"), 123);
assertEqual(loadedSettings.getString("TestStr"), "HelloWorld");
assertEqual(loadedSettings.get("TestFloat"), 123.567f);
}
代码示例来源:origin: tonihele/OpenKeeper
private void loadSettings() {
// Init the application settings which contain just the conversion & folder data
File settingsFile = new File(SETTINGS_FILE);
if (settingsFile.exists()) {
try (InputStream is = new FileInputStream(settingsFile)) {
settings.load(is);
} catch (IOException ex) {
LOGGER.log(java.util.logging.Level.WARNING, "Settings file failed to load from " + settingsFile + "!", ex);
}
}
}
代码示例来源:origin: tonihele/OpenKeeper
private Settings(final AppSettings settings) {
// Init the settings
this.settings = settings;
//Default resolution
if (!this.settings.containsKey("Width") || !this.settings.containsKey("Height")) {
this.settings.setResolution(800, 600); // Default resolution
}
File settingsFile = new File(USER_SETTINGS_FILE);
if (settingsFile.exists()) {
try (InputStream is = new FileInputStream(settingsFile)) {
this.settings.load(is);
} catch (IOException ex) {
LOGGER.log(java.util.logging.Level.WARNING, "Settings file failed to load from " + settingsFile + "!", ex);
}
}
this.settings.setFrameRate(Math.max(MAX_FPS, settings.getFrequency()));
// Assing some app level settings
settings.setTitle(TITLE);
settings.setIcons(getApplicationIcons());
}
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-desktop
try {
in = appCfg.openStream();
settings.load(in);
in.close();
} catch (IOException ex){
代码示例来源:origin: info.projectkyoto/mms-engine
registrySettings.load(appTitle);
} catch (BackingStoreException ex) {
logger.log(Level.WARNING,
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-desktop
registrySettings.load(appTitle);
} catch (BackingStoreException ex) {
logger.log(Level.WARNING,
内容来源于网络,如有侵权,请联系作者删除!