2022-04-20 00:33:31 +02:00
|
|
|
//Tom Monin et Clément Martins
|
|
|
|
// observateurChoix V1
|
|
|
|
//Class pour la selection du nombre de collone et ligne et de Mine a la souris
|
|
|
|
import java.awt.*;
|
|
|
|
import java.awt.event.*;
|
2022-04-21 22:17:57 +02:00
|
|
|
import javax.swing.*;
|
2022-04-20 00:33:31 +02:00
|
|
|
|
|
|
|
public class observateurChoix implements MouseListener{
|
|
|
|
private int direction;
|
|
|
|
private paintChoix pinceau;
|
|
|
|
private nombre compte;
|
2022-04-21 22:17:57 +02:00
|
|
|
private JFrame fenetre;
|
|
|
|
public observateurChoix(int direction0, paintChoix pinceau0, nombre compte0, JFrame fenetre0){
|
2022-04-20 00:33:31 +02:00
|
|
|
this.direction=direction0;
|
|
|
|
// pour savoir si c'est l'observateur de la fleche de gauche ou droite
|
|
|
|
this.pinceau=pinceau0;
|
|
|
|
this.compte=compte0;
|
2022-04-21 22:17:57 +02:00
|
|
|
this.fenetre=fenetre0;
|
2022-04-20 00:33:31 +02:00
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void mouseClicked(MouseEvent evenement){
|
2022-04-21 22:17:57 +02:00
|
|
|
this.compte.addNombre(direction);
|
|
|
|
this.fenetre.dispose();
|
|
|
|
this.fenetre=new JFrame();
|
|
|
|
this.fenetre.setSize(1000,400);
|
|
|
|
this.fenetre.setLocation(0,0);
|
|
|
|
this.fenetre.setVisible(true);
|
2022-04-20 00:33:31 +02:00
|
|
|
}
|
|
|
|
@Override // un bouton cliqué
|
|
|
|
public void mouseEntered(MouseEvent evenement){
|
|
|
|
pinceau.selectionner(true);
|
|
|
|
pinceau.repaint();
|
|
|
|
|
|
|
|
}
|
|
|
|
@Override // debut du survol
|
|
|
|
public void mouseExited(MouseEvent evenement){
|
|
|
|
pinceau.selectionner(false);
|
|
|
|
pinceau.repaint();
|
|
|
|
|
|
|
|
}
|
|
|
|
@Override // fin du survol
|
|
|
|
public void mousePressed(MouseEvent evenement){
|
|
|
|
|
|
|
|
}
|
|
|
|
@Override // un bouton appuyé
|
|
|
|
public void mouseReleased(MouseEvent evenement){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|