178 |
benjamin |
1 |
package org.tela_botanica.del.client.vues.rechercheimages.resultats.images;
|
|
|
2 |
|
|
|
3 |
import com.google.gwt.core.client.GWT;
|
311 |
gduche |
4 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
178 |
benjamin |
5 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
6 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
7 |
import com.google.gwt.user.client.ui.Composite;
|
311 |
gduche |
8 |
import com.google.gwt.user.client.ui.HasWidgets;
|
178 |
benjamin |
9 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
10 |
import com.google.gwt.user.client.ui.Image;
|
|
|
11 |
import com.google.gwt.user.client.ui.Label;
|
|
|
12 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
13 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
14 |
|
311 |
gduche |
15 |
public class ImageVue extends Composite implements ImagePresenteur.Vue {
|
178 |
benjamin |
16 |
|
|
|
17 |
// Annotation can be used to change the name of the associated xml file
|
|
|
18 |
// @UiTemplate("ObservationVue.ui.xml")
|
|
|
19 |
interface MyUiBinder extends UiBinder<Widget, ImageVue> {
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
23 |
|
|
|
24 |
@UiField
|
|
|
25 |
protected Label nomEspece, nomAuteur, nomObservateur, nomRetenu, dateObservation, famille, localite;
|
|
|
26 |
|
|
|
27 |
@UiField
|
|
|
28 |
protected HorizontalPanel voter;
|
|
|
29 |
|
|
|
30 |
@UiField
|
|
|
31 |
protected VerticalPanel zoneCache;
|
|
|
32 |
|
|
|
33 |
@UiField
|
|
|
34 |
Image imagePrincipale;
|
|
|
35 |
|
|
|
36 |
@UiField
|
|
|
37 |
Label enSavoirPlus, ajoutValidation;
|
|
|
38 |
|
|
|
39 |
public ImageVue() {
|
|
|
40 |
// sets listBox
|
|
|
41 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
42 |
}
|
|
|
43 |
|
311 |
gduche |
44 |
public HasWidgets getZoneVoter() {
|
|
|
45 |
return voter;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
public void cacherZoneCache() {
|
178 |
benjamin |
49 |
zoneCache.setVisible(false);
|
311 |
gduche |
50 |
}
|
|
|
51 |
|
|
|
52 |
public void afficherZoneCache() {
|
|
|
53 |
zoneCache.setVisible(true);
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
public void loadImage(org.tela_botanica.del.client.modeles.Image image) {
|
|
|
57 |
zoneCache.setVisible(false);
|
178 |
benjamin |
58 |
nomEspece.setText(image.getObservation().getSpecies());
|
|
|
59 |
nomAuteur.setText(image.getObservation().getAuteur());
|
250 |
gduche |
60 |
|
|
|
61 |
|
178 |
benjamin |
62 |
imagePrincipale.setUrl(image.getUrl());
|
250 |
gduche |
63 |
imagePrincipale.setTitle(image.getUrlFormat("L"));
|
|
|
64 |
imagePrincipale.setAltText(image.getObservation().getAuteur() + " - " + image.getObservation().getSpecies());
|
178 |
benjamin |
65 |
nomObservateur.setText(image.getObservation().getAuteur());
|
|
|
66 |
nomRetenu.setText(image.getObservation().getNomRetenu());
|
|
|
67 |
dateObservation.setText(image.getObservation().getDate());
|
|
|
68 |
famille.setText(image.getObservation().getFamille());
|
|
|
69 |
localite.setText(image.getObservation().getLocalite());
|
|
|
70 |
|
|
|
71 |
}
|
|
|
72 |
|
311 |
gduche |
73 |
@Override
|
|
|
74 |
public HasClickHandlers getImagePrincipale() {
|
|
|
75 |
return imagePrincipale;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
@Override
|
|
|
79 |
public HasClickHandlers getEnSavoirPlus() {
|
|
|
80 |
return enSavoirPlus;
|
|
|
81 |
}
|
|
|
82 |
|
|
|
83 |
@Override
|
|
|
84 |
public HasClickHandlers getAjoutValidation() {
|
|
|
85 |
return ajoutValidation;
|
|
|
86 |
}
|
|
|
87 |
|
316 |
aurelien |
88 |
@Override
|
|
|
89 |
public void setUrlImagePrincipale(String url) {
|
|
|
90 |
imagePrincipale.setUrl(url);
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
@Override
|
|
|
94 |
public void setTitreImagePrincipale(String titre) {
|
|
|
95 |
imagePrincipale.setTitle(titre);
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
@Override
|
|
|
99 |
public void setAltTextImagePrincipale(String altText) {
|
|
|
100 |
imagePrincipale.setAltText(altText);
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
@Override
|
|
|
104 |
public String getUrlImagePrincipale() {
|
|
|
105 |
return imagePrincipale.getUrl();
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
@Override
|
|
|
109 |
public String getTitreImagePrincipale() {
|
|
|
110 |
return imagePrincipale.getTitle();
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
@Override
|
|
|
114 |
public String getAltTextImagePrincipale() {
|
|
|
115 |
return imagePrincipale.getAltText();
|
|
|
116 |
}
|
|
|
117 |
|
178 |
benjamin |
118 |
}
|