com.jme3.system.AppSettings.containsKey()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中com.jme3.system.AppSettings.containsKey()方法的一些代码示例,展示了AppSettings.containsKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppSettings.containsKey()方法的具体详情如下:
包路径:com.jme3.system.AppSettings
类名称:AppSettings
方法名:containsKey

AppSettings.containsKey介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Same as {@link #copyFrom(com.jme3.system.AppSettings) }, except
 * doesn't overwrite settings that are already set.
 *
 * @param other  The AppSettings to merge the settings from
 */
public void mergeFrom(AppSettings other) {
  for (String key : other.keySet()) {
    if( !this.containsKey(key) ) {
      put(key, other.get(key));
    }
  }
}

代码示例来源:origin: tonihele/OpenKeeper

/**
 * Check whether the given key exists
 *
 * @param setting the setting
 * @return true if given setting exists
 */
public boolean containsSetting(ISetting setting) {
  return settings.containsKey(setting.getKey());
}

代码示例来源: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());
}

相关文章

AppSettings类方法