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