/*******************************************************************************
 * DISCLAIMER: The sample code or utility or tool described herein
 *    is provided on an "as is" basis, without warranty of any kind.
 *    UIDAI does not warrant or guarantee the individual success
 *    developers may have in implementing the sample code on their
 *    environment. 
 *    
 *    UIDAI does not warrant, guarantee or make any representations
 *    of any kind with respect to the sample code and does not make
 *    any representations or warranties regarding the use, results
 *    of use, accuracy, timeliness or completeness of any data or
 *    information relating to the sample code. UIDAI disclaims all
 *    warranties, express or implied, and in particular, disclaims
 *    all warranties of merchantability, fitness for a particular
 *    purpose, and warranties related to the code, or any service
 *    or software related thereto. 
 *    
 *    UIDAI is not responsible for and shall not be liable directly
 *    or indirectly for any direct, indirect damages or costs of any
 *    type arising out of use or any action taken by you or others
 *    related to the sample code.
 *    
 *    THIS IS NOT A SUPPORTED SOFTWARE.
 ******************************************************************************/

package in.gov.uidai.tools;

import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * @author Anujit
 * 
 */
public class Launcher {

	public static void main(final String args[]) {

		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (UnsupportedLookAndFeelException e) {
		} catch (ClassNotFoundException e) {
		} catch (InstantiationException e) {
		} catch (IllegalAccessException e) {
		}

		if (args.length == 1 && Integer.parseInt(args[0]) <= 7) {
			java.awt.EventQueue.invokeLater(new Runnable() {
				public void run() {
					try {
						ToolsFrame frame = new ToolsFrame(Integer.parseInt(args[0]));
						frame.setVisible(true);
						frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
						frame.setSize(1024, 600);
					} catch (URISyntaxException ex) {
						Logger.getLogger(ToolsFrame.class.getName()).log(Level.SEVERE, null, ex);
					}
				}
			});
		} else {
			java.awt.EventQueue.invokeLater(new Runnable() {
				public void run() {
					try {
						ToolsFrame frame = new ToolsFrame(0);
						frame.setVisible(true);
						frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
						frame.setSize(1024, 600);
					} catch (URISyntaxException ex) {
						Logger.getLogger(ToolsFrame.class.getName()).log(Level.SEVERE, null, ex);
					}
				}
			});
		}
	}
}
