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

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

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

AppSettings.setIcons介绍

[英]Sets the application icons to be used, with the most preferred first. For Windows you should supply at least one 16x16 icon and one 32x32. The former is used for the title/task bar, the latter for the alt-tab icon. Linux (and similar platforms) expect one 32x32 icon. Mac OS X should be supplied one 128x128 icon.
The icon is used for the settings window, and the LWJGL render window. Not currently supported for JOGL. Note that a bug in Java 6 (bug ID 6445278, currently hidden but available in Google cache) currently prevents the icon working for alt-tab on the settings dialog in Windows.
[中]设置要使用的应用程序图标,首选图标优先。对于Windows,您应至少提供一个16x16图标和一个32x32图标。前者用于标题/任务栏,后者用于alt tab图标。Linux(和类似的平台)需要一个32x32图标。Mac OS X应提供一个128x128图标。
该图标用于设置窗口和LWJGL渲染窗口。当前不支持JOGL。请注意,Java 6中的一个错误(错误ID 6445278,当前隐藏但在Google缓存中可用)当前阻止了Windows中设置对话框上alt选项卡的图标工作。

代码示例

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

public static void main(String[] args) {
  TestChangeAppIcon app = new TestChangeAppIcon();
  AppSettings settings = new AppSettings(true);
  try {
    Class<TestChangeAppIcon> clazz = TestChangeAppIcon.class;
    settings.setIcons(new BufferedImage[]{
          ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey256.png")),
          ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey128.png")),
          ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey32.png")),
          ImageIO.read(clazz.getResourceAsStream("/Interface/icons/SmartMonkey16.png")),
        });
  } catch (IOException e) {
    log.log(java.util.logging.Level.WARNING, "Unable to load program icons", e);
  }
  app.setSettings(settings);
  app.start();
}

代码示例来源: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类方法