Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1513 Rev 1680
1
package org.tela_botanica.client.vues.collection;
1
package org.tela_botanica.client.vues.collection;
2
 
2
 
3
import java.util.HashMap;
3
import java.util.HashMap;
4
import java.util.Iterator;
4
import java.util.Iterator;
5
 
5
 
6
import org.tela_botanica.client.Mediateur;
6
import org.tela_botanica.client.Mediateur;
7
import org.tela_botanica.client.composants.ChampCaseACocher;
7
import org.tela_botanica.client.composants.ChampCaseACocher;
8
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
8
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
9
import org.tela_botanica.client.composants.ChampSliderPourcentage;
9
import org.tela_botanica.client.composants.ChampSliderPourcentage;
10
import org.tela_botanica.client.composants.ConteneurMultiChamps;
10
import org.tela_botanica.client.composants.ConteneurMultiChamps;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
11
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import org.tela_botanica.client.modeles.aDonnee;
12
import org.tela_botanica.client.modeles.aDonnee;
13
import org.tela_botanica.client.modeles.collection.Collection;
13
import org.tela_botanica.client.modeles.collection.Collection;
14
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
14
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
15
import org.tela_botanica.client.util.Debug;
15
import org.tela_botanica.client.util.Debug;
16
import org.tela_botanica.client.util.Pattern;
16
import org.tela_botanica.client.util.Pattern;
17
import org.tela_botanica.client.util.UtilDate;
17
import org.tela_botanica.client.util.UtilDate;
18
import org.tela_botanica.client.util.UtilString;
18
import org.tela_botanica.client.util.UtilString;
19
import org.tela_botanica.client.vues.Formulaire;
19
import org.tela_botanica.client.vues.Formulaire;
20
import org.tela_botanica.client.vues.FormulaireOnglet;
20
import org.tela_botanica.client.vues.FormulaireOnglet;
21
 
21
 
22
import com.extjs.gxt.ui.client.util.Margins;
22
import com.extjs.gxt.ui.client.util.Margins;
23
import com.extjs.gxt.ui.client.widget.Text;
23
import com.extjs.gxt.ui.client.widget.Text;
24
import com.extjs.gxt.ui.client.widget.form.DateField;
24
import com.extjs.gxt.ui.client.widget.form.DateField;
25
import com.extjs.gxt.ui.client.widget.form.FieldSet;
25
import com.extjs.gxt.ui.client.widget.form.FieldSet;
26
import com.extjs.gxt.ui.client.widget.form.TextArea;
26
import com.extjs.gxt.ui.client.widget.form.TextArea;
27
import com.extjs.gxt.ui.client.widget.layout.FormData;
27
import com.extjs.gxt.ui.client.widget.layout.FormData;
28
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
28
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
29
 
29
 
30
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
30
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
31
	
31
	
32
	public static final String ID = "contenu";
32
	public static final String ID = "contenu";
33
	private Collection collection = null;
33
	private Collection collection = null;
34
	private CollectionBotanique collectionBotanique = null;
34
	private CollectionBotanique collectionBotanique = null;
35
	private Collection collectionCollectee = null;
35
	private Collection collectionCollectee = null;
36
	private CollectionBotanique collectionBotaniqueCollectee = null;
36
	private CollectionBotanique collectionBotaniqueCollectee = null;
37
	
37
	
38
	private ChampCaseACocher natureChp = null;
38
	private ChampCaseACocher natureChp = null;
39
	private TextArea specialiteChp = null;
39
	private TextArea specialiteChp = null;
40
	private ChampComboBoxListeValeurs dateDebutCombo = null;
40
	private ChampComboBoxListeValeurs dateDebutCombo = null;
41
	private ChampComboBoxListeValeurs dateFinCombo = null;
41
	private ChampComboBoxListeValeurs dateFinCombo = null;
42
	private DateField dateDebutChp = null;
42
	private DateField dateDebutChp = null;
43
	private DateField dateFinChp = null;
43
	private DateField dateFinChp = null;
44
	private TextArea annotationClassementChp = null;
44
	private TextArea annotationClassementChp = null;
45
	private ChampComboBoxListeValeurs etatClassementCombo = null;
