package Vue;


import java.awt.Choice;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;

import Controleurs.EcouteurRetourAccueil;

	public class Test2 extends JFrame{
		protected IHMAccueil ihm;

	public Test2(){
		this.ihm= ihm;


	/** Creation de la fenetre **/

	this.setSize(900, 850);
	this.setLocation(10,10);
    this.setLayout(null);
    this.setResizable(false);
	this.setLocationRelativeTo(null);

	/** Barre de menu **/

	JMenuBar m = new JMenuBar();
	JMenu menuu = new JMenu("A propos");
	JMenu menu = new JMenu("Fichier");
	JMenuItem item1 = new JMenuItem("Ouvrir");
	JMenuItem item2 = new JMenuItem("Quitter");
	JMenuItem item3 = new JMenuItem("Se déconnecter");
	menu.add(item1);
    menu.add(item2);
	menu.add(item3);
	m.add(menu);
	m.add(menuu);

	this.setJMenuBar(m);

	JPanel jp = new JPanel();
	jp.setLocation(0,0);
	jp.setSize(800,850); 
	jp.setLayout(null);
	LineBorder border = new LineBorder(Color.red);
	jp.setBorder(BorderFactory.createTitledBorder(border, "Actions"));

	

	JLabel label = new JLabel("<html><u>Ajout groupe</u></html> ");

	label.setSize(200, 100);
	label.setLocation(100, 100);
	jp.add(label);

	JTextField jtf1 = new JTextField();
	jtf1.setSize(200, 20);
	jtf1.setLocation(100, 200);
	jp.add(jtf1);
	
	JLabel label1= new JLabel("Nom:");
	label1.setSize(100, 20);
	label1.setLocation(45, 200);
	jp.add(label1);
	
	JComboBox cb = new JComboBox();
	cb.addItem("Lire");
	cb.addItem("Lire + Résoudre");
	cb.addItem("Lire + Résoudre + Modifier");
	cb.addItem("Lire + Résoudre + Modifier + supprimer");
	cb.setSize(250,20);
	cb.setLocation(75,250);
	jp.add(cb);
	
	JButton bouton = new JButton("Ajouter");
	bouton.setSize(150,25);
	bouton.setLocation(100,300);
	jp.add(bouton);

	JLabel l2 = new JLabel("<html><u> Ajout utilisateur</u></html> ");

	l2.setSize(200, 100);
	l2.setLocation(400, 100);
	jp.add(l2);

	JButton bouton2 = new JButton("Ajouter");
	bouton2.setSize(150, 25);
	bouton2.setLocation(400, 200);
	jp.add(bouton2);

	JLabel l3 = new JLabel("<html><u>Modifier groupe</u></html> ");

	l3.setSize(200, 100);
	l3.setLocation(100, 300);
	jp.add(l3);

	Choice c1 = new Choice();
	c1.addItem("CPI");
	c1.addItem("ING");
	c1.setSize(100, 20);
	c1.setLocation(75, 400);
	jp.add(c1);
	
	JComboBox cb2 = new JComboBox();
	cb2.addItem("Lire");
	cb2.addItem("Lire + Résoudre");
	cb2.addItem("Lire + Résoudre + Modifier");
	cb2.addItem("Lire + Résoudre + Modifier + supprimer");
	cb2.setSize(250,20);
	cb2.setLocation(75,450);
	jp.add(cb2);
	
	JButton bouton3 = new JButton("Modifier");
	bouton3.setSize(150, 25);
	bouton3.setLocation(100, 500);
	jp.add(bouton3);

	JLabel l4 = new JLabel("<html><u>Modifier utilisateur</u></html> ");
	l4.setSize(200, 100);
	l4.setLocation(400, 300);
	jp.add(l4);

	Choice c2 = new Choice();
	c2.addItem("Emilie");
	c2.addItem("Cynthia");
	c2.setSize(100, 20);
	c2.setLocation(400, 400);
	jp.add(c2);
	
	JButton bouton4 = new JButton("Modifier");
	bouton4.setSize(150, 25);
	bouton4.setLocation(400, 500);
	jp.add(bouton4);
	
	

	JLabel l5 = new JLabel("<html><u>Supprimer groupe</u></html> ");
	l5.setSize(150, 20);
	l5.setLocation(100, 575);
	jp.add(l5);

	Choice c3 = new Choice();

	c3.addItem("CPI");
	c3.addItem("ING");
	c3.setSize(100, 20);
	c3.setLocation(100, 600);
	jp.add(c3);

	JLabel l6 = new JLabel("<html><u>Supprimer utilisateur</u></html> ");
	l6.setSize(150, 20);
	l6.setLocation(400, 575);
	jp.add(l6);

	Choice c4 = new Choice();
	c4.addItem("Emilie");
	c4.addItem("Cynthia");
	c4.setSize(100, 20);
	c4.setLocation(400, 600);
	jp.add(c4);
	
	JButton b1 = new JButton("Supprimer");
	b1.setLocation(100, 700);
	b1.setSize(200, 30);
	jp.add(b1);
	
	JButton b2 = new JButton("Supprimer");
	b2.setLocation(400, 700);
	b2.setSize(200, 30);
	jp.add(b2);
	
	JButton b3 = new JButton("Retour à l'accueil");
	b3.addActionListener(new EcouteurRetourAccueil(ihm));
	b3.setLocation(600, 750);
	b3.setSize(200, 30);
	jp.add(b3);
	
	JPanel TFContrPanel=new JPanel();
	
	//Vector<JTextField> VectTFContr=new Vector<JTextField>();
	//JTextField jtf3 = new JTextField();
	//jtf3.setSize(150, 20);
	//jtf3.setPreferredSize(new Dimension (250,20));
	//jtf3.setLocation(10, 10);
	//VectTFContr.add(jtf3);
	//TFContrPanel.add(VectTFContr.get(0));
	
	TFContrPanel.setPreferredSize(new Dimension(200,1000));
	//TFContrPanel.setSize(500,10+75*VectTFContr.size());
	TFContrPanel.setBackground(Color.pink);
	add(TFContrPanel);
	JScrollPane scroll=new JScrollPane(TFContrPanel);
	scroll.setViewportView(TFContrPanel);
	jp.add(scroll);
	scroll.setBackground(Color.red);
	scroll.setLocation(700,25);
	scroll.setSize(150,675);
	//jp.add(TFContrPanel);

	/* JButton b1 = new JButton("Ajouter une contrainte");

	b1.addActionListener(new EcouteurAjoutContrainte(this,VectTFContr));

	b1.setLocation(80, 380);

	b1.setSize(200, 30);

	add(b1);

	JButton b2 = new JButton("Créer");

	//b2addActionListener(new EcouteurCreerProbleme());

	b2.setLocation(300, 450);

	b2.setSize(70, 70);

	add(b2);

	JButton b3 = new JButton("Retour à l'accueil");

	//b3.addActionListener(new EcouteurRetourAccueil());

	b3.setLocation(390, 550);

	b3.setSize(200, 30);

	add(b3);

	*/

	//jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	this.setContentPane(jp);
	this.setVisible(true);
	
	}

	public static void main( String[]args){

	Test2 ihm =new Test2();
	
	}

	}


