本文整理了Java中com.jme3.system.AppSettings.save()
方法的一些代码示例,展示了AppSettings.save()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppSettings.save()
方法的具体详情如下:
包路径:com.jme3.system.AppSettings
类名称:AppSettings
方法名:save
[英]Saves all settings to the given properties output stream.
[中]将所有设置保存到给定的属性输出流。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
source.save(appTitle);
} catch (BackingStoreException ex) {
logger.log(Level.WARNING,
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
settings.save(baos);
} catch (IOException ex) {
ex.printStackTrace();
代码示例来源: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
/**
* Save the settings
*
* @throws java.io.IOException may fail to save
*/
public void save() throws IOException {
try (OutputStream os = new FileOutputStream(new File(USER_SETTINGS_FILE))) {
settings.save(os);
}
}
代码示例来源:origin: tonihele/OpenKeeper
public void saveSettings() {
try (OutputStream os = new FileOutputStream(new File(SETTINGS_FILE))) {
settings.save(os);
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, "Settings file failed to save!", ex);
}
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
source.save(appTitle);
} catch (BackingStoreException ex) {
logger.log(Level.WARNING,
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-desktop
source.save(appTitle);
} catch (BackingStoreException ex) {
logger.log(Level.WARNING,
内容来源于网络,如有侵权,请联系作者删除!