+ /**\r
+ * Enables console client by setting propper flag\r
+ */\r
+ private void enableConsoleClient () {\r
+ this.getLogger().debug("Enabling console client (may become optional client) ...");\r
+ this.consoleClient = true;\r
+ this.guiClient = false;\r
+ }\r
+\r
+ /**\r
+ * Enables GUI client by setting propper flag\r
+ */\r
+ private void enableGuiClient () {\r
+ this.getLogger().debug("Enabling GUI client (may become new default client) ...");\r
+ this.consoleClient = false;\r
+ this.guiClient = true;\r
+ }\r
+\r
+ /**\r
+ * Checks whether the client shoule be console client should be launched by\r
+ * checking if -console is set.\r
+ * \r
+ * @return Whether console client should be taken\r
+ */\r
+ private boolean isConsole () {\r
+ return this.consoleClient;\r
+ }\r
+\r
+ /**\r
+ * Checks whether the client shoule be GUI client should be launched by\r
+ * checking if -gui is set.\r
+ * \r
+ * @return Whether GUI client should be taken\r
+ */\r
+ private boolean isGui () {\r
+ return this.guiClient;\r
+ }\r
+\r
+ /**\r
+ * Parses all given arguments\r
+ *\r
+ * @param args Arguments from program launch\r
+ */\r
+ private void parseArguments (final String[] args) {\r
+ // Debug message\r
+ this.getLogger().debug(MessageFormat.format("Parsing {0} arguments ...", args.length));\r
+ \r
+ for (final String arg : args) {\r
+ // Switch on it\r
+ switch (arg) {\r
+ case "-console":\r
+ enableConsoleClient();\r
+ break;\r
+ \r
+ case "-gui":\r
+ enableGuiClient();\r
+ break;\r
+}\r
+ }\r
+ }\r
+\r