package com.alexrnl.subtitlecorrector;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.logging.Logger;

import com.alexrnl.commons.error.ExceptionUtils;
import com.alexrnl.subtitlecorrector.gui.controller.MainWindowController;
import com.alexrnl.subtitlecorrector.gui.model.MainWindowModel;
import com.alexrnl.subtitlecorrector.gui.view.GraphicUserPrompt;
import com.alexrnl.subtitlecorrector.gui.view.MainWindowView;

/**
 * GUI application for correcting subtitles.<br />
 * @author Alex
 */
public final class GUIApp extends AbstractApp {
	/** Logger */
	private static final Logger	LG	= Logger.getLogger(GUIApp.class.getName());
	
	/**
	 * Constructor #1.<br />
	 * @param args
	 *        the arguments from the command line.
	 * @throws IOException
	 *         if a resource cannot be loaded.
	 * @throws URISyntaxException
	 *         if the path of the translation file cannot be build.
	 */
	public GUIApp (final List<String> args) throws IOException, URISyntaxException {
		super(new GraphicUserPrompt());
	}
	
	@Override
	public boolean launch () {
		LG.info("Subtitle Corrector starting...");
		
		// Load MVC
		final MainWindowController controller = new MainWindowController(this);
		final MainWindowModel model = new MainWindowModel();
		final MainWindowView view = new MainWindowView(null, controller, getTranslator());
		controller.addModel(model);
		controller.addView(view);
		
		synchronized (view) {
			try {
				while (!view.isReady()) {
					view.wait();
				}
			} catch (final InterruptedException e) {
				LG.warning("Main thread interrupted while waiting for GUI building: " + ExceptionUtils.display(e));
			}
		}
		view.setVisible(true);
		
		LG.info("Subtitle Corrector running");
		return true;
	}
	
}

@@ -165,43 +165,143 @@
 ort 
-com.alexrnl.commons.error.Exception
+javax.swing.plaf.nimbus.NimbusLookAndFeel;%0A%0Aimport com.alexrnl.commons.error.ExceptionUtils;%0Aimport com.alexrnl.commons.gui.swing.Swing
 Util
@@ -1165,16 +1165,80 @@
 mpt());%0A
+%09%09SwingUtils.setLookAndFeel(new NimbusLookAndFeel().getName());%0A
 %09%7D%0A%09%0A%09@O
@@ -1614,41 +1614,16 @@
 %0A%09%09%0A
-%09%09synchronized (view) %7B%0A%09
 %09%09try %7B%0A
 %09%09%09%09
@@ -1618,17 +1618,16 @@
 %09%09try %7B%0A
-%09
 %09%09%09while
@@ -1643,24 +1643,50 @@
 sReady()) %7B%0A
+%09%09%09%09synchronized (view) %7B%0A
 %09%09%09%09%09view.wa
@@ -1701,16 +1701,20 @@
 %09%09%7D%0A%09%09%09%7D
+%0A%09%09%7D
  catch (
@@ -1745,17 +1745,16 @@
 on e) %7B%0A
-%09
 %09%09%09LG.wa
@@ -1848,21 +1848,16 @@
 ay(e));%0A
-%09%09%09%7D%0A
 %09%09%7D%0A%09%09vi

Use Nimbus LAF instead of metal