50 |
benjamin |
1 |
package org.tela_botanica.del.client.vues.comparaisoneflore;
|
|
|
2 |
|
|
|
3 |
import java.util.List;
|
|
|
4 |
|
|
|
5 |
import org.tela_botanica.del.client.modeles.Observation;
|
|
|
6 |
|
|
|
7 |
import com.google.gwt.core.client.GWT;
|
|
|
8 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
9 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
10 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
11 |
import com.google.gwt.user.client.ui.Image;
|
|
|
12 |
import com.google.gwt.user.client.ui.Label;
|
|
|
13 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
14 |
|
|
|
15 |
public class ComparaisonEfloreVue extends Composite {
|
|
|
16 |
|
|
|
17 |
interface MyUiBinder extends UiBinder<Widget, ComparaisonEfloreVue> {
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
21 |
|
|
|
22 |
@UiField
|
|
|
23 |
Label nomEspece, nomAuteur, dateObservation, famille, localite;
|
|
|
24 |
|
|
|
25 |
@UiField
|
|
|
26 |
Label nomEspeceEflore, nomAuteurEflore, localiteEflore, dateObservationEflore;
|
|
|
27 |
|
|
|
28 |
@UiField
|
|
|
29 |
Image imagePrincipale;
|
|
|
30 |
|
|
|
31 |
@UiField
|
|
|
32 |
Image imageEflore;
|
|
|
33 |
|
|
|
34 |
@UiField
|
|
|
35 |
Image scrollLeftImage;
|
|
|
36 |
|
|
|
37 |
@UiField
|
|
|
38 |
Image scrollRightImage;
|
|
|
39 |
|
|
|
40 |
private int currentIndexImages;
|
|
|
41 |
|
|
|
42 |
public ComparaisonEfloreVue() {
|
|
|
43 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
protected void chargerImagePrincipale(Observation observationPrincipale) {
|
|
|
47 |
|
|
|
48 |
nomEspece.setText(observationPrincipale.getSpecies());
|
|
|
49 |
nomAuteur.setText(observationPrincipale.getAuteur());
|
|
|
50 |
imagePrincipale.setUrl(observationPrincipale.getUrl());
|
|
|
51 |
dateObservation.setText(observationPrincipale.getDate());
|
|
|
52 |
famille.setText(observationPrincipale.getFamille());
|
|
|
53 |
localite.setText(observationPrincipale.getLocalite());
|
|
|
54 |
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
protected void chargerImagesEflore(List<Observation> observationsEflore, int indexImage) {
|
|
|
58 |
|
|
|
59 |
if (indexImage >= 0 && indexImage <observationsEflore.size()) {
|
|
|
60 |
currentIndexImages = indexImage;
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
Observation observationEflore = observationsEflore.get(currentIndexImages);
|
|
|
64 |
|
|
|
65 |
nomEspeceEflore.setText(observationEflore.getSpecies());
|
|
|
66 |
nomAuteurEflore.setText(observationEflore.getAuteur());
|
|
|
67 |
imageEflore.setUrl(observationEflore.getUrl());
|
|
|
68 |
dateObservationEflore.setText(observationEflore.getDate());
|
|
|
69 |
localiteEflore.setText(observationEflore.getLocalite());
|
|
|
70 |
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
public Image getScrollLeftImage() {
|
|
|
74 |
return scrollLeftImage;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
public void setScrollLeftImage(Image scrollLeftImage) {
|
|
|
78 |
this.scrollLeftImage = scrollLeftImage;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
public int getCurrentIndexImages() {
|
|
|
82 |
return currentIndexImages;
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
public Image getScrollRightImage() {
|
|
|
86 |
return scrollRightImage;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
}
|