Line 6... |
Line 6... |
6 |
import java.util.Iterator;
|
6 |
import java.util.Iterator;
|
7 |
import java.util.List;
|
7 |
import java.util.List;
|
Line 8... |
Line 8... |
8 |
|
8 |
|
9 |
import org.tela_botanica.del.client.exceptions.ExceptionClient;
|
9 |
import org.tela_botanica.del.client.exceptions.ExceptionClient;
|
10 |
import org.tela_botanica.del.client.modeles.Observation;
|
- |
|
11 |
import org.tela_botanica.del.client.modeles.ObservationDetermination;
|
10 |
import org.tela_botanica.del.client.modeles.Observation;
|
Line 12... |
Line 11... |
12 |
import org.tela_botanica.del.client.modeles.ObservationValidation;
|
11 |
import org.tela_botanica.del.client.modeles.ObservationValidation;
|
13 |
|
12 |
|
Line 14... |
Line 13... |
14 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
13 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
Line 15... |
Line 14... |
15 |
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
14 |
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
Line 16... |
Line 15... |
16 |
|
15 |
|
Line 17... |
Line 16... |
17 |
public class MockDatasource {
|
16 |
public class MockDatasource extends GwtObservable {
|
Line 18... |
Line -... |
18 |
|
- |
|
19 |
static MockDatasource instance;
|
- |
|
20 |
|
17 |
|
Line 21... |
Line 18... |
21 |
List<Observation> observations = new ArrayList<Observation>();
|
18 |
static MockDatasource instance;
|
Line 22... |
Line 19... |
22 |
|
19 |
|
Line 76... |
Line 73... |
76 |
|
73 |
|
77 |
observations.add(observation);
|
74 |
observations.add(observation);
|
Line 78... |
Line 75... |
78 |
}
|
75 |
}
|
- |
|
76 |
|
79 |
|
77 |
ObservationValidation observationValidationData = new ObservationValidation();
|
80 |
ObservationValidation observationValidationData = new ObservationValidation();
|
78 |
observationValidationData.setEspece("Espece 1");
|
81 |
observationValidationData.setContributor("contributeur test");
|
79 |
observationValidationData.setContributeur("contributeur test");
|
82 |
observationValidationData.setId("1");
|
80 |
observationValidationData.setId("1");
|
- |
|
81 |
observationValidationData.setIdImage("id image 1");
|
83 |
observationValidationData.setIdImage("id image 1");
|
82 |
observationValidationData.setVote(4);
|
84 |
observationValidationData.setVote(4);
|
83 |
observationValidationData.setPourcentageConfiance(90);
|
Line 85... |
Line 84... |
85 |
observationValidationData.setDate(new Date());
|
84 |
observationValidationData.setDate(new Date());
|
86 |
observationValidationDatas.add(observationValidationData);
|
85 |
observationValidationDatas.add(observationValidationData);
|
87 |
|
86 |
|
88 |
ObservationValidation observationValidationData2 = new ObservationValidation();
|
87 |
ObservationValidation observationValidationData2 = new ObservationValidation();
|
89 |
observationValidationData2.setContributor("contributeur test 2");
|
88 |
observationValidationData2.setContributeur("contributeur test 2");
|
- |
|
89 |
observationValidationData2.setId("2");
|
90 |
observationValidationData2.setId("2");
|
90 |
observationValidationData2.setIdImage("id image 1");
|
91 |
observationValidationData2.setIdImage("id image 1");
|
91 |
observationValidationData2.setVote(2);
|
Line 92... |
Line 92... |
92 |
observationValidationData2.setVote(2);
|
92 |
observationValidationData2.setPourcentageConfiance(50);
|
93 |
observationValidationData2.setDate(new Date());
|
93 |
observationValidationData2.setDate(new Date());
|
94 |
observationValidationDatas.add(observationValidationData2);
|
94 |
observationValidationDatas.add(observationValidationData2);
|
95 |
|
95 |
|
96 |
ObservationDetermination observationDeterminationData1 = new ObservationDetermination();
|
96 |
ObservationValidation observationValidationData3 = new ObservationValidation();
|
97 |
observationDeterminationData1.setEspece("Acer monsp. L.");
|
97 |
observationValidationData3.setEspece("Acer monsp. L.");
|
- |
|
98 |
observationValidationData3.setContributeur("Léo Ferré");
|
98 |
observationDeterminationData1.setContributeur("Léo Ferré");
|
99 |
observationValidationData3.setCommentaire("Avec le temps...");
|
99 |
observationDeterminationData1.setCommentaire("Avec le temps...");
|
100 |
observationValidationData3.setId("1");
|
100 |
observationDeterminationData1.setId("1");
|
101 |
observationValidationData3.setIdImage("id image 1");
|
101 |
observationDeterminationData1.setIdImage("id image 1");
|
102 |
observationValidationData2.setVote(3);
|
102 |
observationDeterminationData1.setPourcentageConfiance(90);
|
103 |
observationValidationData3.setPourcentageConfiance(90);
|
103 |
observationDeterminationData1.setDateCommentaire("12/01/2011");
|
104 |
observationValidationData3.setDate(new Date());
|
104 |
observationDeterminationDatas.add(observationDeterminationData1);
|
105 |
observationValidationDatas.add(observationValidationData3);
|
105 |
|
106 |
|
106 |
ObservationDetermination observationDeterminationData2 = new ObservationDetermination();
|
107 |
ObservationValidation observationValidationData4 = new ObservationValidation();
|
107 |
observationDeterminationData2.setEspece("Acer aceras aus.");
|
108 |
observationValidationData4.setEspece("Acer aceras aus.");
|
- |
|
109 |
observationValidationData4.setContributeur("Pierre Desproges");
|
108 |
observationDeterminationData2.setContributeur("Pierre Desproges");
|
110 |
observationValidationData4.setCommentaire("Public chéri mon amour !");
|
109 |
observationDeterminationData2.setCommentaire("Public chéri mon amour !");
|
111 |
observationValidationData4.setId("2");
|
110 |
observationDeterminationData2.setId("2");
|
112 |
observationValidationData4.setIdImage("id image 1");
|
111 |
observationDeterminationData2.setIdImage("id image 1");
|
113 |
observationValidationData2.setVote(1);
|
112 |
observationDeterminationData2.setPourcentageConfiance(30);
|
114 |
observationValidationData4.setPourcentageConfiance(30);
|
113 |
observationDeterminationData2.setDateCommentaire("05/09/2011");
|
115 |
observationValidationData4.setDate(new Date());
|
114 |
observationDeterminationDatas.add(observationDeterminationData2);
|
116 |
observationValidationDatas.add(observationValidationData4);
|
115 |
|
117 |
|
116 |
ObservationDetermination observationDeterminationData3 = new ObservationDetermination();
|
118 |
ObservationValidation observationValidationData5 = new ObservationValidation();
|
117 |
observationDeterminationData3.setEspece("Acer monsp subsp. monsp.");
|
119 |
observationValidationData5.setEspece("Acer monsp subsp. monsp.");
|
- |
|
120 |
observationValidationData5.setContributeur("Louis Aragon");
|
118 |
observationDeterminationData3.setContributeur("Louis Aragon");
|
121 |
observationValidationData5.setCommentaire("Tout est affaire de décor");
|
119 |
observationDeterminationData3.setCommentaire("Tout est affaire de décor");
|
122 |
observationValidationData5.setId("2");
|
120 |
observationDeterminationData3.setId("2");
|
123 |
observationValidationData5.setIdImage("id image 1");
|
Line 121... |
Line 124... |
121 |
observationDeterminationData3.setIdImage("id image 1");
|
124 |
observationValidationData2.setVote(2);
|
122 |
observationDeterminationData3.setPourcentageConfiance(50);
|
125 |
observationValidationData5.setPourcentageConfiance(50);
|
123 |
observationDeterminationData3.setDateCommentaire("14/08/2011");
|
126 |
observationValidationData5.setDate(new Date());
|
124 |
observationDeterminationDatas.add(observationDeterminationData3);
|
127 |
observationValidationDatas.add(observationValidationData5);
|
Line 137... |
Line 140... |
137 |
public List<ObservationValidation> getValidationData(String idImage) {
|
140 |
public List<ObservationValidation> getValidationData(String idImage) {
|
Line 138... |
Line 141... |
138 |
|
141 |
|
139 |
return observationValidationDatas;
|
142 |
return observationValidationDatas;
|
Line 140... |
Line -... |
140 |
}
|
- |
|
141 |
|
- |
|
142 |
public List<ObservationDetermination> getDeterminationData(String idImage) {
|
- |
|
143 |
|
- |
|
144 |
return observationDeterminationDatas;
|
- |
|
145 |
}
|
143 |
}
|
Line 146... |
Line 144... |
146 |
|
144 |
|
147 |
public ArrayList<String> getPropositionsTaxonsData(String idImage) {
|
145 |
public ArrayList<String> getPropositionsTaxonsData(String idImage) {
|
Line 156... |
Line 154... |
156 |
public List<Observation> getObservationsEfloreParTaxon(String nomTaxon) {
|
154 |
public List<Observation> getObservationsEfloreParTaxon(String nomTaxon) {
|
157 |
return observations;
|
155 |
return observations;
|
158 |
}
|
156 |
}
|
Line 159... |
Line 157... |
159 |
|
157 |
|
160 |
public void saveValidationData(ObservationValidation validationData) throws ExceptionClient {
|
- |
|
- |
|
158 |
public void saveValidationData(ObservationValidation validationData) throws ExceptionClient {
|
- |
|
159 |
observationValidationDatas.add(validationData);
|
161 |
|
160 |
notifyObservers();
|
Line 162... |
Line 161... |
162 |
}
|
161 |
}
|
163 |
|
162 |
|
164 |
public static MockDatasource getInstance() {
|
163 |
public static MockDatasource getInstance() {
|