45
	private ChampComboBoxListeValeurs etatClassementCombo = null;
46
	private ChampComboBoxListeValeurs precisionDateCombo = null;
46
	private ChampComboBoxListeValeurs precisionDateCombo = null;
47
	private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
47
	private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
48
	private TextArea etiquetteAnnotationChp = null;
48
	private TextArea etiquetteAnnotationChp = null;
49
	private ChampComboBoxListeValeurs integreCollectionCombo = null;
49
	private ChampComboBoxListeValeurs integreCollectionCombo = null;
50
	private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
50
	private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
51
	private ChampSliderPourcentage auteurTitrePourcentChp;
51
	private ChampSliderPourcentage auteurTitrePourcentChp;
52
	private ChampSliderPourcentage famillePourcentChp;
52
	private ChampSliderPourcentage famillePourcentChp;
53
	private ChampSliderPourcentage genrePourcentChp;
53
	private ChampSliderPourcentage genrePourcentChp;
54
	private ChampSliderPourcentage spPourcentChp;
54
	private ChampSliderPourcentage spPourcentChp;
55
	private ChampSliderPourcentage auteurSpPourcentChp;
55
	private ChampSliderPourcentage auteurSpPourcentChp;
56
	private ChampSliderPourcentage localitePourcentChp;
56
	private ChampSliderPourcentage localitePourcentChp;
57
	private ChampSliderPourcentage datePourcentChp;
57
	private ChampSliderPourcentage datePourcentChp;
58
 
58
 
59
	public CollectionFormContenu(Formulaire formulaireCourrant) {
59
	public CollectionFormContenu(Formulaire formulaireCourrant) {
60
		initialiserOnglet(formulaireCourrant);
60
		initialiserOnglet(formulaireCourrant);
61
		setId(ID);
61
		setId(ID);
62
		setText(Mediateur.i18nC.collectionContenu());
62
		setText(Mediateur.i18nC.collectionContenu());
63
				
63
				
64
		creerFieldsetNature();
64
		creerFieldsetNature();
65
		// TODO : réaliser un champ couverture géographique détaillé
65
		// TODO : réaliser un champ couverture géographique détaillé
66
		creerFieldsetPeriode();
66
		creerFieldsetPeriode();
67
		creerFieldsetClassement();
67
		creerFieldsetClassement();
68
		creerFieldsetEtiquette();
68
		creerFieldsetEtiquette();
69
		creerFieldsetIntegration();
69
		creerFieldsetIntegration();
70
	}
70
	}
71
	
71
	
72
	private void creerFieldsetNature() {
72
	private void creerFieldsetNature() {
73
		FieldSet natureFieldSet = new FieldSet();
73
		FieldSet natureFieldSet = new FieldSet();
74
		natureFieldSet.setHeading(i18nC.collectionNatureTitre());
74
		natureFieldSet.setHeadingHtml(i18nC.collectionNatureTitre());
75
		natureFieldSet.setCollapsible(true);
75
		natureFieldSet.setCollapsible(true);
76
		natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
76
		natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
77
		
77
		
78
		natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
78
		natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
79
		natureFieldSet.add(natureChp);
79
		natureFieldSet.add(natureChp);
80
		
80
		
81
		specialiteChp = new TextArea();
81
		specialiteChp = new TextArea();
82
		specialiteChp.setFieldLabel(i18nC.specialiteCollection());
82
		specialiteChp.setFieldLabel(i18nC.specialiteCollection());
83
		specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
83
		specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
84
		natureFieldSet.add(specialiteChp, new FormData(550, 0));
84
		natureFieldSet.add(specialiteChp, new FormData(550, 0));
85
		
85
		
86
		add(natureFieldSet);
86
		add(natureFieldSet);
87
	}
87
	}
88
	
88
	
