Subversion Repositories eFlore/Applications.del

Rev

Rev 1203 | Rev 1862 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
1566 mathias 40
	Button triParNbVotesAscendant, triParNbVotesDescendant, triParDateAscendant, triParDateDescendant, triParNbTagsAscendant, triParNbTagsDescendant, triParPointsAscendant, triParPointsDescendant;
1196 gduche 41
 
42
	@UiField
43
	Label aucunResultat;
44
 
45
	@UiField
1566 mathias 46
	Label labelVote, 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
 
65
		panneauxImages.clear();
66
		for (int i = 0; i < taille; i++) {
67
			Panel imagePanel = new HTMLPanel("");
68
			panneauxImages.add(imagePanel);
69
		}
70
	}
71
 
72
	public void afficherElementsAucunResultatTrouve() {
73
		imageTable.clear();
74
		aucunResultat.setVisible(true);
75
		panneauPaginationHaut.setVisible(false);
76
		panneauPagination.setVisible(false);
77
		zoneTri.setVisible(false);
78
	}
79
 
80
	public void afficherElementsResultatsTrouve() {
81
		aucunResultat.setVisible(false);
82
		panneauPaginationHaut.setVisible(true);
83
		panneauPagination.setVisible(true);
84
		zoneTri.setVisible(true);
85
	}
86
 
87
	public void setNumImage(int numImage) {
88
		this.numImage = numImage;
89
	}
90
 
91
	public void startChargement() {
92
		panneauChargement.setHeight((this.getOffsetHeight() - (panneauPagination.getOffsetHeight() * 2)) + "px");
93
		panneauChargement.setVisible(true);
94
	}
95
 
96
	public void stopChargement() {
97
		panneauChargement.setVisible(false);
98
	}
99
 
100
	public HTMLPanel getImageTable() {
101
		return imageTable;
102
	}
103
 
104
	public int getNumImage() {
105
		return numImage;
106
	}
107
 
108
	public Panel getPanneauChargement() {
109
		return panneauChargement;
110
	}
111
 
112
	public Panel getPanneauPagination() {
113
		return panneauPagination;
114
	}
115
 
116
	public Panel getPanneauPaginationHaut() {
117
		return panneauPaginationHaut;
118
	}
119
 
120
	public int getNbImagesPerPage() {
121
		return nbImagesPerPage;
122
	}
123
 
124
	public List<HasWidgets> getPanneauxImages() {
125
		return panneauxImages;
126
	}
127
 
128
	public Button getTriParNbVotesAscendant() {
129
		return triParNbVotesAscendant;
130
	}
131
 
132
	public Button getTriParNbVotesDescendant() {
133
		return triParNbVotesDescendant;
134
	}
135
 
136
	public Button getTriParDateAscendant() {
137
		return triParDateAscendant;
138
	}
139
 
140
	public Button getTriParDateDescendant() {
141
		return triParDateDescendant;
142
	}
1566 mathias 143
 
144
	public Button getTriParPointsAscendant() {
145
		return triParPointsAscendant;
146
	}
147
 
148
	public Button getTriParPointsDescendant() {
149
		return triParPointsDescendant;
150
	}
1196 gduche 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
	}
1566 mathias 177
 
178
	@Override
179
	public Label getLabelPoints() {
180
		return labelPoints;
181
	}
1196 gduche 182
 
183
	@Override
1566 mathias 184
	public void afficherPointsAscendant() {
185
		triParPointsAscendant.setVisible(true);
186
	}
187
 
188
	@Override
189
	public void afficherPointsDescendant() {
190
		triParPointsDescendant.setVisible(true);
191
	}
192
 
193
	@Override
194
	public void masquerPointsAscendant() {
195
		triParPointsAscendant.setVisible(false);
196
	}
197
 
198
	@Override
199
	public void masquerPointsDescendant() {
200
		triParPointsDescendant.setVisible(false);
201
	}
202
 
203
	@Override
1196 gduche 204
	public Label getLabelDate() {
205
		return labelDate;
206
	}
207
 
208
	@Override
209
	public Label getLabelTag() {
210
		return labelTag;
211
	}
212
 
213
	@Override
214
	public void masquerDateAscendant() {
215
		triParDateAscendant.setVisible(false);
216
	}
217
 
218
	@Override
219
	public void masquerDateDescendant() {
220
		triParDateDescendant.setVisible(false);
221
	}
222
 
223
	@Override
224
	public void afficherDateAscendant() {
225
		triParDateAscendant.setVisible(true);
226
	}
227
 
228
	@Override
229
	public void afficherDateDescendant() {
230
		triParDateDescendant.setVisible(true);
231
	}
232
 
233
	@Override
234
	public HasClickHandlers getTriParNbTagsAscendant() {
235
		return triParNbTagsAscendant;
236
	}
237
 
238
	@Override
239
	public HasClickHandlers getTriParNbTagsDescendant() {
240
		return triParNbTagsDescendant;
241
	}
242
 
243
 
244
	@Override
245
	public void afficherTagAscendant() {
246
		triParNbTagsAscendant.setVisible(true);
247
	}
248
 
249
	@Override
250
	public void masquerTagAscendant() {
251
		triParNbTagsAscendant.setVisible(false);
252
	}
253
 
254
	@Override
255
	public void afficherTagDescendant() {
256
		triParNbTagsDescendant.setVisible(true);
257
	}
258
 
259
	@Override
260
	public void masquerTagDescendant() {
261
		triParNbTagsDescendant.setVisible(false);
262
	}
263
 
264
}