package client.view.Probleme;

import java.awt.Color;

import javax.swing.JPanel;

import client.control.probleme.ControleurComboBoxMethode;

/** <u><b>Explication générale de la classe :</b></u>
 * <P>Cette classe permet de créer dans l'onglet PanelProbleme, le panel probleme contenant tout les autres
 * petits panels tel que PanelChoixProbleme
 *
 * @author Dream Team - ING2
 */
public class PanelProbleme extends JPanel {

    //Déclaration des variables
    private PanelChoixProbleme panChoixPb;
    private PanelCreerProbleme panCreerPb;
    private PanelConsulterProbleme panConsultPb;
    private PanelModifierProbleme panModifPb;
    private PanelExecuterProbleme panExecPb;

    /**<u><i>Explication générale du constructeur :</i></u>
     * <P> Constructeur de la classe permettant de créer un panel PanelProbleme
     *
     */
    public PanelProbleme() {

        this.setBackground(new Color(234, 232, 233));
        this.setLayout(null);

        //Panel du choix des problèmes
        panChoixPb = new PanelChoixProbleme();
        panChoixPb.setLayout(null);
        panChoixPb.setBounds(0, 0, 250, 450);
        add(panChoixPb);

        //Panel de création des problèmes
        panCreerPb = new PanelCreerProbleme();
        panCreerPb.setLayout(null);
        panCreerPb.setBounds(0, 0, 750, 450);
        panCreerPb.setVisible(false);
        add(panCreerPb);

        //Panel pour consulter des problèmes
        panConsultPb = new PanelConsulterProbleme();
        panConsultPb.setLayout(null);
        panConsultPb.setBounds(255, 0, 500, 450);
        panConsultPb.setVisible(false);
        add(panConsultPb);

        //Panel d'exécution des problèmes
        panExecPb = new PanelExecuterProbleme();
        panExecPb.setLayout(null);
        panExecPb.setBounds(255, 0, 500, 450);
        panExecPb.setVisible(false);
        panExecPb.getMethodes().addActionListener(new ControleurComboBoxMethode());
        add(panExecPb);

        //Panel de modification des problèmes
        panModifPb = new PanelModifierProbleme();
        panModifPb.setLayout(null);
        panModifPb.setBounds(0, 0, 750, 450);
        panModifPb.setVisible(false);
        add(panModifPb);
    }

    /**<u><i>Explication de la méthode :</i></u>
     * <P> Cette méthode retourne le panel de la classe PanelConsulterProbleme.
     * <P>
     * @return le panel panConsulterPb
     */
    public PanelConsulterProbleme getPanConsultPb() {
        return panConsultPb;
    }

    /**<u><i>Explication de la méthode :</i></u>
     * <P> Cette méthode retourne le panel de la classe PanelCreerProbleme.
     * <P>
     * @return le panel panCreerPb
     */
    public PanelCreerProbleme getPanCreerPb() {
        return panCreerPb;
    }

    /**<u><i>Explication de la méthode :</i></u>
     * <P> Cette méthode retourne le panel de la classe PanelModifierProbleme.
     * <P>
     * @return le panel panModifPb
     */
    public PanelModifierProbleme getPanModifPb() {
        return panModifPb;
    }

    /**<u><i>Explication de la méthode :</i></u>
     * <P> Cette méthode retourne le panel de la classe PanelChoixProbleme.
     * <P>
     * @return le panel panChoixPb
     */
    public PanelChoixProbleme getPanChoixPb() {
        return panChoixPb;
    }

    /**<u><i>Explication de la méthode :</i></u>
     * <P> Cette méthode retourne le panel d'exécution des problèmes
     * <P>
     * @return le panel panChoixPb
     */
    public PanelExecuterProbleme getPanExecPb() {
        return panExecPb;
    }

}
