package Test;

import API.Etudiant;
import API.Groupe;

import java.awt.*;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class AdminView extends JPanel {
    private final Controller listener;

    public AdminView(Controller listener) {
        super();
        this.setLayout(new GridBagLayout());
        this.listener = listener;

        Display();
    }

    public void Display() {
        BLayout settings = new BLayout();
        settings.setPositionX(0);

        settings.setPositionY(0);
        CustomJButton studList = new CustomJButton("Voir la liste des étudiants");
        studList.setActionCommand("pv::GetStudList");
        studList.addActionListener(this.listener);
        this.add(studList, settings);

        settings.setPositionY(1);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(2);
        CustomJButton moveStudGrup = new CustomJButton("Changer le groupe d'un étudiant");
        moveStudGrup.addActionListener(this.listener);
        moveStudGrup.setActionCommand("av::MoveStudGrup");
        this.add(moveStudGrup, settings);

        settings.setPositionY(3);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(4);
        CustomJButton addStudGrup = new CustomJButton("Ajouter un étudiant dans un groupe");
        addStudGrup.addActionListener(this.listener);
        addStudGrup.setActionCommand("av::AddStudGrup");
        this.add(addStudGrup, settings);

        settings.setPositionY(5);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(6);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(7);
        CustomJButton createGrup = new CustomJButton("Créer un groupe");
        createGrup.addActionListener(this.listener);
        createGrup.setActionCommand("av::CreateGrup");
        this.add(createGrup, settings);

        settings.setPositionY(8);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(9);
        CustomJButton renGrup = new CustomJButton("Renommer un groupe");
        renGrup.addActionListener(this.listener);
        renGrup.setActionCommand("av::renameGrup");
        this.add(renGrup, settings);

        settings.setPositionY(10);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(11);
        CustomJButton delGrup = new CustomJButton("Supprimer un groupe");
        delGrup.addActionListener(this.listener);
        delGrup.setActionCommand("av::delGrup");
        this.add(delGrup, settings);

        settings.setPositionY(12);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(13);
        this.add(new JLabel(" "), settings);

        settings.setPositionY(14);
        CustomJButton showRequest = new CustomJButton("Consulter les requetes");
        showRequest.addActionListener(this.listener);
        showRequest.setActionCommand("av::ShowRequestFromStudent");
        this.add(showRequest, settings);

        this.repaint();
    }
}
