1085 |
gduche |
1 |
package org.tela_botanica.del.client.composants.votefleur;
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
import org.tela_botanica.del.client.composants.votefleur.VoteFleurPresenteur.Vue;
|
|
|
5 |
|
|
|
6 |
import com.google.gwt.core.client.GWT;
|
|
|
7 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
8 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
9 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
10 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
11 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
12 |
|
|
|
13 |
public class VoteFleurVue extends Composite implements Vue {
|
|
|
14 |
|
|
|
15 |
// Annotation can be used to change the name of the associated xml file
|
|
|
16 |
// @UiTemplate("ObservationVue.ui.xml")
|
|
|
17 |
interface MyUiBinder extends UiBinder<Widget, VoteFleurVue> {
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
21 |
|
|
|
22 |
@UiField
|
|
|
23 |
protected HTMLPanel fleur0, fleur1, fleur2, fleur3, fleur4, fleur5;
|
|
|
24 |
|
|
|
25 |
public VoteFleurVue() {
|
|
|
26 |
// sets listBox
|
|
|
27 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
28 |
initialiserVue();
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
public void initialiserVue() {
|
|
|
32 |
this.fleur0.setVisible(false);
|
|
|
33 |
this.fleur1.setVisible(false);
|
|
|
34 |
this.fleur2.setVisible(false);
|
|
|
35 |
this.fleur3.setVisible(false);
|
|
|
36 |
this.fleur4.setVisible(false);
|
|
|
37 |
this.fleur5.setVisible(false);
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
public void setNote(int note) {
|
|
|
41 |
switch (note) {
|
|
|
42 |
case 0 : this.fleur0.setVisible(true);
|
|
|
43 |
break;
|
|
|
44 |
case 1 : this.fleur1.setVisible(true);
|
|
|
45 |
break;
|
|
|
46 |
case 2 : this.fleur2.setVisible(true);
|
|
|
47 |
break;
|
|
|
48 |
case 3 : this.fleur3.setVisible(true);
|
|
|
49 |
break;
|
|
|
50 |
case 4 : this.fleur4.setVisible(true);
|
|
|
51 |
break;
|
|
|
52 |
default : this.fleur5.setVisible(true);
|
|
|
53 |
break;
|
|
|
54 |
}
|
|
|
55 |
}
|
|
|
56 |
}
|