SAE21_2021/observateurFenetre.java

34 lines
944 B
Java
Raw Normal View History

2022-05-05 22:45:26 +02:00
import java.awt.event.*;
public class observateurFenetre implements WindowListener{
private plateau plat;
public observateurFenetre(plateau plat0){
this.plat=plat0;
}
public void windowActivated(WindowEvent evenement){
} // premier plan
public void windowClosed(WindowEvent evenement){
} // après fermeture
public void windowClosing(WindowEvent evenement){
//si la partie n'est pas encore fini
if(this.plat.etatDeVictoire()==0){
//on sauvegarde
this.plat.save();
}
} // avant fermeture
public void windowDeactivated(WindowEvent evenement){
} // arrière-plan
public void windowDeiconified(WindowEvent evenement){
} // restauration
public void windowIconified(WindowEvent evenement){
} // minimisation
public void windowOpened(WindowEvent evenement){
} // après ouverture
}