Home
Categories
Dictionary
Download
Project Details
Changes Log
Tutorials
FAQ
License

Application initialization



The constructor of a MDIApplication allows to configure the content of the application, including:

Command-line arguments

Main Article: Command-line framework

The framework provides a framework to take into account the command-line arguments:
  • The LauncherConf class is a very simple class which allows to parse the command-line arguments and return a key-value maps of arguments
  • The Command-line framework is a much more elaborate framework allowing to take into account the command-line arguments which are managed by the application and each Plugin

Initialization order

The order of the initialization is the following:

Example

  public class MyApplication extends AbstractMDIApplication {
    public MyApplication() {  
      super("MyApplication");
      conf = AppliConfiguration.getInstance();
      
      // specify the Plugins directory
      pluginsDir = new File(System.getProperty("user.dir"));
      pluginsDir = new File(pluginsDir, "dist/plugins");
      this.setPluginsConfiguration(pluginsDir, null);       

      // initialize configuration with Preferences
      pref = Preferences.userRoot();
      this.initConfiguration(pref, null);
      
      // register the Plugins
      this.registerPlugins();
      
      // create the application panels
      mfactory = new SimpleMenuFactory();
      super.preparePanels(4, true, true, mfactory);
      
      // set the size of the Application window
      this.setSize(500, 500);
    }  
  }    

See also


Categories: conf | general | javafx | swing

Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences