/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++) { |
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") ; |
} |
} |
} |
public String getNote() |
{ |
return ""+noteEnCours ; |
} |
} |
/trunk/src/org/tela_botanica/client/vues/PanneauMetadonneesVue.java |
---|
98,7 → 98,13 |
* Le bouton de validation |
*/ |
Button validerInfo = null ; |
/** |
* Barre de notation |
*/ |
BarreNotationVue noteVue = null ; |
/** |
* Booleen d'instanciation |
*/ |
boolean estInstancie = false ; |
143,6 → 149,7 |
commentaireGeneral = new TextArea() ; |
commentaireGeneral.setAutoWidth(true) ; |
Label labelDate = new Label("Date :") ; |
Label labelNote = new Label("Note :") ; |
labelDate.setHeight("20px") ; |
152,10 → 159,14 |
validerInfo = new Button("OK") ; |
noteVue = new BarreNotationVue(im, 5) ; |
sousPanneauInfosGenerales.add(labelComm) ; |
sousPanneauInfosGenerales.add(commentaireGeneral) ; |
sousPanneauInfosGenerales.add(labelDate) ; |
sousPanneauInfosGenerales.add(dateImage) ; |
sousPanneauInfosGenerales.add(labelNote) ; |
sousPanneauInfosGenerales.add(noteVue) ; |
sousPanneauInfosGenerales.add(validerInfo) ; |
sousPanneauInfosGenerales.setAutoHeight(true); |
panneauMotsCles.setAutoHeight(true) ; |
217,7 → 228,7 |
public void onClick(Button button, EventObject e) { |
// lors du clic sur le bouton valider on met à jour les commentaires et la date |
getIMediateur().mettreAJourInfo(commentaireGeneral.getText(), dateImage.getRawValue()) ; |
getIMediateur().mettreAJourInfo(commentaireGeneral.getText(), dateImage.getRawValue(), noteVue.getNote()) ; |
} |
}); |
356,4 → 367,8 |
public ArbreMotsClesVue getPanneauMotsCles() { |
return panneauMotsCles; |
} |
public BarreNotationVue getNoteVue() { |
return noteVue ; |
} |
} |