89
	private void creerFieldsetPeriode() {
89
	private void creerFieldsetPeriode() {
90
		FieldSet periodeFieldSet = new FieldSet();
90
		FieldSet periodeFieldSet = new FieldSet();
91
		periodeFieldSet.setHeading(i18nC.collectionConstitutionTitre());
91
		periodeFieldSet.setHeadingHtml(i18nC.collectionConstitutionTitre());
92
		periodeFieldSet.setCollapsible(true);
92
		periodeFieldSet.setCollapsible(true);
93
		periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
93
		periodeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
94
		
94
		
95
		ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection());
95
		ConteneurMultiChamps dateDebutConteneur = new ConteneurMultiChamps(i18nC.dateDebutCollection());
96
		
96
		
97
		dateDebutChp  = new DateField();
97
		dateDebutChp  = new DateField();
98
		dateDebutChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
98
		dateDebutChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
99
		dateDebutChp.getPropertyEditor().setParseStrict(false);
99
		dateDebutChp.getPropertyEditor().setParseStrict(false);
100
		dateDebutChp.setFormatValue(true);
100
		dateDebutChp.setFormatValue(true);
101
		dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
101
		dateDebutConteneur.ajouterChamp(dateDebutChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
102
		
102
		
103
		dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut");
103
		dateDebutCombo = new ChampComboBoxListeValeurs(null, "dateDebut");
104
		dateDebutCombo.setTrie("id_valeur");
104
		dateDebutCombo.setTrie("id_valeur");
105
		dateDebutConteneur.ajouterChamp(dateDebutCombo);
105
		dateDebutConteneur.ajouterChamp(dateDebutCombo);
106
		
106
		
107
		periodeFieldSet.add(dateDebutConteneur);
107
		periodeFieldSet.add(dateDebutConteneur);
108
		
108
		
109
		ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection());
109
		ConteneurMultiChamps dateFinConteneur = new ConteneurMultiChamps(i18nC.dateFinCollection());
110
		
110
		
111
		dateFinChp = new DateField();
111
		dateFinChp = new DateField();
112
		dateFinChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
112
		dateFinChp.getPropertyEditor().setFormat(UtilDate.formatDateFr);
113
		dateFinChp.getPropertyEditor().setParseStrict(false);
113
		dateFinChp.getPropertyEditor().setParseStrict(false);
114
		dateFinChp.setFormatValue(true);
114
		dateFinChp.setFormatValue(true);
115
		dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
115
		dateFinConteneur.ajouterChamp(dateFinChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
116
		
116
		
117
		dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin");
117
		dateFinCombo = new ChampComboBoxListeValeurs(null, "dateFin");
118
		dateFinCombo.setTrie("id_valeur");
118
		dateFinCombo.setTrie("id_valeur");
119
		dateFinConteneur.ajouterChamp(dateFinCombo);
119
		dateFinConteneur.ajouterChamp(dateFinCombo);
120
		
120
		
121
		periodeFieldSet.add(dateFinConteneur);
121
		periodeFieldSet.add(dateFinConteneur);
122
		
122
		
123
		Text infoDate = new Text(i18nC.dateApproximativeInfo());
123
		Text infoDate = new Text(i18nC.dateApproximativeInfo());
124
		periodeFieldSet.add(infoDate);
124
		periodeFieldSet.add(infoDate);
125
		
125
		
126
		add(periodeFieldSet);
126
		add(periodeFieldSet);
127
	}
127
	}
128
	
128
	
129
	private void creerFieldsetClassement() {
129
	private void creerFieldsetClassement() {
130
		FieldSet classementFieldSet = new FieldSet();
130
		FieldSet classementFieldSet = new FieldSet();
131
		classementFieldSet.setHeading(i18nC.collectionClassementTitre());
131
		classementFieldSet.setHeadingHtml(i18nC.collectionClassementTitre());
132
		classementFieldSet.setCollapsible(true);
132
		classementFieldSet.setCollapsible(true);
133
		classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
133
		classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
134
 
134
 
135
		etatClassementCombo  = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etatClassement", tabIndex++);
135
		etatClassementCombo  = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etatClassement", tabIndex++);
136
		classementFieldSet.add(etatClassementCombo);
136
		classementFieldSet.add(etatClassementCombo);
137
 
137
 
138
		annotationClassementChp = new TextArea();
138
		annotationClassementChp = new TextArea();
139
		annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
139
		annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
140
		classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
140
		classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
141
		
141
		
142
		Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
142
		Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
143
		classementFieldSet.add(infoClassement);
143
		classementFieldSet.add(infoClassement);
144
		
144
		
145
		add(classementFieldSet);
145
		add(classementFieldSet);
146
	}
146
	}
