42 lines
1010 B
Java
42 lines
1010 B
Java
|
import java.awt.*;
|
||
|
import java.awt.event.*;
|
||
|
import javax.swing.*;
|
||
|
|
||
|
public class observateurSAV implements MouseListener{
|
||
|
private plateau plat;
|
||
|
private paintMenuJeu button;
|
||
|
private boolean fonction;
|
||
|
public observateurSAV(paintMenuJeu button0, plateau plat0){
|
||
|
this.button=button0;
|
||
|
this.plat=plat0;
|
||
|
this.fonction=false;
|
||
|
}
|
||
|
public void setFonction(boolean fonction0){
|
||
|
this.fonction=fonction0;
|
||
|
}
|
||
|
@Override
|
||
|
public void mouseClicked(MouseEvent evenement){
|
||
|
if(this.fonction==false){
|
||
|
plat.save();
|
||
|
}
|
||
|
if(this.fonction==true){
|
||
|
plat.menuChoixTypePartie();
|
||
|
}
|
||
|
}
|
||
|
@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){
|
||
|
|
||
|
}
|
||
|
}
|