1196 |
gduche |
1 |
package org.tela_botanica.del.client.vues.pictoflora.resultats.images;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.del.client.i18n.I18n;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.core.client.GWT;
|
|
|
6 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
|
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;
|
|
|
10 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
11 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
12 |
import com.google.gwt.user.client.ui.HasWidgets;
|
|
|
13 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
14 |
import com.google.gwt.user.client.ui.Image;
|
|
|
15 |
import com.google.gwt.user.client.ui.IsWidget;
|
|
|
16 |
import com.google.gwt.user.client.ui.Label;
|
|
|
17 |
import com.google.gwt.user.client.ui.Panel;
|
|
|
18 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
19 |
|
|
|
20 |
public class ImageVue extends Composite implements ImagePresenteur.Vue {
|
|
|
21 |
|
|
|
22 |
// Annotation can be used to change the name of the associated xml file
|
|
|
23 |
// @UiTemplate("ObservationVue.ui.xml")
|
|
|
24 |
interface MyUiBinder extends UiBinder<Widget, ImageVue> {
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
28 |
|
|
|
29 |
@UiField
|
|
|
30 |
protected HTML nomEspece, nomAuteur;
|
|
|
31 |
|
|
|
32 |
@UiField
|
|
|
33 |
protected HTMLPanel zoneVoter, zonePlus;
|
|
|
34 |
|
|
|
35 |
@UiField
|
|
|
36 |
protected HorizontalPanel voter;
|
|
|
37 |
|
|
|
38 |
@UiField
|
|
|
39 |
protected Panel zoneCache, zoneMotsCles;
|
|
|
40 |
|
|
|
41 |
@UiField
|
|
|
42 |
Image imagePrincipale;
|
|
|
43 |
|
|
|
44 |
@UiField
|
|
|
45 |
Label enSavoirPlus, voirMotsCles;
|
|
|
46 |
|
|
|
47 |
@UiField Panel metadonnees;
|
|
|
48 |
|
|
|
49 |
public ImageVue() {
|
|
|
50 |
// sets listBox
|
|
|
51 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public HasWidgets getZoneVoter() {
|
|
|
55 |
return voter;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
public void cacherZoneCache() {
|
|
|
59 |
zoneCache.setVisible(false);
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public void afficherZoneCache() {
|
|
|
63 |
zoneCache.setVisible(true);
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
public void loadImage(org.tela_botanica.del.client.modeles.Image image) {
|
|
|
67 |
zoneCache.setVisible(false);
|
|
|
68 |
zoneMotsCles.setVisible(false);
|
|
|
69 |
nomEspece.setHTML("<p>"+image.getObservation().getNomRetenu()+"</p>");
|
|
|
70 |
nomAuteur.setHTML("<p>"+image.getObservation().getAuteur()+"</p>");
|
|
|
71 |
|
|
|
72 |
imagePrincipale.setUrl(image.getUrl());
|
|
|
73 |
imagePrincipale.setTitle(I18n.getVocabulary().indicationActionClicImage());
|
|
|
74 |
imagePrincipale.setAltText(image.getObservation().getAuteur() + " - " + image.getObservation().getNomRetenu());
|
|
|
75 |
|
|
|
76 |
String styleZonePlus = "image_determinee";
|
|
|
77 |
if(image.estADeterminer()) {
|
|
|
78 |
styleZonePlus = "image_non_determinee";
|
|
|
79 |
}
|
|
|
80 |
zonePlus.addStyleName(styleZonePlus);
|
|
|
81 |
|
|
|
82 |
voirMotsCles.setTitle(I18n.getVocabulary().voirMotsCles());
|
|
|
83 |
enSavoirPlus.setTitle(I18n.getVocabulary().voirMetadonnees());
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
@Override
|
|
|
87 |
public HasClickHandlers getImagePrincipale() {
|
|
|
88 |
return imagePrincipale;
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
@Override
|
|
|
92 |
public IsWidget getImagePrincipaleWidget() {
|
|
|
93 |
return imagePrincipale;
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
@Override
|
|
|
97 |
public HasClickHandlers getEnSavoirPlus() {
|
|
|
98 |
return enSavoirPlus;
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
@Override
|
|
|
102 |
public HasClickHandlers getVoirMotsCles() {
|
|
|
103 |
return voirMotsCles;
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
@Override
|
|
|
107 |
public void setUrlImagePrincipale(String url) {
|
|
|
108 |
imagePrincipale.setUrl(url);
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
@Override
|
|
|
112 |
public void setTitreImagePrincipale(String titre) {
|
|
|
113 |
imagePrincipale.setTitle(titre);
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
@Override
|
|
|
117 |
public void setAltTextImagePrincipale(String altText) {
|
|
|
118 |
imagePrincipale.setAltText(altText);
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
@Override
|
|
|
122 |
public String getUrlImagePrincipale() {
|
|
|
123 |
return imagePrincipale.getUrl();
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
@Override
|
|
|
127 |
public String getTitreImagePrincipale() {
|
|
|
128 |
return imagePrincipale.getTitle();
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
@Override
|
|
|
132 |
public String getAltTextImagePrincipale() {
|
|
|
133 |
return imagePrincipale.getAltText();
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
@Override
|
|
|
137 |
public HasClickHandlers getNomAuteur() {
|
|
|
138 |
return nomAuteur;
|
|
|
139 |
}
|
|
|
140 |
|
|
|
141 |
@Override
|
|
|
142 |
public HasClickHandlers getNomEspece() {
|
|
|
143 |
return nomEspece;
|
|
|
144 |
}
|
|
|
145 |
|
|
|
146 |
public HasWidgets getMetadonnees() {
|
|
|
147 |
return metadonnees;
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
@Override
|
|
|
151 |
public void cacherZoneMotsCles() {
|
|
|
152 |
zoneMotsCles.setVisible(false);
|
|
|
153 |
}
|
|
|
154 |
|
|
|
155 |
@Override
|
|
|
156 |
public void afficherZoneMotsCles() {
|
|
|
157 |
zoneMotsCles.setVisible(true);
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
@Override
|
|
|
161 |
public HasWidgets getZoneMotsCles() {
|
|
|
162 |
return zoneMotsCles;
|
|
|
163 |
}
|
|
|
164 |
}
|