Subversion Repositories eFlore/Applications.del

Rev

Rev 1566 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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