package Vue;
import java.awt.Color;
import java.util.Vector;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;

import Controleurs.EcouteurConnexion;
import Modèle.Groupe;
import Modèle.Utilisateur;


public class log 
{
	public log(boolean connect,Vector <Groupe> groupes,Utilisateur utilCourant)
	{	JFrame jf = new JFrame("Connexion");
		jf.setSize(500, 250);
		jf.setLayout(null);
		jf.setResizable(false);
		jf.setLocationRelativeTo(null);

		JPanel jp= new JPanel();
		jp.setLayout(null);
		jp.setLocation(110,39);
		jp.setSize(300,160);
		
		jf.add(jp);
		
		LineBorder border = new LineBorder(Color.blue);
		jp.setBorder(BorderFactory.createTitledBorder(border,"Connexion"));
		
		//jf.setIconImage(new ImageIcon("image/21845.png").);
	
		/* barre de menu 
		
		JMenuBar m = new JMenuBar();
		JMenu menu = new JMenu("Fichier");
		
		*/
		
		/* label */
		
		JLabel label = new JLabel("Login :", JLabel.RIGHT);
		label.setLocation(10,25);
		label.setSize(100,35);
		jp.add(label);
		
		JLabel label1 = new JLabel("Mot de passe :", JLabel.RIGHT);
		label1.setLocation(10,65);
		label1.setSize(100,35);
		jp.add(label1);
		
		JLabel label2 = new JLabel("aaaaaaaaaa", JLabel.CENTER);
		label2.setLocation(15,10);
		label2.setSize(250,20);
		label2.setForeground(new Color(255,0,0));
		jp.add(label2);
		
		ImageIcon icone = new ImageIcon("images/eisti.png");
		JLabel image = new JLabel(icone);
		image.setLocation(0,39);
		image.setSize(75,100);
		jf.add(image);
		
		
		/* textField */
		
		JTextField tf = new JTextField("");
		tf.setLocation(125,30);
		tf.setSize(100,25);
		jp.add(tf);
		
	
		JPasswordField pf1 = new JPasswordField("");
		pf1.setLocation(125,70);
		pf1.setSize(100,25);
		jp.add(pf1);
		
		
		/* Bouton */
		
		JButton bouton = new JButton("Connexion");
		bouton.setLocation(100,115);
		bouton.setSize(100,30);
		bouton.addActionListener(new EcouteurConnexion(tf,pf1,label2,connect,groupes,utilCourant));
		jp.add(bouton);
	
				
				
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jf.setVisible(true);
				
	}		
}			
				
				
				
				