package hirondelle.stocks.main;
import java.util.logging.*;
import java.awt.EventQueue;
import hirondelle.stocks.util.Util;
import hirondelle.stocks.util.Consts;
public final class Launcher {
public static void main (String... aArgs) {
logBasicSystemInfo();
showSplashScreen();
showMainWindow();
EventQueue.invokeLater(new SplashScreenCloser());
fLogger.info("Launch thread now exiting...");
}
private static SplashScreen fSplashScreen;
private static final Logger fLogger = Util.getLogger(Launcher.class);
private static final String SPLASH_IMAGE = "StocksMonitor.gif";
private static void showSplashScreen(){
fLogger.info("Showing the splash screen.");
fSplashScreen = new SplashScreen(SPLASH_IMAGE);
fSplashScreen.splash();
}
private static void showMainWindow(){
fLogger.info("Showing the main window.");
StocksMonitorMainWindow mainWindow = new StocksMonitorMainWindow();
}
private static final class SplashScreenCloser implements Runnable {
@Override public void run(){
fLogger.fine("Closing the splash screen.'");
fSplashScreen.dispose();
}
}
private static void logBasicSystemInfo() {
fLogger.info("Launching the application...");
fLogger.config(
"Operating System: " + System.getProperty("os.name") + " " +
System.getProperty("os.version")
);
fLogger.config("JRE: " + System.getProperty("java.version"));
fLogger.info("Java Launched From: " + System.getProperty("java.home"));
fLogger.config("Class Path: " + System.getProperty("java.class.path"));
fLogger.config("Library Path: " + System.getProperty("java.library.path"));
fLogger.config("Application Name: " + Consts.APP_NAME + "/" + Consts.APP_VERSION);
fLogger.config("User Home Directory: " + System.getProperty("user.home"));
fLogger.config("User Working Directory: " + System.getProperty("user.dir"));
fLogger.info("Test INFO logging.");
fLogger.fine("Test FINE logging.");
fLogger.finest("Test FINEST logging.");
}
}