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