2023-04-18 12:29:43 +02:00
|
|
|
import java.awt.*;
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
public class OptionsFVG extends Fenetre {
|
|
|
|
public JRadioButton radio1;
|
|
|
|
public JRadioButton radio2;
|
|
|
|
public JRadioButton radio3;
|
2023-04-18 18:38:32 +02:00
|
|
|
private FenetreVideGrille ce_fvg;
|
2023-04-18 12:29:43 +02:00
|
|
|
|
2023-04-18 18:38:32 +02:00
|
|
|
public OptionsFVG(FenetreVideGrille un_fvg) {
|
2023-04-18 12:29:43 +02:00
|
|
|
super();
|
|
|
|
this.fenetre.setSize(400, 600);
|
|
|
|
this.fenetre.setLocation(1100, 200);
|
2023-04-18 18:38:32 +02:00
|
|
|
this.ce_fvg=un_fvg;
|
2023-04-18 12:29:43 +02:00
|
|
|
}
|
|
|
|
|
2023-04-18 18:38:32 +02:00
|
|
|
protected void SetUp(){
|
2023-04-18 12:29:43 +02:00
|
|
|
GridLayout gestionnaire = new GridLayout(4,1);
|
|
|
|
this.fenetre.setLayout(gestionnaire);
|
|
|
|
|
|
|
|
/* Création du premier panneau */
|
|
|
|
|
|
|
|
JLabel un_d_text = new JLabel(" Etape 1 : création du labyrinthe");
|
|
|
|
|
|
|
|
JPanel un_Panel = new JPanel();
|
|
|
|
un_Panel.setBackground(Color.CYAN);
|
|
|
|
|
|
|
|
un_Panel.add(un_d_text, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
JPanel un_Panel2 = new JPanel();
|
|
|
|
un_Panel2.setBackground(Color.CYAN);
|
|
|
|
un_Panel2.setLayout(new BoxLayout(un_Panel2, BoxLayout.Y_AXIS));
|
|
|
|
un_Panel2.add(Box.createVerticalGlue());
|
|
|
|
un_Panel2.add(un_Panel);
|
|
|
|
un_Panel2.add(Box.createVerticalGlue());
|
|
|
|
|
|
|
|
this.fenetre.add(un_Panel2, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
/*Création du deuxième panneau */
|
|
|
|
|
|
|
|
JPanel un_Panel3 = new JPanel();
|
2023-04-18 18:38:32 +02:00
|
|
|
JButton un_Button1 = new JButton("Sauvegarder");
|
2023-04-18 12:29:43 +02:00
|
|
|
|
|
|
|
JPanel un_Panel4 = new JPanel();
|
|
|
|
un_Panel4.add(un_Button1);
|
|
|
|
|
|
|
|
un_Panel3.setBackground(Color.CYAN);
|
|
|
|
un_Panel4.setBackground(Color.CYAN);
|
|
|
|
|
|
|
|
un_Panel3.setBackground(Color.CYAN);
|
|
|
|
un_Panel3.setLayout(new BoxLayout(un_Panel3, BoxLayout.Y_AXIS));
|
|
|
|
un_Panel3.add(Box.createVerticalGlue());
|
|
|
|
un_Panel3.add(un_Panel4);
|
|
|
|
un_Panel3.add(Box.createVerticalGlue());
|
|
|
|
|
|
|
|
this.fenetre.add(un_Panel3, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
/* Nouveau panneau grille choix */
|
|
|
|
|
|
|
|
JPanel un_Panel10 = new JPanel();
|
|
|
|
JPanel un_Panel11 = new JPanel();
|
|
|
|
|
|
|
|
radio1 = new JRadioButton("Mur et Couloir");
|
|
|
|
radio2 = new JRadioButton("Entrée");
|
|
|
|
radio3 = new JRadioButton("Sortie");
|
|
|
|
|
|
|
|
radio1.setBackground(Color.CYAN);
|
|
|
|
radio2.setBackground(Color.CYAN);
|
|
|
|
radio3.setBackground(Color.CYAN);
|
|
|
|
|
|
|
|
radio1.setSelected(true);
|
|
|
|
|
|
|
|
ButtonGroup group = new ButtonGroup();
|
|
|
|
group.add(radio1);group.add(radio2); group.add(radio3);
|
|
|
|
|
|
|
|
un_Panel11.add(radio1);
|
|
|
|
un_Panel11.add(radio2);
|
|
|
|
un_Panel11.add(radio3);
|
|
|
|
|
|
|
|
un_Panel10.setBackground(Color.CYAN);
|
|
|
|
un_Panel10.setLayout(new BoxLayout(un_Panel10, BoxLayout.Y_AXIS));
|
|
|
|
un_Panel10.add(Box.createVerticalGlue());
|
|
|
|
un_Panel10.add(un_Panel11);
|
|
|
|
un_Panel10.add(Box.createVerticalGlue());
|
|
|
|
|
|
|
|
|
|
|
|
un_Panel10.setBackground(Color.CYAN);
|
|
|
|
un_Panel11.setBackground(Color.CYAN);
|
|
|
|
this.fenetre.add(un_Panel10, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
/*Création du deuxième panneau */
|
|
|
|
|
|
|
|
JPanel un_Panel5 = new JPanel();
|
|
|
|
JButton un_Button2 = new JButton("Quitter");
|
|
|
|
|
|
|
|
JPanel un_Panel6 = new JPanel();
|
|
|
|
un_Panel6.add(un_Button2, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
un_Panel5.setBackground(Color.CYAN);
|
|
|
|
un_Panel6.setBackground(Color.CYAN);
|
|
|
|
|
|
|
|
un_Panel5.setBackground(Color.CYAN);
|
|
|
|
un_Panel5.setLayout(new BoxLayout(un_Panel5, BoxLayout.Y_AXIS));
|
|
|
|
un_Panel5.add(Box.createVerticalGlue());
|
|
|
|
un_Panel5.add(un_Panel6);
|
|
|
|
un_Panel5.add(Box.createVerticalGlue());
|
|
|
|
|
|
|
|
this.fenetre.add(un_Panel5, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
2023-04-18 18:38:32 +02:00
|
|
|
OptionsBoutonsFVG ces_options = new OptionsBoutonsFVG(this.ce_fvg);
|
|
|
|
un_Button1.addActionListener(ces_options);
|
|
|
|
un_Button2.addActionListener(ces_options);
|
2023-04-18 12:29:43 +02:00
|
|
|
|
|
|
|
/* Evenement */
|
|
|
|
|
|
|
|
this.fenetre.setVisible(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected JRadioButton GetButtonBW() {
|
|
|
|
return radio1;
|
|
|
|
}
|
|
|
|
protected JRadioButton GetButtonE() {
|
|
|
|
return radio2;
|
|
|
|
}
|
|
|
|
protected JRadioButton GetButtonS() {
|
|
|
|
return radio3;
|
|
|
|
}
|
|
|
|
}
|