pluginsMap.put(infoDataModel, infoPanel);
//menu
setSplashStep(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Building menus.."));
Environment environment = new Environment(pluginsMap, treePanel);
SaveEnvironmentAction saveAction = new SaveEnvironmentAction(environment, this);
LoadEnvironmentAction loadAction = new LoadEnvironmentAction(environment, this);
exitMediator = new ApplicationExitMediator(new ApplicationCloser(this));
getRootPane().setJMenuBar(new JMainMenuBar(saveAction, loadAction, exitMediator));
//buttons bar
setSplashStep(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Building buttons bar.."));
buttonsPanel = new JButtonsPanel(saveAction, loadAction, exitMediator, new LogActionListener());
getContentPane().add(buttonsPanel,BorderLayout.PAGE_START);
//set up check for updates mediator
updateMediator = new UpdateCheckerMediator(statusPanel);
if(Configuration.getInstance().isCheckForUpdates()){
updateMediator.checkForUpdates(5000, false);
}
settingsPanel.setCheckUpdateMediator(updateMediator);
//final set up
mainScrollPanel = new JScrollPane(mainPanel);
mainScrollPanel.setMinimumSize(new Dimension(100, 400));
logPanel = new JLogPanel();
horizSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePanel, mainScrollPanel);
horizSplitPane.setOneTouchExpandable(true);
horizSplitPane.setDividerLocation(155);
verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, horizSplitPane,logPanel);
verticalSplitPane.setOneTouchExpandable(true);
verticalSplitPane.setResizeWeight(1.0);
verticalSplitPane.setDividerLocation(0.75);
//load the default env if set
String defaultEnvString = Configuration.getInstance().getDefaultEnvironment();
if(defaultEnvString!=null && defaultEnvString.length()>0){
File defaultEnv = new File(defaultEnvString);
if(defaultEnv != null && defaultEnv.exists() && defaultEnv.isFile()){
log.info(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Loading default environment."));
environment.loadJobs(defaultEnv);
}
}
getContentPane().add(verticalSplitPane,BorderLayout.CENTER);
setSize(640, 480);