1 25 package org.ofbiz.base.splash; 26 27 import java.awt.EventQueue ; 28 29 import org.ofbiz.base.start.Start; 30 import org.ofbiz.base.start.StartupException; 31 import org.ofbiz.base.start.StartupLoader; 32 33 39 public class SplashLoader implements StartupLoader, Runnable { 40 41 public static final String module = SplashLoader.class.getName(); 42 private static SplashScreen screen = null; 43 private Start.Config config = null; 44 45 53 public void load(Start.Config config, String args[]) throws StartupException { 54 this.config = config; 55 56 Thread t = new Thread (this); 57 t.setName(this.toString()); 58 t.setDaemon(false); 59 t.run(); 60 } 61 62 68 public void start() throws StartupException { 69 } 70 71 77 public void unload() throws StartupException { 78 SplashLoader.close(); 79 } 80 81 public static SplashScreen getSplashScreen() { 82 return screen; 83 } 84 85 public static void close() { 86 if (screen != null) { 87 EventQueue.invokeLater(new SplashScreenCloser()); 88 } 89 } 90 91 public void run() { 92 if (config.splashLogo != null) { 93 screen = new SplashScreen(config.splashLogo); 94 screen.splash(); 95 } 96 } 97 98 private static final class SplashScreenCloser implements Runnable { 99 public void run() { 100 screen.close(); 101 screen = null; 102 } 103 } 104 } 105 | Popular Tags |