477 |
benjamin |
1 |
package org.tela_botanica.del.client.composants.observations;
|
436 |
benjamin |
2 |
|
|
|
3 |
import com.google.gwt.core.client.GWT;
|
|
|
4 |
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
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;
|
|
|
8 |
import com.google.gwt.user.client.ui.Image;
|
|
|
9 |
import com.google.gwt.user.client.ui.Panel;
|
|
|
10 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
11 |
|
|
|
12 |
public class ObservationImagesVue extends Composite implements ObservationImagesPresenteur.Vue {
|
|
|
13 |
|
|
|
14 |
// Gestion d'UiBinder
|
|
|
15 |
interface Binder extends UiBinder<Widget, ObservationImagesVue> {
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
private static Binder binder = GWT.create(Binder.class);
|
|
|
19 |
|
|
|
20 |
@UiField
|
|
|
21 |
protected Image photoPrincipale;
|
|
|
22 |
|
|
|
23 |
@UiField
|
|
|
24 |
protected Panel photos;
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
public ObservationImagesVue() {
|
|
|
28 |
initWidget(binder.createAndBindUi(this));
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
public void chargerImagePrincipale(org.tela_botanica.del.client.modeles.Image image) {
|
444 |
aurelien |
32 |
setUrlImagePrincipale(image.getUrlFormat("CRS"));
|
436 |
benjamin |
33 |
setTitreImagePrincipale(image.getUrlFormat("L"));
|
|
|
34 |
setAltTextImagePrincipale(image.getObservation().getAuteur() + " - " + image.getObservation().getNomRetenu());
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
@Override
|
|
|
38 |
public void ajouterPhoto(org.tela_botanica.del.client.modeles.Image imageCourante, ClickHandler gestionnaireClic) {
|
|
|
39 |
Image photo = new Image();
|
|
|
40 |
photo.setUrl(imageCourante.getUrlFormat("CRX2S"));
|
|
|
41 |
photo.setTitle(imageCourante.getUrlFormat("L"));
|
471 |
aurelien |
42 |
photo.setAltText("");
|
436 |
benjamin |
43 |
photo.addClickHandler(gestionnaireClic);
|
|
|
44 |
getPhotos().add(photo);
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
public void setUrlImagePrincipale(String url) {
|
|
|
48 |
photoPrincipale.setUrl(url);
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
public void setTitreImagePrincipale(String titre) {
|
|
|
52 |
photoPrincipale.setTitle(titre);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
public void setAltTextImagePrincipale(String altText) {
|
|
|
56 |
photoPrincipale.setAltText(altText);
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public String getUrlImagePrincipale() {
|
|
|
60 |
return photoPrincipale.getUrl();
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
public String getTitreImagePrincipale() {
|
|
|
64 |
return photoPrincipale.getTitle();
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
public String getAltTextImagePrincipale() {
|
|
|
68 |
return photoPrincipale.getAltText();
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
public Image getPhotoPrincipale() {
|
|
|
72 |
return photoPrincipale;
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
public Panel getPhotos() {
|
|
|
76 |
return photos;
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
}
|