Subversion Repositories eFlore/Applications.del

Rev

Rev 534 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 534 Rev 564
Line 1... Line 1...
1
package org.tela_botanica.del.client.vues.rechercheimages.resultats;
1
package org.tela_botanica.del.client.vues.rechercheimages.resultats;
Line 2... Line -...
2
 
-
 
3
import java.util.ArrayList;
-
 
4
import java.util.Iterator;
2
 
Line 5... Line 3...
5
import java.util.List;
3
import java.util.List;
6
 
4
 
7
import org.tela_botanica.del.client.cache.CacheClient;
5
import org.tela_botanica.del.client.cache.CacheClient;
Line 20... Line 18...
20
import org.tela_botanica.del.client.vues.rechercheimages.resultats.images.ImageVue;
18
import org.tela_botanica.del.client.vues.rechercheimages.resultats.images.ImageVue;
Line 21... Line 19...
21
 
19
 
22
import com.google.gwt.event.dom.client.ClickEvent;
20
import com.google.gwt.event.dom.client.ClickEvent;
23
import com.google.gwt.event.dom.client.ClickHandler;
21
import com.google.gwt.event.dom.client.ClickHandler;
-
 
22
import com.google.gwt.event.dom.client.HasClickHandlers;
24
import com.google.gwt.event.dom.client.HasClickHandlers;
23
import com.google.gwt.user.client.ui.HTMLPanel;
25
import com.google.gwt.user.client.ui.HasWidgets;
24
import com.google.gwt.user.client.ui.HasWidgets;
Line 26... Line 25...
26
import com.google.gwt.user.client.ui.IsWidget;
25
import com.google.gwt.user.client.ui.IsWidget;
Line 27... Line 26...
27
 
26
 
28
public class ResultatRechercheImagePresenteur {
27
public class ResultatRechercheImagePresenteur {
Line 29... Line 28...
29
 
28
 
Line 30... Line -...
30
	public interface Vue extends IsWidget {
-
 
31
		public void startChargement();
-
 
32
 
29
	public interface Vue extends IsWidget {
Line 33... Line 30...
33
		public void nettoyer();
30
		public void startChargement();
Line 34... Line 31...
34
 
31
 
Line 49... Line 46...
49
		public HasClickHandlers getTriParNbVotesDescendant();
46
		public HasClickHandlers getTriParNbVotesDescendant();
Line 50... Line 47...
50
 
47
 
Line 51... Line 48...
51
		public HasClickHandlers getTriParDateAscendant();
48
		public HasClickHandlers getTriParDateAscendant();
-
 
49
 
-
 
50
		public HasClickHandlers getTriParDateDescendant();
-
 
51
 
-
 
52
		public void afficherElementsAucunResultatTrouve();
-
 
53
 
-
 
54
		public void afficherElementsResultatsTrouve();
52
 
55
 
Line 53... Line 56...
53
		public HasClickHandlers getTriParDateDescendant();
56
		public HTMLPanel getImageTable();
54
	}
57
	}
55
 
-
 
56
	// new ResultatRechercheImageVue();
58
 
Line 57... Line 59...
57
	private Vue vue;
59
	// new ResultatRechercheImageVue();
58
	private List<ImagePresenteur> ImagePresenteurs = new ArrayList<ImagePresenteur>();
60
	private Vue vue;
59
	private ImageService imageService;
61
	private ImageService imageService;
Line 165... Line 167...
165
 
167
 
Line 166... Line 168...
166
	public void afficherImages(ImageServiceResultat imageServiceResult) {
168
	public void afficherImages(ImageServiceResultat imageServiceResult) {
Line 167... Line -...
167
 
-
 
168
		List<Image> images = imageServiceResult.getImages();
-
 
169
 
-
 
170
		List<HasWidgets> panneauxImagesAffichees = new ArrayList<HasWidgets>();
-
 
171
		vue.creerPanneauxObservations(imageServiceResult.getImages().size());
169
 
172
 
170
		List<Image> images = imageServiceResult.getImages();
173
		Iterator<HasWidgets> panelIterator = vue.getPanneauxImages().iterator();
-
 
174
		for (Image image : images) {
-
 
175
			HasWidgets imagePanel = panelIterator.next();
-
 
176
			ImagePresenteur imagePresenteur = new ImagePresenteur(image, CacheClient.getInstance().getProtocoleCourant(), new ImageVue());
-
 
177
			imagePresenteur.go(imagePanel);
171
 
Line -... Line 172...
-
 
172
		if (images == null || images.size() == 0) {
178
			panneauxImagesAffichees.add(imagePanel);
173
			vue.afficherElementsAucunResultatTrouve();
-
 
174
		}
-
 
175
 
-
 
176
		else {
-
 
177
			vue.afficherElementsResultatsTrouve();
-
 
178
			for (Image image : images) {
179
			ImagePresenteurs.add(imagePresenteur);
179
				ImagePresenteur imagePresenteur = new ImagePresenteur(image, CacheClient.getInstance().getProtocoleCourant(), new ImageVue());
180
		}
180
				imagePresenteur.go(vue.getImageTable());
Line 181... Line 181...
181
 
181
			}