View Javadoc

1   /**
2    * This program is free software: you can redistribute it and/or modify
3    * it under the terms of the GNU General Public License as published by
4    * the Free Software Foundation, version 3.
5    *
6    * This program is distributed in the hope that it will be useful,
7    * but WITHOUT ANY WARRANTY; without even the implied warranty of
8    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9    * GNU General Public License for more details.
10   *
11   * You should have received a copy of the GNU General Public License
12   * along with this program. If not, see <http://www.gnu.org/licenses/>.
13   */
14  
15  package net.curre.prefcount;
16  
17  import net.curre.prefcount.bean.Settings;
18  import net.curre.prefcount.gui.MainWindow;
19  import net.curre.prefcount.service.SettingsService;
20  import net.curre.prefcount.util.Utilities;
21  import net.curre.prefcount.util.mac.MacOsHandler;
22  
23  /**
24   * Object of this class represents the driver
25   * to run the PrefCount application.
26   * <p/>
27   * Created date: May 4, 2007
28   *
29   * @author Yevgeny Nyden
30   */
31  public class App {
32  
33    /**
34     * Main method to run the PrefCount application.
35     *
36     * @param args Argument array.
37     */
38    public static void main(String[] args) {
39  
40      // for Mac OS, moving menu to the top and initializing Mac helper class
41      if (Utilities.isMacOs()) {
42        System.setProperty("apple.laf.useScreenMenuBar", "true");
43        System.setProperty("com.apple.eawt.CocoaComponent.CompatibilityMode", "false");
44        MacOsHandler.initializeMacOsHandler();
45      }
46  
47      Settings settings = SettingsService.getSettings();
48      PrefCountRegistry.getInstance().setCurrentLocale(settings.getLocaleId());
49      PrefCountRegistry.getInstance().setMainWindow(new MainWindow());
50    }
51  
52  }