package GUI;

import ij.ImagePlus;

import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;

import javax.swing.*;

import com.sun.org.apache.bcel.internal.generic.IINC;

import java.awt.*;

import java.util.*;

import GUI.internalFrame;
import GUI.menu;

public class mainWindow extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;
	
	private menu mainMenu;
	//public static internalFrame[] intFrame;
	//public static internalFrame[] intFrameResult;
	public static JDesktopPane desktop;
	public static int numberOpenImages = 0;
	public static int numberImages = 0;
	public static JProgressBar progressBar;
	
	public static ArrayList intFrameArrayList = new ArrayList();
	
	public static internalFrame intFrameProgressBar;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				mainWindow thisClass = new mainWindow();
				thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				thisClass.setVisible(true);
			}
		});
		
	}


	/**
	 * This is the default constructor
	 */
	public mainWindow() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		
		progressBar = new JProgressBar(0, 1000);
		progressBar.setMinimum(0);
		progressBar.setMaximum(100);
		progressBar.setValue(0);
		progressBar.setStringPainted(true);
		progressBar.setValue(343);

		
		this.setSize(800, 600);
		this.setContentPane(getJContentPane());
		this.setTitle("Adel");
	//	intFrame = new internalFrame[60];
		//intFrameResult = new internalFrame[10];
		desktop = new JDesktopPane();
		desktop.setOpaque(false);
		desktop.setBackground(Color.GRAY);
		
		
		add(desktop);
		mainMenu = new menu();
		this.add(mainMenu.jmenuBar, BorderLayout.NORTH);
		

		//this.add(intFrameProgressBar);
		
	    try {
	        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
	    } catch(Exception e) {
	        System.out.println("Error setting Motif LAF: " + e);
	    }		
		
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
		}
		return jContentPane;
	}

}
