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"));
|
|
|
41 |
setTexteAlternatif(imageCourante.getObservation().getAuteur() + " - " + imageCourante.getObservation().getNomRetenu());
|
|
|
42 |
}
|
|
|
43 |
|
308 |
gduche |
44 |
public void setUrlImage(String urlImage) {
|
436 |
benjamin |
45 |
photoPrincipale.setUrl(urlImage);
|
308 |
gduche |
46 |
}
|
|
|
47 |
|
|
|
48 |
public void setTexteAlternatif(String texteAlternatif) {
|
436 |
benjamin |
49 |
this.texteAlternatif.setText(texteAlternatif);
|
308 |
gduche |
50 |
}
|
316 |
aurelien |
51 |
|
200 |
gduche |
52 |
}
|