Line 1... |
Line 1... |
1 |
package org.tela_botanica.client.vues.collection;
|
1 |
package org.tela_botanica.client.vues.collection;
|
Line 2... |
Line 2... |
2 |
|
2 |
|
- |
|
3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
4 |
import java.util.HashMap;
|
4 |
import java.util.Iterator;
|
5 |
import java.util.Iterator;
|
Line 5... |
Line 6... |
5 |
import java.util.List;
|
6 |
import java.util.List;
|
6 |
|
7 |
|
Line 14... |
Line 15... |
14 |
import org.tela_botanica.client.modeles.InterneValeur;
|
15 |
import org.tela_botanica.client.modeles.InterneValeur;
|
15 |
import org.tela_botanica.client.modeles.UniteBase;
|
16 |
import org.tela_botanica.client.modeles.UniteBase;
|
16 |
import org.tela_botanica.client.modeles.UniteRangement;
|
17 |
import org.tela_botanica.client.modeles.UniteRangement;
|
17 |
import org.tela_botanica.client.modeles.Valeur;
|
18 |
import org.tela_botanica.client.modeles.Valeur;
|
18 |
import org.tela_botanica.client.modeles.ValeurListe;
|
19 |
import org.tela_botanica.client.modeles.ValeurListe;
|
- |
|
20 |
import org.tela_botanica.client.modeles.aDonnee;
|
- |
|
21 |
import org.tela_botanica.client.modeles.collection.Collection;
|
- |
|
22 |
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
|
- |
|
23 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
|
- |
|
24 |
import org.tela_botanica.client.util.Debug;
|
- |
|
25 |
import org.tela_botanica.client.util.Pattern;
|
- |
|
26 |
import org.tela_botanica.client.util.UtilNombre;
|
- |
|
27 |
import org.tela_botanica.client.util.UtilString;
|
19 |
import org.tela_botanica.client.vues.Formulaire;
|
28 |
import org.tela_botanica.client.vues.Formulaire;
|
20 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
29 |
import org.tela_botanica.client.vues.FormulaireOnglet;
|
Line 21... |
Line 30... |
21 |
|
30 |
|
22 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
31 |
import com.extjs.gxt.ui.client.Style.Scroll;
|
Line 37... |
Line 46... |
37 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
46 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
38 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
47 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
39 |
import com.extjs.gxt.ui.client.widget.grid.AggregationRowConfig;
|
48 |
import com.extjs.gxt.ui.client.widget.grid.AggregationRowConfig;
|
40 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
49 |
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
|
41 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
50 |
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
- |
|
51 |
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
|
42 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
52 |
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
43 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
53 |
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
|
44 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
54 |
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
- |
|
55 |
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
|
45 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
56 |
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
|
46 |
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
|
57 |
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
|
47 |
import com.extjs.gxt.ui.client.widget.grid.SummaryType;
|
58 |
import com.extjs.gxt.ui.client.widget.grid.SummaryType;
|
48 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
59 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
49 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
60 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
Line 53... |
Line 64... |
53 |
import com.google.gwt.core.client.GWT;
|
64 |
import com.google.gwt.core.client.GWT;
|
54 |
import com.google.gwt.i18n.client.NumberFormat;
|
65 |
import com.google.gwt.i18n.client.NumberFormat;
|
Line 55... |
Line 66... |
55 |
|
66 |
|
Line -... |
Line 67... |
- |
|
67 |
public class CollectionFormDescription extends FormulaireOnglet implements Rafraichissable {
|
- |
|
68 |
|
- |
|
69 |
private Collection collection = null;
|
- |
|
70 |
private CollectionBotanique collectionBotanique = null;
|
- |
|
71 |
private Collection collectionCollectee = null;
|
56 |
public class CollectionFormDescription extends FormulaireOnglet implements Rafraichissable {
|
72 |
private CollectionBotanique collectionBotaniqueCollectee = null;
|
57 |
|
73 |
|
58 |
private ChampComboBoxListeValeurs typesCollectionBotaCombo = null;
|
74 |
private ChampComboBoxListeValeurs typesCollectionBotaCombo = null;
|
59 |
private NumberField nbreEchantillonChp = null;
|
75 |
private NumberField nbreEchantillonChp = null;
|
60 |
private Grid<UniteRangement> uniteRangementGrille = null;
|
76 |
private EditorGrid<UniteRangement> uniteRangementGrille = null;
|
61 |
private ChampComboBoxListeValeurs etatUniteRangementCombo = null;
|
77 |
private ChampComboBoxListeValeurs etatUniteRangementCombo = null;
|
62 |
private Grid<UniteBase> uniteBaseGrille = null;
|
78 |
private EditorGrid<UniteBase> uniteBaseGrille = null;
|
63 |
private ChampCaseACocher typePapierConservationChp = null;
|
79 |
private ChampCaseACocher typePapierConservationChp = null;
|
64 |
private ChampCaseACocher methodeConservationChp = null;
|
80 |
private ChampCaseACocher methodeConservationChp = null;
|
65 |
private ChampSliderPourcentage specimenFixationPourcentChp = null;
|
81 |
private ChampSliderPourcentage specimenFixationPourcentChp = null;
|
Line 73... |
Line 89... |
73 |
private ChampCaseACocher insecteTraitementChp = null;
|
89 |
private ChampCaseACocher insecteTraitementChp = null;
|
74 |
private ChampComboBoxListeValeurs etatGeneralCombo = null;
|
90 |
private ChampComboBoxListeValeurs etatGeneralCombo = null;
|
75 |
private ChampComboBoxListeValeurs determinationCombo = null;
|
91 |
private ChampComboBoxListeValeurs determinationCombo = null;
|
76 |
private ChampMultiValeursMultiTypes specimenDegradationChp = null;
|
92 |
private ChampMultiValeursMultiTypes specimenDegradationChp = null;
|
77 |
private ChampMultiValeursMultiTypes presentationDegradationChp = null;
|
93 |
private ChampMultiValeursMultiTypes presentationDegradationChp = null;
|
- |
|
94 |
private ComboBox<InterneValeur> precisionCombo;
|
Line 78... |
Line 95... |
78 |
|
95 |
|
79 |
public CollectionFormDescription(Formulaire formulaireCourrant) {
|
96 |
public CollectionFormDescription(Formulaire formulaireCourrant) {
|
80 |
initialiserOnglet(formulaireCourrant);
|
97 |
initialiserOnglet(formulaireCourrant);
|
81 |
setId("description");
|
98 |
setId("description");
|
Line 139... |
Line 156... |
139 |
panneau.setStyleAttribute("margin", "5px 0");
|
156 |
panneau.setStyleAttribute("margin", "5px 0");
|
Line 140... |
Line 157... |
140 |
|
157 |
|
141 |
return panneau;
|
158 |
return panneau;
|
Line 142... |
Line 159... |
142 |
}
|
159 |
}
|
143 |
|
160 |
|
Line 144... |
Line 161... |
144 |
private Grid<UniteRangement> creerGrilleUniteRangement() {
|
161 |
private EditorGrid<UniteRangement> creerGrilleUniteRangement() {
|
145 |
ListStore<UniteRangement> storeGrille = new ListStore<UniteRangement>();
|
162 |
ListStore<UniteRangement> storeGrille = new ListStore<UniteRangement>();
|
Line 146... |
Line 163... |
146 |
|
163 |
|
147 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
164 |
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
|
148 |
colonnes.add(new ColumnConfig("type", i18nC.collectionUniteType(), 150));
|
- |
|
Line 149... |
Line 165... |
149 |
|
165 |
colonnes.add(new ColumnConfig("type", i18nC.collectionUniteType(), 150));
|
150 |
NumberField champNombre = new NumberField();
|
166 |
|
- |
|
167 |
NumberField champNombre = new NumberField();
|
151 |
champNombre.setFormat(NumberFormat.getFormat("#"));
|
168 |
champNombre.setFormat(NumberFormat.getFormat("#"));
|
Line 152... |
Line 169... |
152 |
CellEditor editeurNombre = new CellEditor(champNombre);
|
169 |
|
153 |
|
170 |
ColumnConfig nombreColonne = new ColumnConfig("nombre", i18nC.collectionUniteNbre(), 50);
|
154 |
ColumnConfig nombreColonne = new ColumnConfig("nombre", i18nC.collectionUniteNbre(), 50);
|
171 |
nombreColonne.setEditor(new CellEditor(champNombre));
|
Line 155... |
Line 172... |
155 |
nombreColonne.setEditor(editeurNombre);
|
172 |
nombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
156 |
colonnes.add(nombreColonne);
|
173 |
colonnes.add(nombreColonne);
|
157 |
|
174 |
|
158 |
ListStore<InterneValeur> precisionStore = new ListStore<InterneValeur>();
|
175 |
ListStore<InterneValeur> precisionStore = new ListStore<InterneValeur>();
|
159 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, i18nC.precisionApproximatif()));
|
176 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, i18nC.precisionApproximatif()));
|
160 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, i18nC.precisionExact()));
|
177 |
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, i18nC.precisionExact()));
|
Line 188... |
Line 205... |
188 |
InterneValeur valeurInterne = (InterneValeur) valeur;
|
205 |
InterneValeur valeurInterne = (InterneValeur) valeur;
|
189 |
retour = valeurInterne.getNom();
|
206 |
retour = valeurInterne.getNom();
|
190 |
}
|
207 |
}
|
191 |
}
|
208 |
}
|
192 |
return retour;
|
209 |
return retour;
|
193 |
}
|
210 |
}
|
194 |
};
|
211 |
};
|
Line 195... |
Line 212... |
195 |
|
212 |
|
196 |
ColumnConfig precisionColonne = new ColumnConfig("precision", i18nC.collectionUnitePrecision(), 50);
|
213 |
ColumnConfig precisionColonne = new ColumnConfig("precision", i18nC.collectionUnitePrecision(), 50);
|
197 |
precisionColonne.setEditor(editeurPrecision);
|
214 |
precisionColonne.setEditor(editeurPrecision);
|
Line 205... |
Line 222... |
205 |
colonnes.add(formatColonne);
|
222 |
colonnes.add(formatColonne);
|
Line 206... |
Line 223... |
206 |
|
223 |
|
207 |
GridSelectionModel<UniteRangement> modeleDeSelection = new GridSelectionModel<UniteRangement>();
|
224 |
GridSelectionModel<UniteRangement> modeleDeSelection = new GridSelectionModel<UniteRangement>();
|
Line -... |
Line 225... |
- |
|
225 |
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
|
- |
|
226 |
|
- |
|
227 |
AggregationRowConfig<UniteBase> total = new AggregationRowConfig<UniteBase>();
|
- |
|
228 |
total.setHtml("type", "TOTAL");
|
- |
|
229 |
total.setSummaryType("nombre", SummaryType.SUM);
|
- |
|
230 |
total.setSummaryFormat("nombre", NumberFormat.getFormat("#"));
|
208 |
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
|
231 |
modeleDeColonnes.addAggregationRow(total);
|
209 |
|
232 |
|
210 |
EditorGrid<UniteRangement> grilleUniteRangement = new EditorGrid<UniteRangement>(storeGrille, modeleDeColonnes);
|
233 |
EditorGrid<UniteRangement> grilleUniteRangement = new EditorGrid<UniteRangement>(storeGrille, modeleDeColonnes);
|
211 |
grilleUniteRangement.setHeight(300);
|
234 |
grilleUniteRangement.setHeight(300);
|
212 |
grilleUniteRangement.setBorders(true);
|
235 |
grilleUniteRangement.setBorders(true);
|
Line 218... |
Line 241... |
218 |
grilleUniteRangement.setTrackMouseOver(true);
|
241 |
grilleUniteRangement.setTrackMouseOver(true);
|
Line 219... |
Line 242... |
219 |
|
242 |
|
220 |
return grilleUniteRangement;
|
243 |
return grilleUniteRangement;
|
Line -... |
Line 244... |
- |
|
244 |
}
|
- |
|
245 |
|
- |
|
246 |
private String collecterGrilleUniteRangement() {
|
- |
|
247 |
String truk = "";
|
- |
|
248 |
int nbreUnite = uniteRangementGrille.getStore().getCount();
|
- |
|
249 |
for (int i = 0; i < nbreUnite; i++) {
|
- |
|
250 |
UniteRangement unite = uniteRangementGrille.getStore().getAt(i);
|
- |
|
251 |
truk += unite.getId()+aDonnee.SEPARATEUR_TYPE_VALEUR;
|
- |
|
252 |
truk += UtilNombre.formaterEnEntier(unite.getNombre())+aDonnee.SEPARATEUR_DONNEES;
|
- |
|
253 |
String precision = "";
|
- |
|
254 |
InterneValeur precisionValeur = precisionCombo.getStore().findModel("nom", unite.getPrecision());
|
- |
|
255 |
if (precisionValeur != null) {
|
- |
|
256 |
precision = precisionValeur.getAbr();
|
- |
|
257 |
}
|
- |
|
258 |
truk += precision+aDonnee.SEPARATEUR_DONNEES;
|
- |
|
259 |
truk += unite.getFormat();
|
- |
|
260 |
truk += (i == (nbreUnite - 1)) ? "" : aDonnee.SEPARATEUR_VALEURS;
|
- |
|
261 |
}
|
- |
|
262 |
return truk;
|
- |
|
263 |
}
|
- |
|
264 |
|
- |
|
265 |
private void peuplerGrilleUniteRangement(String valeurTruk) {
|
- |
|
266 |
if (!UtilString.isEmpty(valeurTruk)) {
|
- |
|
267 |
HashMap<String,UniteRangement> unitesEnregistrees = new HashMap<String,UniteRangement>();
|
- |
|
268 |
String[] unites = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
|
- |
|
269 |
for (int i = 0; i < unites.length; i++) {
|
- |
|
270 |
String[] uniteTypeIdDonnees = unites[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
|
- |
|
271 |
String uniteChaineDonnees = uniteTypeIdDonnees[1];
|
- |
|
272 |
String[] uniteDonnees = uniteChaineDonnees.split(Pattern.quote(aDonnee.SEPARATEUR_DONNEES));
|
- |
|
273 |
|
- |
|
274 |
UniteRangement uniteRangement = new UniteRangement();
|
- |
|
275 |
uniteRangement.setId(uniteTypeIdDonnees[0]);
|
- |
|
276 |
if (uniteDonnees.length > 0) {
|
- |
|
277 |
uniteRangement.setNombre(UtilString.formaterEnDouble(uniteDonnees[0]));
|
- |
|
278 |
}
|
- |
|
279 |
if (uniteDonnees.length > 1) {
|
- |
|
280 |
uniteRangement.setPrecision(uniteDonnees[1]);
|
- |
|
281 |
}
|
- |
|
282 |
if (uniteDonnees.length > 2) {
|
- |
|
283 |
uniteRangement.setFormat(uniteDonnees[2]);
|
- |
|
284 |
Debug.log(uniteTypeIdDonnees[0]+"/"+uniteTypeIdDonnees[1]+"/"+uniteDonnees[0]+"-"+uniteDonnees[1]+"-"+uniteDonnees[2]);
|
- |
|
285 |
}
|
- |
|
286 |
unitesEnregistrees.put(uniteTypeIdDonnees[0], uniteRangement);
|
- |
|
287 |
}
|
- |
|
288 |
|
- |
|
289 |
ArrayList<UniteRangement> listeUniteMaj = new ArrayList<UniteRangement>();
|
- |
|
290 |
int nbreUnite = uniteRangementGrille.getStore().getCount();
|
- |
|
291 |
for (int i = 0; i < nbreUnite; i++) {
|
- |
|
292 |
UniteRangement uniteDansGrille = uniteRangementGrille.getStore().getAt(i);
|
- |
|
293 |
UniteRangement uniteEnregistree = unitesEnregistrees.get(uniteDansGrille.getId());
|
- |
|
294 |
if (uniteEnregistree != null) {
|
- |
|
295 |
listeUniteMaj.add(uniteEnregistree);
|
- |
|
296 |
} else {
|
- |
|
297 |
listeUniteMaj.add(uniteDansGrille);
|
- |
|
298 |
}
|
- |
|
299 |
}
|
- |
|
300 |
uniteRangementGrille.getStore().removeAll();
|
- |
|
301 |
uniteRangementGrille.getStore().add(listeUniteMaj);
|
- |
|
302 |
layout();
|
- |
|
303 |
}
|
221 |
}
|
304 |
}
|
222 |
|
305 |
|
Line 223... |
Line 306... |
223 |
private ToolBar creerBarreOutilsGrilleUniteRangement() {
|
306 |
private ToolBar creerBarreOutilsGrilleUniteRangement() {
|
224 |
ToolBar barreOutils = new ToolBar();
|
307 |
ToolBar barreOutils = new ToolBar();
|
Line 293... |
Line 376... |
293 |
panneauGrille.setTopComponent(barreOutils);
|
376 |
panneauGrille.setTopComponent(barreOutils);
|
Line 294... |
Line 377... |
294 |
|
377 |
|
295 |
add(panneauGrille);
|
378 |
add(panneauGrille);
|
Line 296... |
Line 379... |
296 |
}
|
379 |
}
|
297 |
|
380 |
|
Line 298... |
Line 381... |
298 |
private Grid<UniteBase> creerGrilleUniteBase() {
|
381 |
private EditorGrid<UniteBase> creerGrilleUniteBase() {
|
299 |
ListStore<UniteBase> storeGrille = new ListStore<UniteBase>();
|
382 |
ListStore<UniteBase> storeGrille = new ListStore<UniteBase>();
|
Line 305... |
Line 388... |
305 |
champNombre.setFormat(NumberFormat.getFormat("#"));
|
388 |
champNombre.setFormat(NumberFormat.getFormat("#"));
|
306 |
CellEditor editeurNombre = new CellEditor(champNombre);
|
389 |
CellEditor editeurNombre = new CellEditor(champNombre);
|
Line 307... |
Line 390... |
307 |
|
390 |
|
308 |
ColumnConfig nombreColonne = new ColumnConfig("nombre", i18nC.collectionUniteNbre(), 50);
|
391 |
ColumnConfig nombreColonne = new ColumnConfig("nombre", i18nC.collectionUniteNbre(), 50);
|
- |
|
392 |
nombreColonne.setEditor(editeurNombre);
|
309 |
nombreColonne.setEditor(editeurNombre);
|
393 |
nombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
Line 310... |
Line 394... |
310 |
colonnes.add(nombreColonne);
|
394 |
colonnes.add(nombreColonne);
|
311 |
|
395 |
|
312 |
ListStore<InterneValeur> precisionStore = new ListStore<InterneValeur>();
|
396 |
ListStore<InterneValeur> precisionStore = new ListStore<InterneValeur>();
|
Line 358... |
Line 442... |
358 |
formatColonne.setEditor(new CellEditor(formatChp));
|
442 |
formatColonne.setEditor(new CellEditor(formatChp));
|
359 |
colonnes.add(formatColonne);
|
443 |
colonnes.add(formatColonne);
|
Line 360... |
Line 444... |
360 |
|
444 |
|
361 |
ColumnConfig partNombreColonne = new ColumnConfig("nombre_part", i18nC.collectionUniteNbre(), 50);
|
445 |
ColumnConfig partNombreColonne = new ColumnConfig("nombre_part", i18nC.collectionUniteNbre(), 50);
|
- |
|
446 |
partNombreColonne.setEditor(editeurNombre);
|
362 |
partNombreColonne.setEditor(editeurNombre);
|
447 |
partNombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
Line 363... |
Line 448... |
363 |
colonnes.add(partNombreColonne);
|
448 |
colonnes.add(partNombreColonne);
|
364 |
|
449 |
|
365 |
ColumnConfig partPrecisionColonne = new ColumnConfig("precision_part", i18nC.collectionUnitePrecision(), 50);
|
450 |
ColumnConfig partPrecisionColonne = new ColumnConfig("precision_part", i18nC.collectionUnitePrecision(), 50);
|
Line 366... |
Line 451... |
366 |
partPrecisionColonne.setEditor(editeurPrecision);
|
451 |
partPrecisionColonne.setEditor(editeurPrecision);
|
367 |
colonnes.add(partPrecisionColonne);
|
452 |
colonnes.add(partPrecisionColonne);
|
- |
|
453 |
|
368 |
|
454 |
ColumnConfig spNombreColonne = new ColumnConfig("nombre_sp", i18nC.collectionUniteNbre(), 50);
|
Line 369... |
Line 455... |
369 |
ColumnConfig spNombreColonne = new ColumnConfig("nombre_sp", i18nC.collectionUniteNbre(), 50);
|
455 |
spNombreColonne.setEditor(editeurNombre);
|
370 |
spNombreColonne.setEditor(editeurNombre);
|
456 |
spNombreColonne.setNumberFormat(NumberFormat.getFormat("#"));
|
371 |
colonnes.add(spNombreColonne);
|
457 |
colonnes.add(spNombreColonne);
|
Line 546... |
Line 632... |
546 |
etatFieldSet.add(determinationCombo, new FormData(450, 0));
|
632 |
etatFieldSet.add(determinationCombo, new FormData(450, 0));
|
Line 547... |
Line 633... |
547 |
|
633 |
|
548 |
this.add(etatFieldSet);
|
634 |
this.add(etatFieldSet);
|
Line -... |
Line 635... |
- |
|
635 |
}
|
- |
|
636 |
|
- |
|
637 |
public void peupler() {
|
- |
|
638 |
initialiserCollection();
|
- |
|
639 |
if (collectionBotanique != null) {
|
- |
|
640 |
typesCollectionBotaCombo.peupler(collectionBotanique.getType());
|
- |
|
641 |
if (!UtilString.isEmpty(collectionBotanique.getNbreEchantillon())) {
|
- |
|
642 |
nbreEchantillonChp.setValue(Integer.parseInt(collectionBotanique.getNbreEchantillon()));
|
- |
|
643 |
}
|
- |
|
644 |
peuplerGrilleUniteRangement(collectionBotanique.getUniteRangement());
|
- |
|
645 |
}
|
- |
|
646 |
}
|
- |
|
647 |
|
- |
|
648 |
public void collecter() {
|
- |
|
649 |
initialiserCollection();
|
- |
|
650 |
if (etreAccede()) {
|
- |
|
651 |
collectionBotaniqueCollectee.setType(typesCollectionBotaCombo.getValeur());
|
- |
|
652 |
collectionBotaniqueCollectee.setNbreEchantillon(Integer.toString(nbreEchantillonChp.getValue().intValue()));
|
- |
|
653 |
collectionBotaniqueCollectee.setUniteRangement(collecterGrilleUniteRangement());
|
- |
|
654 |
Debug.log(collecterGrilleUniteRangement());
|
- |
|
655 |
}
|
- |
|
656 |
}
|
- |
|
657 |
|
- |
|
658 |
private void initialiserCollection() {
|
- |
|
659 |
collection = ((CollectionForm) formulaire).collection;
|
- |
|
660 |
if (collection != null) {
|
- |
|
661 |
collectionBotanique = collection.getBotanique();
|
- |
|
662 |
}
|
- |
|
663 |
|
- |
|
664 |
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
|
- |
|
665 |
if (collectionCollectee != null) {
|
- |
|
666 |
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
|
- |
|
667 |
}
|
549 |
}
|
668 |
}
|
550 |
|
669 |
|
551 |
public void rafraichir(Object nouvellesDonnees) {
|
670 |
public void rafraichir(Object nouvellesDonnees) {
|
552 |
if (nouvellesDonnees instanceof ValeurListe) {
|
671 |
if (nouvellesDonnees instanceof ValeurListe) {
|
553 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
672 |
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
|
Line 563... |
Line 682... |
563 |
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteRangement"))) {
|
682 |
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteRangement"))) {
|
564 |
Iterator<String> it = listeValeurs.keySet().iterator();
|
683 |
Iterator<String> it = listeValeurs.keySet().iterator();
|
565 |
while (it.hasNext()) {
|
684 |
while (it.hasNext()) {
|
566 |
Valeur valeur = listeValeurs.get(it.next());
|
685 |
Valeur valeur = listeValeurs.get(it.next());
|
567 |
UniteRangement unite = new UniteRangement();
|
686 |
UniteRangement unite = new UniteRangement();
|
- |
|
687 |
unite.setId(valeur.getId());
|
568 |
unite.setType(valeur.getNom());
|
688 |
unite.setType(valeur.getNom());
|
569 |
unite.setTypeAutre(false);
|
689 |
unite.setTypeAutre(false);
|
570 |
uniteRangementGrille.getStore().add(unite);
|
690 |
uniteRangementGrille.getStore().add(unite);
|
571 |
}
|
691 |
}
|
572 |
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteBase"))) {
|
692 |
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteBase"))) {
|
573 |
Iterator<String> it = listeValeurs.keySet().iterator();
|
693 |
Iterator<String> it = listeValeurs.keySet().iterator();
|
574 |
while (it.hasNext()) {
|
694 |
while (it.hasNext()) {
|
575 |
Valeur valeur = listeValeurs.get(it.next());
|
695 |
Valeur valeur = listeValeurs.get(it.next());
|
576 |
UniteBase unite = new UniteBase();
|
696 |
UniteBase unite = new UniteBase();
|
- |
|
697 |
unite.setId(valeur.getId());
|
577 |
unite.setType(valeur.getNom());
|
698 |
unite.setType(valeur.getNom());
|
578 |
unite.setTypeAutre(false);
|
699 |
unite.setTypeAutre(false);
|
579 |
uniteBaseGrille.getStore().add(unite);
|
700 |
uniteBaseGrille.getStore().add(unite);
|
580 |
}
|
701 |
}
|
581 |
} else {
|
702 |
} else {
|