Exemple #1
0
  protected static void splash(boolean show, boolean debug) {
    Log4JUtil.initLog4J();
    if (debugListener == null && debug) {
      // set a global listener for debug options
      debugFired = false;
      Toolkit.getDefaultToolkit()
          .addAWTEventListener(
              debugListener =
                  new AWTEventListener() {
                    @Override
                    public void eventDispatched(AWTEvent e) {
                      if (!debugFired) {
                        /*We set the debugmsg flag on the first instance of the user pressing any button
                        and the if the debugFired hasn't been set, this allows us to ensure that we don't
                        miss the user pressing F8, while we are checking*/
                        debugmsg = true;
                        if (e.getID() == KeyEvent.KEY_PRESSED) {
                          KeyEvent ky = (KeyEvent) e;
                          if (ky.getKeyCode() == 119) {
                            startupDebug();
                          } else {
                            debugmsg = false;
                          }
                        } else {
                          debugmsg = false;
                        }
                      }
                    }
                  },
              AWTEvent.KEY_EVENT_MASK);
    }

    // bring up splash window for startup
    if (sp == null) {
      if (debug) {
        sp = new SplashWindow(splashDebugMsg());
      } else {
        sp = new SplashWindow();
      }
    }
    sp.setVisible(show);
    if (!show) {
      sp.dispose();
      Toolkit.getDefaultToolkit().removeAWTEventListener(debugListener);
      debugListener = null;
      sp = null;
    }
  }
Exemple #2
0
  /**
   * Constructor for the singleton Boot object.
   *
   * @param args the arguments with which main() was invoked
   * @param props the properties (created from the args)
   */
  private Boot(String[] args, Properties props, final SplashLabel image) {
    // Display the splash window, and wait until it's been painted before
    // proceeding. Otherwise, the event thread may be occupied by BlueJ
    // starting up and the window might *never* be painted.

    try {
      EventQueue.invokeAndWait(
          new Runnable() {
            @Override
            public void run() {
              splashWindow = new SplashWindow(image);
              splashWindow.repaint(); // avoid delay before painting
            }
          });
      splashWindow.waitUntilPainted();
    } catch (InvocationTargetException ite) {
      ite.printStackTrace();
    } catch (InterruptedException ie) {
      ie.printStackTrace();
    }

    this.args = args;
    this.commandLineProps = props;
  }
Exemple #3
0
 /**
  * Shows the splash screen, launches the application and then disposes the splash screen.
  *
  * @param args the command line arguments
  */
 public static void main(String[] args) {
   SplashWindow.splash(ClassLoader.getSystemResource("images/icon.png"));
   SplashWindow.invokeMain("groovejaar.GrooveJaar", args);
   SplashWindow.disposeSplash();
 }
Exemple #4
0
  /**
   * El método principal.
   *
   * @param args los argumentos
   */
  public static void main(final String[] args) {
    System.setProperty(Logging.JXTA_LOGGING_PROPERTY, Level.FINE.toString());

    CheexeApp.USER_ROOT = System.getProperty("user.home");
    CheexeApp.ROOT_FOLDER = File.separator;

    if ((args != null) && (args.length > 0)) {
      for (final String arg : args) {
        if (arg.equals("-readonly")) {
          CHPreferences.getInstance().setReadOnly(true);
        }
        if (arg.equals("-reset")) {
          CHPreferences.getInstance().clearPreferences();
        }
      }
    }

    try {
      SplashWindow.setInstanceCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    } catch (final RuntimeException e) {
    }

    /*try {
    	UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (final Exception e) {}*/

    try {
      UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel");
    } catch (Exception e) {
      System.err.println("Substance Raven Graphite Glass failed to initialize");
    }

    es.cheexe.CheexeApp.loading = true;

    final Thread runner =
        new Thread() {
          @Override
          public void run() {
            while (es.cheexe.CheexeApp.loading) {
              try {
                Thread.sleep(60);
              } catch (InterruptedException e) {
              }
              SplashWindow.progbar(0);
            }
          }
        };
    runner.start();

    BasicConfigurator.configure();

    System.setProperty("swing.aatext", "true");
    System.setProperty("sun.java2d.ddscale", "true");
    System.setProperty("apple.laf.useScreenMenuBar", "true");
    System.setProperty("apple.awt.graphics.EnableQ2DX", "true");
    System.setProperty(
        "apple.awt.rendering", "VALUE_RENDER_SPEED"); // VALUE_RENDER_SPEED or VALUE_RENDER_QUALITY
    System.setProperty(
        "apple.awt.interpolation",
        "VALUE_INTERPOLATION_NEAREST_NEIGHBOR"); // VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
    // VALUE_INTERPOLATION_BILINEAR, or
    // VALUE_INTERPOLATION_BICUBIC
    System.setProperty("apple.awt.showGrowBox", "true");
    System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
    System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Cheexe");
    es.cheexe.CheexeApp.instance().setVisible(true);

    // es.cheexe.CheexeApp.instance().gotoLastDirectory();
    //		es.cheexe.CheexeApp.instance().initializeDownloadsPanel();
    es.cheexe.CheexeApp.loading = false;
    try {
      SplashWindow.setInstanceCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    } catch (final RuntimeException e) {
    }
    es.cheexe.CheexeApp.instance().gotoLastDirectory();
    es.cheexe.CheexeApp.instance().startJXTA();
  }
Exemple #5
0
 public static void main(String[] args) {
   SplashWindow.splash(
       Splasher.class.getResource(IconsUtils.getInstance().getProperty("splash.icon")));
   SplashWindow.invokeMain("ro.rmc.riskeval.gui.RiskEvalStart", args);
   SplashWindow.disposeSlash();
 }
Exemple #6
0
 /** Hide (and dispose) the splash window */
 public void disposeSplashWindow() {
   if (splashWindow != null) {
     splashWindow.dispose();
     splashWindow = null;
   }
 }