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 ArrayList<Etudiant> e;
    private final ArrayList<Groupe> g;
    private final Controller listener;

    public AdminView(ArrayList<Etudiant> e, ArrayList<Groupe> g, Controller listener) {
        super();

        this.setLayout(new GridBagLayout());

        this.listener = listener;
        this.g = g;
        this.e = e;

        Display();
    }

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

        settings.setPositionY(0);
        JButton moveStudGrup = new JButton("Changer le groupe d'un etudiant");
        moveStudGrup.addActionListener(this.listener);
        moveStudGrup.setActionCommand("av::MoveStudGrup");
        this.add(moveStudGrup, settings);

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

        settings.setPositionY(2);
        JButton addStudGrup = new JButton("Ajouter un etudiant dans un groupe");
        addStudGrup.addActionListener(this.listener);
        addStudGrup.setActionCommand("av::AddStudGrup");
        this.add(addStudGrup, settings);

        this.repaint();
    }
}
