18,7 → 18,6 |
private int noteEnCours = 0 ; |
private int noteMax = 0 ; |
private int noteCurseur = 0 ; |
private boolean estNote = false ; |
private Image[] etoiles = null ; |
|
private BarreNotationVue() |
28,11 → 27,10 |
|
public BarreNotationVue(ImageMediateur im, int noteMax) |
{ |
super("Notation") ; |
iMediateur = im ; |
setNoteMax(noteMax) ; |
this.setSize(200, 100) ; |
this.setBodyBorder(false) ; |
this.setBorder(false) ; |
this.setSize(200, 300) ; |
|
ajouterListeners() ; |
|
63,7 → 61,7 |
|
public void onMouseLeave(Widget sender) { |
|
afficherNote() ; |
noter() ; |
} |
|
|
80,7 → 78,8 |
i++ ; |
} |
|
noter(i) ; |
noteEnCours = i ; |
noter() ; |
System.out.println("Nouvelle note : "+noteEnCours); |
|
} |
94,36 → 93,10 |
|
public void rafraichir(Object nouvelleDonnees, |
boolean repandreRaffraichissement) { |
// TODO Auto-generated method stub |
|
if(nouvelleDonnees instanceof String[]) |
{ |
estNote = false ; |
|
String[] note = (String[])nouvelleDonnees ; |
int noteInt = Integer.parseInt(note[0]) ; |
|
System.out.println("Note reçue : "+noteInt); |
if(noteInt != -1) |
{ |
noter(noteInt) ; |
} |
else |
{ |
noteEnCours = 0 ; |
afficherNote() ; |
} |
|
} |
|
} |
|
public void noter(int note) |
{ |
noteEnCours = note ; |
estNote = true ; |
afficherNote() ; |
} |
|
public void setNoteMax(int nMax) |
{ |
noteMax = nMax ; |
136,34 → 109,17 |
} |
} |
|
public void afficherNote() |
public void noter() |
{ |
if(estNote) |
for(int j = 0 ; j <= noteEnCours ; j++) |
{ |
for(int i = 0 ; i <= noteEnCours ; i++) |
{ |
etoiles[i].setUrl("etoile_notee.jpg") ; |
} |
|
for (int j = noteEnCours + 1 ; j < noteMax ; j++) |
{ |
etoiles[j].setUrl("etoile_vide.jpg") ; |
} |
etoiles[j].setUrl("etoile_notee.jpg") ; |
} |
else |
{ |
for(int i = 0 ; i < noteMax ; i++) |
{ |
etoiles[i].setUrl("etoile_vide.jpg") ; |
} |
|
for (int j = noteEnCours + 1 ; j <= noteMax ; j++) { |
etoiles[j].setUrl("etoile_vide.jpg") ; |
} |
|
|
} |
|
public String getNote() |
{ |
return ""+noteEnCours ; |
} |
|
|
} |