Subversion Repositories eFlore/Applications.del

Rev

Rev 9 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 14
Line 1... Line 1...
1
package org.tela_botanica.del.client.vues.searchobservations;
1
package org.tela_botanica.del.client.vues.rechercheobservations;
Line 2... Line 2...
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.Iterator;
4
import java.util.Iterator;
Line 5... Line 5...
5
import java.util.List;
5
import java.util.List;
6
 
6
 
7
import org.tela_botanica.del.client.modeles.Observation;
7
import org.tela_botanica.del.client.modeles.Observation;
8
import org.tela_botanica.del.client.utils.KeyboardKeyListener;
8
import org.tela_botanica.del.client.utils.KeyboardKeyListener;
Line 9... Line 9...
9
import org.tela_botanica.del.client.utils.MockDatasource;
9
import org.tela_botanica.del.client.utils.MockDatasource;
10
import org.tela_botanica.del.client.vues.searchobservations.pagination.NumberPagePresenter;
10
import org.tela_botanica.del.client.vues.rechercheobservations.pagination.NumeroPagePresenteur;
11
 
11
 
12
import com.google.gwt.event.dom.client.ClickEvent;
12
import com.google.gwt.event.dom.client.ClickEvent;
13
import com.google.gwt.event.dom.client.ClickHandler;
13
import com.google.gwt.event.dom.client.ClickHandler;
Line 14... Line 14...
14
import com.google.gwt.user.client.ui.HasWidgets;
14
import com.google.gwt.user.client.ui.HasWidgets;
Line 15... Line 15...
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.VerticalPanel;
16
import com.google.gwt.user.client.ui.VerticalPanel;
Line 17... Line 17...
17
 
17
 
Line 18... Line 18...
18
public class ObservationSearchPresenter {
18
public class ObservationRecherchePresenteur {
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
	private final MockDatasource observationService = MockDatasource
20
	private final MockDatasource observationService = MockDatasource
21
			.getInstance();
21
			.getInstance();
22
 
22
 
Line 23... Line 23...
23
	private final ObservationSearchView view = new ObservationSearchView();
23
	private final ObservationRechercheVue view = new ObservationRechercheVue();
24
 
24
 
Line 77... Line 77...
77
 
77
 
78
		view.showImagePanels(0, view.getNbImagesPerPage());
78
		view.showImagePanels(0, view.getNbImagesPerPage());
79
		Iterator<Panel> panelIterator = imagePanels.iterator();
79
		Iterator<Panel> panelIterator = imagePanels.iterator();
80
		for (Observation observation : observations) {
80
		for (Observation observation : observations) {
81
			Panel imagePanel = panelIterator.next();
81
			Panel imagePanel = panelIterator.next();
82
			new ObservationPresenter(observation).go(imagePanel);
82
			new ObservationPresenteur(observation).go(imagePanel);
Line 83... Line 83...
83
		}
83
		}
Line 84... Line 84...
84
 
84
 
Line 93... Line 93...
93
		int nbPages = nbImages / view.getNbImagesPerPage();
93
		int nbPages = nbImages / view.getNbImagesPerPage();
94
		if (nbImages % view.getNbImagesPerPage() == 0) {
94
		if (nbImages % view.getNbImagesPerPage() == 0) {
95
			nbPages--;
95
			nbPages--;
96
		}
96
		}
97
		for (int i = 0; i <= nbPages; i++) {
97
		for (int i = 0; i <= nbPages; i++) {
98
			new NumberPagePresenter(i + 1).go(view.getPaginationPanel());
98
			new NumeroPagePresenteur(i + 1).go(view.getPaginationPanel());
99
		}
99
		}
100
	}
100
	}
Line 101... Line 101...
101
 
101
 
102
	public void showImagePanels(int first, int last) {
102
	public void showImagePanels(int first, int last) {
103
		view.showImagePanels(first, last);
103
		view.showImagePanels(first, last);
Line 104... Line 104...
104
	}
104
	}
105
 
105
 
106
	public static ObservationSearchPresenter getInstance() {
106
	public static ObservationRecherchePresenteur getInstance() {
Line 107... Line 107...
107
		return instance;
107
		return instance;
108
	}
108
	}
109
 
109
 
Line 110... Line 110...
110
	public ObservationSearchView getView() {
110
	public ObservationRechercheVue getView() {
111
		return view;
111
		return view;