147
	
147
	
148
	private void creerFieldsetEtiquette() {
148
	private void creerFieldsetEtiquette() {
149
		FieldSet etiquetteFieldSet = new FieldSet();
149
		FieldSet etiquetteFieldSet = new FieldSet();
150
		etiquetteFieldSet.setHeading(i18nC.collectionEtiquetteTitre());
150
		etiquetteFieldSet.setHeadingHtml(i18nC.collectionEtiquetteTitre());
151
		etiquetteFieldSet.setCollapsible(true);
151
		etiquetteFieldSet.setCollapsible(true);
152
		etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
152
		etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
153
		
153
		
154
		Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
154
		Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
155
		renseignementPoucentLabel.setTagName("label");
155
		renseignementPoucentLabel.setTagName("label");
156
		renseignementPoucentLabel.setStyleName("x-form-item-label");
156
		renseignementPoucentLabel.setStyleName("x-form-item-label");
157
		etiquetteFieldSet.add(renseignementPoucentLabel);
157
		etiquetteFieldSet.add(renseignementPoucentLabel);
158
		
158
		
159
		auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
159
		auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
160
		etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
160
		etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
161
		
161
		
162
		famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
162
		famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
163
		etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
163
		etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
164
		
164
		
165
		genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
165
		genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
166
		etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
166
		etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
167
		
167
		
168
		spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
168
		spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
169
		etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
169
		etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
170
		
170
		
171
		auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
171
		auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
172
		etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
172
		etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
173
		
173
		
174
		localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
174
		localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
175
		etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
175
		etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
176
		
176
		
177
		datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
177
		datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
178
		etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
178
		etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
179
		
179
		
180
		precisionLocaliteCombo  = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
180
		precisionLocaliteCombo  = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
181
		etiquetteFieldSet.add(precisionLocaliteCombo);
181
		etiquetteFieldSet.add(precisionLocaliteCombo);
182
		
182
		
183
		precisionDateCombo  = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
183
		precisionDateCombo  = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
184
		etiquetteFieldSet.add(precisionDateCombo);
184
		etiquetteFieldSet.add(precisionDateCombo);
185
 
185
 
186
		etiquetteAnnotationChp  = new TextArea();
186
		etiquetteAnnotationChp  = new TextArea();
187
		etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
187
		etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
188
		etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
188
		etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
189
		etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
189
		etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
190
		
190
		
191
		add(etiquetteFieldSet);
191
		add(etiquetteFieldSet);
192
	}
192
	}
193
	
193
	
194
	private String collecterEtiquetteRenseignement() {
194
	private String collecterEtiquetteRenseignement() {
195
		String renseignement = "";
195
		String renseignement = "";
196
		renseignement  += creerTypeValeur("AT", auteurTitrePourcentChp.getValeur());
196
		renseignement  += creerTypeValeur("AT", auteurTitrePourcentChp.getValeur());
197
		renseignement  += creerTypeValeur("F", famillePourcentChp.getValeur());
197
		renseignement  += creerTypeValeur("F", famillePourcentChp.getValeur());
198
		renseignement  += creerTypeValeur("G", genrePourcentChp.getValeur());
198
		renseignement  += creerTypeValeur("G", genrePourcentChp.getValeur());
199
		renseignement  += creerTypeValeur("SP", spPourcentChp.getValeur());
199
		renseignement  += creerTypeValeur("SP", spPourcentChp.getValeur());
200
		renseignement  += creerTypeValeur("ASP", auteurSpPourcentChp.getValeur());
200
		renseignement  += creerTypeValeur("ASP", auteurSpPourcentChp.getValeur());
201
		renseignement  += creerTypeValeur("L", localitePourcentChp.getValeur());
201
		renseignement  += creerTypeValeur("L", localitePourcentChp.getValeur());
202
		renseignement  += creerTypeValeur("D", datePourcentChp.getValeur());
202
		renseignement  += creerTypeValeur("D", datePourcentChp.getValeur());
203
		renseignement = renseignement.replaceFirst(aDonnee.SEPARATEUR_VALEURS+"$", "");
203
		renseignement = renseignement.replaceFirst(aDonnee.SEPARATEUR_VALEURS+"$", "");
204
		return renseignement;
204
		return renseignement;
205
	}
205
	}
