Subversion Repositories eFlore/Archives.cel-v2

Compare Revisions

Ignore whitespace Rev 45 → Rev 46

/trunk/src/org/tela_botanica/client/vues/BarreNotationVue.java
18,6 → 18,7
private int noteEnCours = 0 ;
private int noteMax = 0 ;
private int noteCurseur = 0 ;
private boolean estNote = false ;
private Image[] etoiles = null ;
private BarreNotationVue()
27,10 → 28,11
public BarreNotationVue(ImageMediateur im, int noteMax)
{
super("Notation") ;
iMediateur = im ;
setNoteMax(noteMax) ;
this.setSize(200, 300) ;
this.setSize(200, 100) ;
this.setBodyBorder(false) ;
this.setBorder(false) ;
ajouterListeners() ;
61,7 → 63,7
 
public void onMouseLeave(Widget sender) {
noter() ;
afficherNote() ;
}
 
78,8 → 80,7
i++ ;
}
noteEnCours = i ;
noter() ;
noter(i) ;
System.out.println("Nouvelle note : "+noteEnCours);
}
93,10 → 94,36
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 ;
109,17 → 136,34
}
}
public void noter()
public void afficherNote()
{
for(int j = 0 ; j <= noteEnCours ; j++)
if(estNote)
{
etoiles[j].setUrl("etoile_notee.jpg") ;
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") ;
}
}
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 ;
}
 
 
}