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