package am;

import am.app.Core;
import am.batchMode.TrackDispatcher;
import am.userInterface.UI;

/**
 * Main class -
 *
 * This class creates an instance of UI class
 *
 * @author ADVIS Research Laboratory
 * @version 11/27/2004
 */
public class Main
{
	
	/*******************************************************************************************/
	/**
	 * This is the main function
	 * It creates a new instance of UI class
	 * 
	 * @param  args array of strings
	 */
	public static void main(String args[])
	{
		if(args.length == 0 ){
			//UI ui;
			UI ui = new UI();
			Core.getInstance().setUI(ui);
		}
		else{
			String track = args[0];
			String subTrack = "";
			if(args.length > 1){
				subTrack = args[1];
			}
			TrackDispatcher.dispatchTrack(track, subTrack);
		}
	}
}


@@ -1,14 +1,631 @@
-package am
+/**    ________________________________________%0D%0A * ___/ Copyright Notice / Warranty Disclaimer %5C________________%0D%0A *%0D%0A * @copyright %7B Copyright (c) 2010%0D%0A * Advances in Information Systems Laboratory at the%0D%0A * University of Illinois at Chicago%0D%0A * All Rights Reserved. %7D%0D%0A * %0D%0A * @disclaimer %7B%0D%0A * This work is distributed WITHOUT ANY WARRANTY;%0D%0A * without even the implied warranty of MERCHANTABILITY or%0D%0A * FITNESS FOR A PARTICULAR PURPOSE. %7D%0D%0A * %0D%0A *     _____________________%0D%0A * ___/ Authors / Changelog %5C___________________________________          %0D%0A * %0D%0A *  %0D%0A */%0D%0A%0D%0A%0D%0Apackage am;%0D%0A%0D%0Aimport javax.swing.SwingUtilities
 ;%0D%0A%0D
@@ -886,184 +886,83 @@
 %7B%0D%0A%09
-%0D%0A%09/*******************************************************************************************/%0D%0A%09/**%0D%0A%09 * This is the main function%0D%0A%09 * It creates a new instance of UI class
+/**%0D%0A%09 * This is the application entry point.%0D%0A%09 * It creates instantiates.
 %0D%0A%09 
@@ -980,152 +980,439 @@
 ram 
- 
 args 
-array of strings%0D%0A%09 */%0D%0A%09public static void main(String args%5B%5D)%0D%0A%09%7B%0D%0A%09%09if(args.length == 0 )%7B%0D%0A%09%09%09//UI ui;%0D%0A%09%09%09UI ui = new UI();%0D%0A
+Command line arguments, used for operating AgreementMaker in automatic mode, without a UI.%0D%0A%09 */%0D%0A%09public static void main(String args%5B%5D)%0D%0A%09%7B%0D%0A%09%09if(args.length == 0 )%7B%0D%0A%09%09%09// Proper way of intializing the UI.%0D%0A%09%09%09// Reference: http://java.sun.com/developer/technicalArticles/javase/swingworker/ (Starting off on the Right Thread)%0D%0A%09%09%09SwingUtilities.invokeLater( %0D%0A%09%09%09%09%09new Runnable() %7B%0D%0A%09%09%09%09%09%09public void run() %7B%0D%0A%09%09%09%09
 %09%09%09Core.
 getI
@@ -1411,30 +1411,49 @@
 ore.
-getInstance().setUI(ui
+setUI( new UI() );%0D%0A%09%09%09%09%09%09%7D %0D%0A%09%09%09%09%09%7D%0D%0A%09%09%09
 );%0D%0A

Initialize the UI in the Event Dispatching Thread.