200 |
gduche |
1 |
package org.tela_botanica.del.client.vues.rechercheobservations;
|
|
|
2 |
|
|
|
3 |
import com.google.gwt.core.client.GWT;
|
437 |
aurelien |
4 |
import com.google.gwt.event.dom.client.LoadEvent;
|
|
|
5 |
import com.google.gwt.event.dom.client.LoadHandler;
|
200 |
gduche |
6 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
7 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
8 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
9 |
import com.google.gwt.user.client.ui.Image;
|
|
|
10 |
import com.google.gwt.user.client.ui.Label;
|
|
|
11 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
12 |
|
308 |
gduche |
13 |
public class DetailImageVue extends Composite implements DetailImagePresenteur.Vue {
|
200 |
gduche |
14 |
|
|
|
15 |
// Gestion d'UiBinder
|
|
|
16 |
interface Binder extends UiBinder<Widget, DetailImageVue> {
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
private static Binder binder = GWT.create(Binder.class);
|
|
|
20 |
|
|
|
21 |
@UiField
|
|
|
22 |
protected Image photoPrincipale;
|
|
|
23 |
|
|
|
24 |
@UiField
|
|
|
25 |
protected Label texteAlternatif;
|
|
|
26 |
|
308 |
gduche |
27 |
public DetailImageVue() {
|
200 |
gduche |
28 |
initWidget(binder.createAndBindUi(this));
|
437 |
aurelien |
29 |
photoPrincipale.addLoadHandler(new LoadHandler() {
|
|
|
30 |
@Override
|
|
|
31 |
public void onLoad(LoadEvent event) {
|
|
|
32 |
setWidth(photoPrincipale.getWidth()+"px");
|
|
|
33 |
setHeight(photoPrincipale.getHeight()+"px");
|
|
|
34 |
}
|
|
|
35 |
});
|
200 |
gduche |
36 |
}
|
308 |
gduche |
37 |
|
436 |
benjamin |
38 |
public void chargerImage(org.tela_botanica.del.client.modeles.Image imageCourante) {
|
|
|
39 |
setUrlImage(imageCourante.getUrlFormat("L"));
|
|
|
40 |
setTitle(imageCourante.getUrlFormat("L"));
|
469 |
aurelien |
41 |
setTexteAlternatif(imageCourante.getObservation().getAuteur() +
|
|
|
42 |
" - " + imageCourante.getObservation().getNomRetenu()+
|
|
|
43 |
" - " + imageCourante.getObservation().getLocalite()+
|
|
|
44 |
" - ("+ imageCourante.getObservation().getIdLocalite()+")"+
|
|
|
45 |
" - "+ imageCourante.getObservation().getDateReleve());
|
436 |
benjamin |
46 |
}
|
|
|
47 |
|
308 |
gduche |
48 |
public void setUrlImage(String urlImage) {
|
436 |
benjamin |
49 |
photoPrincipale.setUrl(urlImage);
|
308 |
gduche |
50 |
}
|
|
|
51 |
|
|
|
52 |
public void setTexteAlternatif(String texteAlternatif) {
|
436 |
benjamin |
53 |
this.texteAlternatif.setText(texteAlternatif);
|
308 |
gduche |
54 |
}
|
316 |
aurelien |
55 |
|
200 |
gduche |
56 |
}
|