@param args the command line arguments
(String... args)
| 102 | * @param args the command line arguments |
| 103 | */ |
| 104 | public static void main(String... args) |
| 105 | { |
| 106 | Logging.log(Level.INFO, "Starting PCGen v" + PCGenPropBundle.getVersionNumber() //$NON-NLS-1$ |
| 107 | + PCGenPropBundle.getAutobuildString()); |
| 108 | |
| 109 | Thread.setDefaultUncaughtExceptionHandler(new LoggingUncaughtExceptionHandler()); |
| 110 | DeadlockDetectorTask deadlockDetectorTask = new DeadlockDetectorTask(new PCGenLoggingDeadlockHandler()); |
| 111 | deadlockDetectorTask.initialize(); |
| 112 | |
| 113 | logSystemProps(); |
| 114 | |
| 115 | commandLineArguments = parseCommands(args); |
| 116 | |
| 117 | configFactory = new PropertyContextFactory(getConfigPath()); |
| 118 | if (commandLineArguments.getConfigFileName().isPresent()) |
| 119 | { |
| 120 | configFactory.registerAndLoadPropertyContext( |
| 121 | ConfigurationSettings.getInstance(commandLineArguments.getConfigFileName().get())); |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance()); |
| 126 | } |
| 127 | |
| 128 | if (commandLineArguments.isStartNameGenerator()) |
| 129 | { |
| 130 | Component dialog = new RandomNameDialog(null, null); |
| 131 | dialog.setVisible(true); |
| 132 | GracefulExit.exit(0); |
| 133 | } |
| 134 | |
| 135 | if (commandLineArguments.getExportSheet().isEmpty()) |
| 136 | { |
| 137 | startupWithGUI(); |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | shutdown(startupWithoutGUI()); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | private static String getConfigPath() |
| 146 | { |