Esempio n. 1
0
 public static void initUI(Subsystem core) {
   try {
     System.out.println("starting ui");
     SimpleTimer s = new SimpleTimer();
     Subsystem ui = (Subsystem) Class.forName("org.alliance.ui.UISubsystem").newInstance();
     ui.init(ResourceSingelton.getRl(), core);
     if (T.t) {
       T.trace("Subsystem UI started in " + s.getTime());
     }
   } catch (Exception t) {
     reportError(t);
   }
 }
Esempio n. 2
0
 private static Subsystem initCore(String settings, StartupProgressListener l) {
   try {
     SimpleTimer s = new SimpleTimer();
     Subsystem core = (Subsystem) Class.forName("org.alliance.core.CoreSubsystem").newInstance();
     core.init(ResourceSingelton.getRl(), settings, l);
     if (T.t) {
       T.info("" + "Subsystem CORE started in " + s.getTime());
     }
     return core;
   } catch (Throwable t) {
     reportError(t);
     System.err.println(t);
     return null;
   }
 }
Esempio n. 3
0
 private void killUI() {
   if (ui != null) {
     ui.shutdown();
   }
   printer = PLAIN_PRINTER;
   ui = null;
   printer.println("UI Shutdown.");
 }
Esempio n. 4
0
 private static Subsystem initTrayIcon(Subsystem core) throws Throwable {
   try {
     if (T.t) {
       T.info("Starting Java 6 tray icon...");
     }
     Subsystem tray =
         (Subsystem)
             Class.forName("org.alliance.launchers.ui.Java6TrayIconSubsystem").newInstance();
     tray.init(ResourceSingelton.getRl(), core);
     return tray;
   } catch (Throwable e) {
     if (T.t) {
       T.warn("Java 6 tray icon not supported. Falling back to old code.");
     }
     Subsystem tray =
         (Subsystem)
             Class.forName("org.alliance.launchers.ui.JDesktopTrayIconSubsystem").newInstance();
     tray.init(ResourceSingelton.getRl(), core);
     return tray;
   }
 }
 private synchronized void openUI() {
   try {
     if (ui != null) {
       if (T.t) {
         T.info("Subsystem already started.");
       }
       core.uiToFront();
       return;
     }
     Runnable r = (Runnable) Class.forName("org.alliance.launchers.SplashWindow").newInstance();
     SimpleTimer s = new SimpleTimer();
     ui = (Subsystem) Class.forName("org.alliance.ui.UISubsystem").newInstance();
     ui.init(ResourceSingelton.getRl(), core, r);
     if (T.t) {
       T.trace("Subsystem UI started in " + s.getTime());
     }
     r.run();
   } catch (Exception t) {
     core.reportError(t, this);
   }
 }
  @Override
  public synchronized void shutdown() {
    if (tray != null && ti != null) {
      ti.displayMessage(
          "", Language.getLocalizedString(getClass(), "shutting"), TrayIcon.MessageType.NONE);
      balloonClickHandler = null;
    }

    if (ui != null) {
      ui.shutdown();
      ui = null;
    }
    if (core != null) {
      core.shutdown();
      core = null;
    }
    if (tray != null) {
      tray.remove(ti);
    }
    System.exit(0);
  }
Esempio n. 7
0
 private void ui() throws Exception {
   Runnable r = (Runnable) Class.forName("org.alliance.launchers.SplashWindow").newInstance();
   ui = (Subsystem) Class.forName("org.alliance.ui.UISubsystem").newInstance();
   ui.init(ResourceSingelton.getRl(), core);
   r.run(); // closes splashwindow
 }