PageRenderTime 129ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/src/mpv5/YabsApplication.java

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