Class FWApplication

java.lang.Object
net.simplace.ui.FWApplication
Direct Known Subclasses:
MainApp

public abstract class FWApplication extends Object
Abstract base-class for applications.
Author:
Andreas Enders
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the instance without any options
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    applyLanguage(String aLocalization)
    Switches the language of the GUI: sets the default language of the LocaleProvider and reinitialises the Swing look and feel, so that the standard Swing texts follow the new locale.
    protected void
    This method is a fix for a Webstart bug - see: http://forum.java.sun.com/thread.jspa?forumID=38&threadID=301640
    This method has to be implemented as a workaround for the known problem with webstart, that the class loader is set to null, if the console is deactivated.
    Returns the main application window.
    void
    performDefaultMainActions(String aSoftwareType, String aConfigurationLayoutProvider, boolean aStartApplication)
    Default start-up of the GUI application; has to be called in performMain() of the implementation.
    abstract void
    method that has to be implemented by real application.
    static void
    Exits application if user confirms shutdown.
    static void
    Exits application.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FWApplication

      public FWApplication()
      Creates the instance without any options
  • Method Details

    • performMain

      public abstract void performMain()
      method that has to be implemented by real application. This is called while starting application for initializing applicationspecific things. While implementing make shure to call 'performDefaultMainAcions'
    • getInstanceClassLoader

      public static ClassLoader getInstanceClassLoader()
      This method has to be implemented as a workaround for the known problem with webstart, that the class loader is set to null, if the console is deactivated.
      Returns:
      this class' class loader
    • performDefaultMainActions

      public void performDefaultMainActions(String aSoftwareType, String aConfigurationLayoutProvider, boolean aStartApplication)
      Default start-up of the GUI application; has to be called in performMain() of the implementation. Redirects System.out/System.err to the log, sets the look and feel, reads the layout configuration aConfigurationLayoutProvider.xml from the classpath, creates the main frame and registers a shutdown hook deleting the temporary directories.
      Parameters:
      aSoftwareType - name of the software, set as system property SoftwareType
      aConfigurationLayoutProvider - name of the layout configuration file on the classpath (without .xml)
      aStartApplication - true to show the main frame and run the autostart function
    • fixWebStartClassLoaderIssue

      protected void fixWebStartClassLoaderIssue()
      This method is a fix for a Webstart bug - see: http://forum.java.sun.com/thread.jspa?forumID=38&threadID=301640
    • applyLanguage

      public static void applyLanguage(String aLocalization)
      Switches the language of the GUI: sets the default language of the LocaleProvider and reinitialises the Swing look and feel, so that the standard Swing texts follow the new locale.
      Parameters:
      aLocalization - locale string; only the first two characters (language code) are used, e.g. de_DE
    • requestShutdown

      public static void requestShutdown()
      Exits application if user confirms shutdown.
    • shutdown

      public static void shutdown()
      Exits application.
    • getMainFrame

      public static FWMainFrame getMainFrame()
      Returns the main application window.
      Returns:
      main Frame