2022-04-29 00:33:24 +02:00
|
|
|
import java.awt.*;
|
|
|
|
import java.awt.event.*;
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
public class observateurSAV implements MouseListener{
|
2022-04-29 14:20:40 +02:00
|
|
|
private plateau plat;
|
2022-04-29 00:33:24 +02:00
|
|
|
private paintMenuJeu button;
|
2022-04-29 14:20:40 +02:00
|
|
|
private boolean fonction;
|
|
|
|
public observateurSAV(paintMenuJeu button0, plateau plat0){
|
2022-04-29 00:33:24 +02:00
|
|
|
this.button=button0;
|
2022-04-29 14:20:40 +02:00
|
|
|
this.plat=plat0;
|
|
|
|
this.fonction=false;
|
|
|
|
}
|
|
|
|
public void setFonction(boolean fonction0){
|
|
|
|
this.fonction=fonction0;
|
2022-04-29 00:33:24 +02:00
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public void mouseClicked(MouseEvent evenement){
|
2022-04-29 14:20:40 +02:00
|
|
|
if(this.fonction==false){
|
|
|
|
plat.getFenetre().dispose();
|
|
|
|
}
|
|
|
|
if(this.fonction==true){
|
2022-04-29 17:20:43 +02:00
|
|
|
plat.newGame(plat.getLigne(), plat.getCollonne(), plat.getBombe());
|
2022-04-29 14:20:40 +02:00
|
|
|
}
|
2022-04-29 00:33:24 +02:00
|
|
|
}
|
|
|
|
@Override // un bouton cliqué
|
|
|
|
public void mouseEntered(MouseEvent evenement){
|
|
|
|
this.button.setSurvol(true);
|
|
|
|
}
|
|
|
|
@Override // debut du survol
|
|
|
|
public void mouseExited(MouseEvent evenement){
|
|
|
|
this.button.setSurvol(false);
|
|
|
|
}
|
|
|
|
@Override // fin du survol
|
|
|
|
public void mousePressed(MouseEvent evenement){
|
|
|
|
|
|
|
|
}
|
|
|
|
@Override // un bouton appuyé
|
|
|
|
public void mouseReleased(MouseEvent evenement){
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|