206
	
206
	
207
	private String creerTypeValeur(String type, String valeur) {
207
	private String creerTypeValeur(String type, String valeur) {
208
		String retour = "";
208
		String retour = "";
209
		if (!UtilString.isEmpty(valeur)) {
209
		if (!UtilString.isEmpty(valeur)) {
210
			retour = type+aDonnee.SEPARATEUR_TYPE_VALEUR+valeur+aDonnee.SEPARATEUR_VALEURS;
210
			retour = type+aDonnee.SEPARATEUR_TYPE_VALEUR+valeur+aDonnee.SEPARATEUR_VALEURS;
211
		}
211
		}
212
		return retour;
212
		return retour;
213
	}
213
	}
214
	
214
	
215
	private void peuplerEtiquetteRenseignement(String valeurTruk) {
215
	private void peuplerEtiquetteRenseignement(String valeurTruk) {
216
		HashMap<String,String> infos = parserEtiquetteRenseignement(valeurTruk);
216
		HashMap<String,String> infos = parserEtiquetteRenseignement(valeurTruk);
217
		if (infos != null) {
217
		if (infos != null) {
218
			Iterator<String> it = infos.keySet().iterator();
218
			Iterator<String> it = infos.keySet().iterator();
219
			while (it.hasNext()) {
219
			while (it.hasNext()) {
220
				String cle = it.next();
220
				String cle = it.next();
221
				if (cle.equals("AT")) {
221
				if (cle.equals("AT")) {
222
					auteurTitrePourcentChp.peupler(infos.get(cle));
222
					auteurTitrePourcentChp.peupler(infos.get(cle));
223
				} else if (cle.equals("F")) {
223
				} else if (cle.equals("F")) {
224
					famillePourcentChp.peupler(infos.get(cle));
224
					famillePourcentChp.peupler(infos.get(cle));
225
				} else if (cle.equals("G")) {
225
				} else if (cle.equals("G")) {
226
					genrePourcentChp.peupler(infos.get(cle));
226
					genrePourcentChp.peupler(infos.get(cle));
227
				} else if (cle.equals("SP")) {
227
				} else if (cle.equals("SP")) {
228
					spPourcentChp.peupler(infos.get(cle));
228
					spPourcentChp.peupler(infos.get(cle));
229
				} else if (cle.equals("ASP")) {
229
				} else if (cle.equals("ASP")) {
230
					auteurSpPourcentChp.peupler(infos.get(cle));
230
					auteurSpPourcentChp.peupler(infos.get(cle));
231
				} else if (cle.equals("L")) {
231
				} else if (cle.equals("L")) {
232
					localitePourcentChp.peupler(infos.get(cle));
232
					localitePourcentChp.peupler(infos.get(cle));
233
				} else if (cle.equals("D")) {
233
				} else if (cle.equals("D")) {
234
					datePourcentChp.peupler(infos.get(cle));
234
					datePourcentChp.peupler(infos.get(cle));
235
				}
235
				}
236
			}
236
			}
237
		}
237
		}
238
	}
238
	}
239
	
239
	
