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