| 1196 |
gduche |
1 |
package org.tela_botanica.del.client.vues.pictoflora.resultats;
|
|
|
2 |
|
|
|
3 |
import java.util.ArrayList;
|
|
|
4 |
import java.util.List;
|
|
|
5 |
|
|
|
6 |
import com.google.gwt.core.client.GWT;
|
|
|
7 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
|
8 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
9 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
10 |
import com.google.gwt.user.client.ui.Button;
|
|
|
11 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
12 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
13 |
import com.google.gwt.user.client.ui.HasWidgets;
|
|
|
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 ResultatPictofloraVue extends Composite implements ResultatPictofloraPresenteur.Vue {
|
|
|
19 |
|
|
|
20 |
@UiField
|
|
|
21 |
Panel panneauChargement;
|
|
|
22 |
private final List<HasWidgets> panneauxImages = new ArrayList<HasWidgets>();
|
|
|
23 |
private final int nbImagesPerPage = 10;
|
|
|
24 |
private int numImage = 0;
|
|
|
25 |
|
|
|
26 |
// Annotation can be used to change the name of the associated xml file
|
|
|
27 |
// @UiTemplate("ObservationRechercheVue.ui.xml")
|
|
|
28 |
interface MyUiBinder extends UiBinder<Widget, ResultatPictofloraVue> {
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
32 |
|
|
|
33 |
@UiField
|
|
|
34 |
Panel panneauPagination, panneauPaginationHaut, zoneTri;
|
|
|
35 |
|
|
|
36 |
@UiField
|
|
|
37 |
HTMLPanel imageTable;
|
|
|
38 |
|
|
|
39 |
@UiField
|
| 1862 |
jpm |
40 |
Button triParMoyenneArithmetiqueAscendant, triParMoyenneArithmetiqueDescendant, triParDateAscendant, triParDateDescendant, triParNbTagsAscendant, triParNbTagsDescendant, triParPointsAscendant, triParPointsDescendant;
|
| 1196 |
gduche |
41 |
|
|
|
42 |
@UiField
|
|
|
43 |
Label aucunResultat;
|
|
|
44 |
|
|
|
45 |
@UiField
|
| 1862 |
jpm |
46 |
Label labelMoyenneArithmetique, labelDate, labelTag, labelPoints;
|
| 1196 |
gduche |
47 |
|
| 1203 |
gduche |
48 |
|
| 1196 |
gduche |
49 |
// Constructeur
|
|
|
50 |
public ResultatPictofloraVue() {
|
|
|
51 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
/**
|
|
|
55 |
* Nettoie et remet à zéro les composants du panneau qui doivent l'être
|
|
|
56 |
* */
|
|
|
57 |
public void nettoyer() {
|
|
|
58 |
setNumImage(0);
|
|
|
59 |
imageTable.clear();
|
|
|
60 |
panneauxImages.clear();
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
public void creerPanneauxObservations(int taille) {
|
|
|
64 |
panneauxImages.clear();
|
|
|
65 |
for (int i = 0; i < taille; i++) {
|
|
|
66 |
Panel imagePanel = new HTMLPanel("");
|
|
|
67 |
panneauxImages.add(imagePanel);
|
|
|
68 |
}
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
public void afficherElementsAucunResultatTrouve() {
|
|
|
72 |
imageTable.clear();
|
|
|
73 |
aucunResultat.setVisible(true);
|
|
|
74 |
panneauPaginationHaut.setVisible(false);
|
|
|
75 |
panneauPagination.setVisible(false);
|
|
|
76 |
zoneTri.setVisible(false);
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
public void afficherElementsResultatsTrouve() {
|
|
|
80 |
aucunResultat.setVisible(false);
|
|
|
81 |
panneauPaginationHaut.setVisible(true);
|
|
|
82 |
panneauPagination.setVisible(true);
|
|
|
83 |
zoneTri.setVisible(true);
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
public void setNumImage(int numImage) {
|
|
|
87 |
this.numImage = numImage;
|
|
|
88 |
}
|
|
|
89 |
|
|
|
90 |
public void startChargement() {
|
|
|
91 |
panneauChargement.setHeight((this.getOffsetHeight() - (panneauPagination.getOffsetHeight() * 2)) + "px");
|
|
|
92 |
panneauChargement.setVisible(true);
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
public void stopChargement() {
|
|
|
96 |
panneauChargement.setVisible(false);
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
public HTMLPanel getImageTable() {
|
|
|
100 |
return imageTable;
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
public int getNumImage() {
|
|
|
104 |
return numImage;
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
public Panel getPanneauChargement() {
|
|
|
108 |
return panneauChargement;
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
public Panel getPanneauPagination() {
|
|
|
112 |
return panneauPagination;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
public Panel getPanneauPaginationHaut() {
|
|
|
116 |
return panneauPaginationHaut;
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
public int getNbImagesPerPage() {
|
|
|
120 |
return nbImagesPerPage;
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
public List<HasWidgets> getPanneauxImages() {
|
|
|
124 |
return panneauxImages;
|
|
|
125 |
}
|
|
|
126 |
|
| 1862 |
jpm |
127 |
public Button getTriParMoyenneArithmetiqueAscendant() {
|
|
|
128 |
return triParMoyenneArithmetiqueAscendant;
|
| 1196 |
gduche |
129 |
}
|
|
|
130 |
|
| 1862 |
jpm |
131 |
public Button getTriParMoyenneArithmetiqueDescendant() {
|
|
|
132 |
return triParMoyenneArithmetiqueDescendant;
|
| 1196 |
gduche |
133 |
}
|
|
|
134 |
|
|
|
135 |
public Button getTriParDateAscendant() {
|
|
|
136 |
return triParDateAscendant;
|
|
|
137 |
}
|
|
|
138 |
|
|
|
139 |
public Button getTriParDateDescendant() {
|
|
|
140 |
return triParDateDescendant;
|
|
|
141 |
}
|
| 1566 |
mathias |
142 |
|
|
|
143 |
public Button getTriParPointsAscendant() {
|
|
|
144 |
return triParPointsAscendant;
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
public Button getTriParPointsDescendant() {
|
|
|
148 |
return triParPointsDescendant;
|
|
|
149 |
}
|
| 1196 |
gduche |
150 |
|
|
|
151 |
|
|
|
152 |
@Override
|
| 1862 |
jpm |
153 |
public Label getLabelMoyenneArithmetique() {
|
|
|
154 |
return labelMoyenneArithmetique;
|
| 1196 |
gduche |
155 |
}
|
|
|
156 |
|
|
|
157 |
@Override
|
| 1862 |
jpm |
158 |
public void masquerMoyenneArithmetiqueAscendant() {
|
|
|
159 |
triParMoyenneArithmetiqueAscendant.setVisible(false);
|
| 1196 |
gduche |
160 |
}
|
|
|
161 |
|
|
|
162 |
@Override
|
| 1862 |
jpm |
163 |
public void masquerMoyenneArithmetiqueDescendant() {
|
|
|
164 |
triParMoyenneArithmetiqueDescendant.setVisible(false);
|
| 1196 |
gduche |
165 |
}
|
|
|
166 |
|
|
|
167 |
@Override
|
| 1862 |
jpm |
168 |
public void afficherMoyenneArithmetiqueAscendant() {
|
|
|
169 |
triParMoyenneArithmetiqueAscendant.setVisible(true);
|
| 1196 |
gduche |
170 |
}
|
|
|
171 |
|
|
|
172 |
@Override
|
| 1862 |
jpm |
173 |
public void afficherMoyenneArithmetiqueDescendant() {
|
|
|
174 |
triParMoyenneArithmetiqueDescendant.setVisible(true);
|
| 1196 |
gduche |
175 |
}
|
| 1566 |
mathias |
176 |
|
|
|
177 |
@Override
|
|
|
178 |
public Label getLabelPoints() {
|
|
|
179 |
return labelPoints;
|
|
|
180 |
}
|
| 1196 |
gduche |
181 |
|
|
|
182 |
@Override
|
| 1566 |
mathias |
183 |
public void afficherPointsAscendant() {
|
|
|
184 |
triParPointsAscendant.setVisible(true);
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
@Override
|
|
|
188 |
public void afficherPointsDescendant() {
|
|
|
189 |
triParPointsDescendant.setVisible(true);
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
@Override
|
|
|
193 |
public void masquerPointsAscendant() {
|
|
|
194 |
triParPointsAscendant.setVisible(false);
|
|
|
195 |
}
|
|
|
196 |
|
|
|
197 |
@Override
|
|
|
198 |
public void masquerPointsDescendant() {
|
|
|
199 |
triParPointsDescendant.setVisible(false);
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
@Override
|
| 1196 |
gduche |
203 |
public Label getLabelDate() {
|
|
|
204 |
return labelDate;
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
@Override
|
|
|
208 |
public Label getLabelTag() {
|
|
|
209 |
return labelTag;
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
@Override
|
|
|
213 |
public void masquerDateAscendant() {
|
|
|
214 |
triParDateAscendant.setVisible(false);
|
|
|
215 |
}
|
|
|
216 |
|
|
|
217 |
@Override
|
|
|
218 |
public void masquerDateDescendant() {
|
|
|
219 |
triParDateDescendant.setVisible(false);
|
|
|
220 |
}
|
|
|
221 |
|
|
|
222 |
@Override
|
|
|
223 |
public void afficherDateAscendant() {
|
|
|
224 |
triParDateAscendant.setVisible(true);
|
|
|
225 |
}
|
|
|
226 |
|
|
|
227 |
@Override
|
|
|
228 |
public void afficherDateDescendant() {
|
|
|
229 |
triParDateDescendant.setVisible(true);
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
@Override
|
|
|
233 |
public HasClickHandlers getTriParNbTagsAscendant() {
|
|
|
234 |
return triParNbTagsAscendant;
|
|
|
235 |
}
|
|
|
236 |
|
|
|
237 |
@Override
|
|
|
238 |
public HasClickHandlers getTriParNbTagsDescendant() {
|
|
|
239 |
return triParNbTagsDescendant;
|
|
|
240 |
}
|
|
|
241 |
|
|
|
242 |
|
|
|
243 |
@Override
|
|
|
244 |
public void afficherTagAscendant() {
|
|
|
245 |
triParNbTagsAscendant.setVisible(true);
|
|
|
246 |
}
|
|
|
247 |
|
|
|
248 |
@Override
|
|
|
249 |
public void masquerTagAscendant() {
|
|
|
250 |
triParNbTagsAscendant.setVisible(false);
|
|
|
251 |
}
|
|
|
252 |
|
|
|
253 |
@Override
|
|
|
254 |
public void afficherTagDescendant() {
|
|
|
255 |
triParNbTagsDescendant.setVisible(true);
|
|
|
256 |
}
|
|
|
257 |
|
|
|
258 |
@Override
|
|
|
259 |
public void masquerTagDescendant() {
|
|
|
260 |
triParNbTagsDescendant.setVisible(false);
|
|
|
261 |
}
|
|
|
262 |
|
|
|
263 |
}
|