/src/mpv5/YabsApplication.java
Java | 63 lines | 23 code | 7 blank | 33 comment | 0 complexity | 93a79958d03e4ac29fd62b5c73b6d92d MD5 | raw file
1/* 2 * YabsApplication.java 3 */ 4package mpv5; 5 6import mpv5.db.objects.User; 7import org.jdesktop.application.Application; 8import org.jdesktop.application.SingleFrameApplication; 9 10/** 11 * The main class of the application. 12 * Just a wrapper class to encapsulate SingleFrameApplication from yabs.Main. 13 * 14 * Replacing classes must do the same callbacks to main as this class. 15 */ 16public class YabsApplication extends SingleFrameApplication { 17 18 private final mpv5.Main main = new Main(); 19 20 /** 21 * At startup create and show the main frame of the application. 22 */ 23 @Override 24 protected void startup() { 25 main.startup(); 26 } 27 28 /** 29 * This method is to initialize the specified window by injecting resources. 30 * Windows shown in our application come fully initialized from the GUI 31 * builder, so this additional configuration is not needed. 32 * @param root 33 */ 34// @Override 35// protected void configureWindow(java.awt.Window root) { 36//// getApplication().getMainFrame().setTitle(Main.WINDOW_TITLE); 37// root.addWindowListener(new WindowAdapter() { 38// 39// @Override 40// public void windowClosing(WindowEvent e) { 41// main.shutdown(); 42// } 43// }); 44// } 45 /** 46 * A convenient static getter for the application instance. 47 * @return the instance of Main 48 */ 49 public static Application getApplication() { 50 return YabsApplication.getInstance(Application.class); 51 } 52 53 @Override 54 public void ready() { 55 Main.setLaF(User.getCurrentUser().__getLaf()); 56 } 57 58 @Override 59 public void shutdown() { 60 super.shutdown(); 61 main.shutdown(); 62 } 63}