User Tools

Site Tools


struktura:marklar-core:startaplikace

Start Aplikace

Samotna aplikace je spoustena tridou StandardFadeApp, ktera je v marklar-fx-common. Tato trida provadi inicializaci jadra pri soucasnem zobrazeni splash screenu. Jakmile je jadro inicializovano, zobrazi se grafika cele aplikace (StandardLayoutControler).

Inicializace jadra probha v nasledujicich krocich

  1. Vytvori se instance jadra
    Core core = new Core() 
  2. Jadro inicializuje konfiguracni servicy, kterym preda parametry z prikazove radky
    ConfigurationService conf = core.initConfiguration(savedArgs) 
  3. StandardFadeApp si vyzada ConfigurationInitializer (metoda getConfigurationInitializer musi byt implementovana).
    ConfigurationInitializer ci = getConfigurationInitializer() 

    kde ConfigurationInitializer je jednoduchy interface, ktery inicializuje instrumenty a jazyk

    public interface ConfigurationInitializer {
      public List<Instrument> initInstruments();
      public void initLanguage();
    }
  4. Inicializace samotneho jadra
    core.initializeCore(ci, conf);
public void initializeCore(ConfigurationInitializer configurationInitializer, ConfigurationService configService) throws Exception {
  // inicializace vsech service
  ServiceLocator.getInstance().initializeServices(configService);
 
  // z konfiguracniho souboru se nacte jazyk a do graphics a msg bundelu se pridaji baliky spolecne pro vsechny appky
  Locale.setDefault(ServiceLocator.getInstance().getConfigurationService().getConfigFileService().getLanguage());
  I18n.getGraphicsBundle().addBundle(ResourceBundle.getBundle("cz.jlochman.marklar.fxcommon.bundles.FXcommon"));
  I18n.getMsgBundle().addBundle(ResourceBundle.getBundle("cz.jlochman.marklar.fxcommon.bundles.FXcommonMessages"));
  // graphics a msg bundle se rozsiri o potreby aplikace
  configurationInitializer.initLanguage();
 
  // inicializace instrumentu
  ServiceLocator.getInstance().getInstrumentService().initInstruments(configurationInitializer);
  // inicializace ExperimentType
  List<Instrument> instruments = ServiceLocator.getInstance().getInstrumentService().getInstrumentList();
  ServiceLocator.getInstance().getExperimentService().initExperimentTypes(instruments);
}
struktura/marklar-core/startaplikace.txt · Last modified: 2016/07/20 09:53 by jlochman