240
	public static HashMap<String,String> parserEtiquetteRenseignement(String valeurTruk) {
240
	public static HashMap<String,String> parserEtiquetteRenseignement(String valeurTruk) {
241
		HashMap<String,String> infos = null;
241
		HashMap<String,String> infos = null;
242
		if (!UtilString.isEmpty(valeurTruk)) {
242
		if (!UtilString.isEmpty(valeurTruk)) {
243
			infos = new HashMap<String,String>();
243
			infos = new HashMap<String,String>();
244
			String[] pourcentages = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
244
			String[] pourcentages = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
245
			for (int i = 0; i < pourcentages.length; i++) {
245
			for (int i = 0; i < pourcentages.length; i++) {
246
				String[] pourcentageIdValeur = pourcentages[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
246
				String[] pourcentageIdValeur = pourcentages[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
247
				String id = pourcentageIdValeur[0];
247
				String id = pourcentageIdValeur[0];
248
				String valeur = pourcentageIdValeur[1];
248
				String valeur = pourcentageIdValeur[1];
249
				infos.put(id, valeur);
249
				infos.put(id, valeur);
250
			}
250
			}
251
		}
251
		}
252
		return infos;
252
		return infos;
253
	}
253
	}
254
	
254
	
255
	private void creerFieldsetIntegration() {
255
	private void creerFieldsetIntegration() {
256
		FieldSet integrationFieldSet = new FieldSet();
256
		FieldSet integrationFieldSet = new FieldSet();
257
		integrationFieldSet.setHeading(i18nC.collectionIntegreeTitre());
257
		integrationFieldSet.setHeadingHtml(i18nC.collectionIntegreeTitre());
258
		integrationFieldSet.setCollapsible(true);
258
		integrationFieldSet.setCollapsible(true);
259
		integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
259
		integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
260
		
260
		
261
		integreCollectionCombo  = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
261
		integreCollectionCombo  = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
262
		integrationFieldSet.add(integreCollectionCombo);
262
		integrationFieldSet.add(integreCollectionCombo);
263
		
263
		
264
		infoIntegreCollectionCombo  = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
264
		infoIntegreCollectionCombo  = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
265
		integrationFieldSet.add(infoIntegreCollectionCombo);
265
		integrationFieldSet.add(infoIntegreCollectionCombo);
266
		
266
		
267
		Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
267
		Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
268
		integrationFieldSet.add(infoIntegration);
268
		integrationFieldSet.add(infoIntegration);
269
		
269
		
270
		add(integrationFieldSet);
270
		add(integrationFieldSet);
271
	}
271
	}
272
	
272
	
273
	public void peupler() {
273
	public void peupler() {
274
		initialiserCollection();
274
		initialiserCollection();
275
		if (collectionBotanique != null) {
275
		if (collectionBotanique != null) {
276
			natureChp.peupler(collectionBotanique.getNature());
276
			natureChp.peupler(collectionBotanique.getNature());
277
			specialiteChp.setValue(collectionBotanique.getSpecialite());
277
			specialiteChp.setValue(collectionBotanique.getSpecialite());
278
			
278
			
279
			dateDebutChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateDebut()));
279
			dateDebutChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateDebut()));
280
			dateDebutCombo.peupler(collectionBotanique.getRecolteDateDebutType());
280
			dateDebutCombo.peupler(collectionBotanique.getRecolteDateDebutType());
281
			dateFinChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateFin()));
281
			dateFinChp.setValue(UtilString.formaterEnDate(collectionBotanique.getRecolteDateFin()));
282
			dateFinCombo.peupler(collectionBotanique.getRecolteDateFinType());
282
			dateFinCombo.peupler(collectionBotanique.getRecolteDateFinType());
283
			
283
			
284
			etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
284
			etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
285
			annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
285
			annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
286
			
286
			
287
			peuplerEtiquetteRenseignement(collectionBotanique.getEtiquetteRenseignement());
287
			peuplerEtiquetteRenseignement(collectionBotanique.getEtiquetteRenseignement());
288
			precisionLocaliteCombo.peupler(collectionBotanique.getPrecisionLocalite());
288
			precisionLocaliteCombo.peupler(collectionBotanique.getPrecisionLocalite());
289
			precisionDateCombo.peupler(collectionBotanique.getPrecisionDate());
289
			precisionDateCombo.peupler(collectionBotanique.getPrecisionDate());
290
			etiquetteAnnotationChp.setValue(collectionBotanique.getAnnotationsDiverses());
290
			etiquetteAnnotationChp.setValue(collectionBotanique.getAnnotationsDiverses());
291
			
291
			
292
			integreCollectionCombo.peupler(collectionBotanique.getCollectionIntegre());
292
			integreCollectionCombo.peupler(collectionBotanique.getCollectionIntegre());
