Esempio n. 1
0
  /** Creates and initializes a splash screen based on image shown by vm while starting. */
  private void createSplashscreen() {

    // Create splash screen only when not yet happened.
    if (splash != null) {

      splashGraphics = splash.createGraphics();

      if (splashGraphics != null) {

        final Color splashscreenColor = new Color(85, 85, 85);
        final int versionX = 38;
        final int versionY = 126;
        final float versionFontSize = 18;
        final String versionString = RunUI.class.getPackage().getSpecificationVersion();

        splashGraphics.setRenderingHint(
            RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        splashGraphics.setRenderingHint(
            RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        splashGraphics.setRenderingHint(
            RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        splashGraphics.setRenderingHint(
            RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);

        splashGraphics.setColor(splashscreenColor);
        splashGraphics.setFont(FontFactory.createSplashscreenFont().deriveFont(versionFontSize));

        splashGraphics.setPaintMode();
        splashGraphics.drawString("Version " + versionString, versionX, versionY);
        splash.update();

        splashGraphics.setFont(FontFactory.createSplashscreenFont());
      }
    }
  }
Esempio n. 2
0
  /** Restarts FreeNono. Not yet usable! */
  @SuppressWarnings("unused")
  private void restartProgram() {

    mainUI.removeEventHelper();
    mainUI.setVisible(false);
    mainUI.dispose();
    mainUI = null;

    Locale.setDefault(settings.getGameLocale());
    Messages.loadResourceBundle();
    FontFactory.resetFonts();

    // initialize();
    startSwingUI();
  }