293
			infoIntegreCollectionCombo.peupler(collectionBotanique.getCollectionIntegreInfo());
293
			infoIntegreCollectionCombo.peupler(collectionBotanique.getCollectionIntegreInfo());
294
		}
294
		}
295
	}
295
	}
296
	
296
	
297
	public void collecter() {
297
	public void collecter() {
298
		initialiserCollection();
298
		initialiserCollection();
299
		if (etreAccede()) {
299
		if (etreAccede()) {
300
			collectionBotaniqueCollectee.setNature(natureChp.getValeur());
300
			collectionBotaniqueCollectee.setNature(natureChp.getValeur());
301
			collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
301
			collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
302
			
302
			
303
			collectionBotaniqueCollectee.setRecolteDateDebut(UtilDate.formaterEnString(dateDebutChp.getValue()));
303
			collectionBotaniqueCollectee.setRecolteDateDebut(UtilDate.formaterEnString(dateDebutChp.getValue()));
304
			collectionBotaniqueCollectee.setRecolteDateDebutType(dateDebutCombo.getValeur());
304
			collectionBotaniqueCollectee.setRecolteDateDebutType(dateDebutCombo.getValeur());
305
			collectionBotaniqueCollectee.setRecolteDateFin(UtilDate.formaterEnString(dateFinChp.getValue()));
305
			collectionBotaniqueCollectee.setRecolteDateFin(UtilDate.formaterEnString(dateFinChp.getValue()));
306
			collectionBotaniqueCollectee.setRecolteDateFinType(dateFinCombo.getValeur());
306
			collectionBotaniqueCollectee.setRecolteDateFinType(dateFinCombo.getValeur());
307
			
307
			
308
			collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
308
			collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
309
			collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
309
			collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
310
			
310
			
311
			collectionBotaniqueCollectee.setEtiquetteRenseignement(collecterEtiquetteRenseignement());
311
			collectionBotaniqueCollectee.setEtiquetteRenseignement(collecterEtiquetteRenseignement());
312
			collectionBotaniqueCollectee.setPrecisionLocalite(precisionLocaliteCombo.getValeur());
312
			collectionBotaniqueCollectee.setPrecisionLocalite(precisionLocaliteCombo.getValeur());
313
			collectionBotaniqueCollectee.setPrecisionDate(precisionDateCombo.getValeur());
313
			collectionBotaniqueCollectee.setPrecisionDate(precisionDateCombo.getValeur());
314
			collectionBotaniqueCollectee.setAnnotationsDiverses(etiquetteAnnotationChp.getValue());
314
			collectionBotaniqueCollectee.setAnnotationsDiverses(etiquetteAnnotationChp.getValue());
315
			
315
			
316
			collectionBotaniqueCollectee.setCollectionIntegre(integreCollectionCombo.getValeur());
316
			collectionBotaniqueCollectee.setCollectionIntegre(integreCollectionCombo.getValeur());
317
			collectionBotaniqueCollectee.setCollectionIntegreInfo(infoIntegreCollectionCombo.getValeur());
317
			collectionBotaniqueCollectee.setCollectionIntegreInfo(infoIntegreCollectionCombo.getValeur());
318
		}
318
		}
319
	}
319
	}
320
	
320
	
321
	private void initialiserCollection() {
321
	private void initialiserCollection() {
322
		collection = ((CollectionForm) formulaire).collection;
322
		collection = ((CollectionForm) formulaire).collection;
323
		if (collection != null) {
323
		if (collection != null) {
324
			collectionBotanique = collection.getBotanique();
324
			collectionBotanique = collection.getBotanique();
325
		}
325
		}
326
		
326
		
327
		collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
327
		collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
328
		if (collectionCollectee != null) {
328
		if (collectionCollectee != null) {
329
			collectionBotaniqueCollectee = collectionCollectee.getBotanique();
329
			collectionBotaniqueCollectee = collectionCollectee.getBotanique();
330
		}
330
		}
331
	}
331
	}
332
	
332
	
333
	public void rafraichir(Object nouvellesDonnees) {
333
	public void rafraichir(Object nouvellesDonnees) {
334
		Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
334
		Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
335
	}
335
	}
336
}
336
}