Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 679 Rev 965
1
package org.tela_botanica.client.vues.image;
1
package org.tela_botanica.client.vues.image;
2
 
2
 
3
import org.tela_botanica.client.image.ImageMediateur;
3
import org.tela_botanica.client.image.ImageMediateur;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.interfaces.Rafraichissable;
5
import org.tela_botanica.client.vues.ArbreMotsClesVue;
5
import org.tela_botanica.client.vues.ArbreMotsClesVue;
6
import org.tela_botanica.client.vues.image.filtres.RechercheFiltreTaxonVue;
6
import org.tela_botanica.client.vues.image.filtres.RechercheFiltreTaxonVue;
-
 
7
 
7
 
8
import com.google.gwt.core.client.GWT;
8
import com.google.gwt.core.client.JavaScriptObject;
9
import com.google.gwt.core.client.JavaScriptObject;
9
import com.google.gwt.user.client.Timer;
10
import com.google.gwt.user.client.Timer;
10
import com.google.gwt.user.client.Window;
11
import com.google.gwt.user.client.Window;
11
import com.google.gwt.user.client.ui.Label;
12
import com.google.gwt.user.client.ui.Label;
12
import com.gwtext.client.core.EventObject;
13
import com.gwtext.client.core.EventObject;
13
import com.gwtext.client.core.Ext;
14
import com.gwtext.client.core.Ext;
14
import com.gwtext.client.core.NameValuePair;
15
import com.gwtext.client.core.NameValuePair;
15
import com.gwtext.client.widgets.BoxComponent;
16
import com.gwtext.client.widgets.BoxComponent;
16
import com.gwtext.client.widgets.Button;
17
import com.gwtext.client.widgets.Button;
17
import com.gwtext.client.widgets.Component;
18
import com.gwtext.client.widgets.Component;
18
import com.gwtext.client.widgets.Container;
19
import com.gwtext.client.widgets.Container;
19
import com.gwtext.client.widgets.Panel;
20
import com.gwtext.client.widgets.Panel;
20
import com.gwtext.client.widgets.TabPanel;
21
import com.gwtext.client.widgets.TabPanel;
21
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
22
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
22
import com.gwtext.client.widgets.event.ContainerListener;
23
import com.gwtext.client.widgets.event.ContainerListener;
23
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
24
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
24
import com.gwtext.client.widgets.event.PanelListener;
25
import com.gwtext.client.widgets.event.PanelListener;
25
import com.gwtext.client.widgets.event.PanelListenerAdapter;
26
import com.gwtext.client.widgets.event.PanelListenerAdapter;
26
import com.gwtext.client.widgets.form.DateField;
27
import com.gwtext.client.widgets.form.DateField;
27
import com.gwtext.client.widgets.form.Field;
28
import com.gwtext.client.widgets.form.Field;
28
import com.gwtext.client.widgets.form.TextArea;
29
import com.gwtext.client.widgets.form.TextArea;
29
import com.gwtext.client.widgets.form.TextField;
30
import com.gwtext.client.widgets.form.TextField;
30
import com.gwtext.client.widgets.form.event.FieldListener;
31
import com.gwtext.client.widgets.form.event.FieldListener;
31
import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
32
import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
32
import com.gwtext.client.widgets.grid.GridPanel;
33
import com.gwtext.client.widgets.grid.GridPanel;
33
import com.gwtext.client.widgets.grid.GridView;
34
import com.gwtext.client.widgets.grid.GridView;
34
import com.gwtext.client.widgets.grid.PropertyGridPanel;
35
import com.gwtext.client.widgets.grid.PropertyGridPanel;
35
import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
36
import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
36
import com.gwtext.client.widgets.layout.FitLayout;
37
import com.gwtext.client.widgets.layout.FitLayout;
37
import com.gwtext.client.widgets.layout.RowLayout;
38
import com.gwtext.client.widgets.layout.RowLayout;
38
import com.gwtext.client.widgets.layout.RowLayoutData;
39
import com.gwtext.client.widgets.layout.RowLayoutData;
39
import com.gwtext.client.widgets.layout.VerticalLayout;
40
import com.gwtext.client.widgets.layout.VerticalLayout;
40
 
41
 
41
/**
42
/**
42
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il
43
 * Panneau contenant les infos, les métadonnées et l'arbre des mots clés, il
43
 * implémente l'interface rafraichissable
44
 * implémente l'interface rafraichissable
44
 * 
45
 * 
45
 * @author aurelien
46
 * @author aurelien
46
 * 
47
 * 
47
 */
48
 */
48
public class PanneauMetadonneesVue extends TabPanel implements Rafraichissable {
49
public class PanneauMetadonneesVue extends TabPanel implements Rafraichissable {
49
 
50
 
50
	/**
51
	/**
51
	 * Le médiateur associé à la vue
52
	 * Le médiateur associé à la vue
52
	 */
53
	 */
53
	private ImageMediateur imediateur = null;
54
	private ImageMediateur imediateur = null;
54
	/**
55
	/**
55
	 * Le panneau des Exifs
56
	 * Le panneau des Exifs
56
	 */
57
	 */
57
	private PropertyGridPanel ExifGrid = null;
58
	private PropertyGridPanel ExifGrid = null;
58
	/**
59
	/**
59
	 * Le panneau des Iptc
60
	 * Le panneau des Iptc
60
	 */
61
	 */
61
	private PropertyGridPanel IptcGrid = null;
62
	private PropertyGridPanel IptcGrid = null;
62
 
63
 
63
	/**
64
	/**
64
	 * La grille pour le panneau des Exifs
65
	 * La grille pour le panneau des Exifs
65
	 */
66
	 */
66
	private GridView gViewExif = null;
67
	private GridView gViewExif = null;
67
	/**
68
	/**
68
	 * La grille pour le panneau de Iptc
69
	 * La grille pour le panneau de Iptc
69
	 */
70
	 */
70
	private GridView gViewIptc = null;
71
	private GridView gViewIptc = null;
71
 
72
 
72
	/**
73
	/**
73
	 * L'onglet des Exifs
74
	 * L'onglet des Exifs
74
	 */
75
	 */
75
	private Panel panneauExifGrid = null;
76
	private Panel panneauExifGrid = null;
76
	/**
77
	/**
77
	 * L'onglet des Iptc
78
	 * L'onglet des Iptc
78
	 */
79
	 */
79
	private Panel panneauIptcGrid = null;
80
	private Panel panneauIptcGrid = null;
80
	/**
81
	/**
81
	 * L'onglet des infos
82
	 * L'onglet des infos
82
	 */
83
	 */
83
	private Panel panneauInfoGrid = null;
84
	private Panel panneauInfoGrid = null;
84
	/**
85
	/**
85
	 * L'onglet des mots clés
86
	 * L'onglet des mots clés
86
	 */
87
	 */
87
	private ArbreMotsClesVue panneauMotsCles = null;
88
	private ArbreMotsClesVue panneauMotsCles = null;
88
	
89
	
89
	/**
90
	/**
90
	 * l'onglet des observations
91
	 * l'onglet des observations
91
	 */
92
	 */
92
	private Panel panneauMiniListeObservation = null;
93
	private Panel panneauMiniListeObservation = null;
93
 
94
 
94
	/**
95
	/**
95
	 * Le champ commentaire
96
	 * Le champ commentaire
96
	 */
97
	 */
97
	private TextField commentaireGeneral = null;
98
	private TextField commentaireGeneral = null;
98
	/**
99
	/**
99
	 * Le champ date
100
	 * Le champ date
100
	 */
101
	 */
101
	private DateField dateImage = null;
102
	private DateField dateImage = null;
102
	
103
	
103
	/**
104
	/**
104
	 * La barre de recherche rapide des taxons
105
	 * La barre de recherche rapide des taxons
105
	 */
106
	 */
106
	private RechercheFiltreTaxonVue rechercheFiltreTaxonVue = null; 
107
	private RechercheFiltreTaxonVue rechercheFiltreTaxonVue = null; 
107
	
108
	
108
	/**
109
	/**
109
	 * La mini liste des observations
110
	 * La mini liste des observations
110
	 */
111
	 */
111
	private MiniListeObservationVue miniListeObservation = null ;
112
	private MiniListeObservationVue miniListeObservation = null ;
112
	/**
113
	/**
113
	 * Le bouton de validation
114
	 * Le bouton de validation
114
	 */
115
	 */
115
	Button validerInfo = null;
116
	Button validerInfo = null;
116
 
117
 
117
	/**
118
	/**
118
	 * Barre de notation
119
	 * Barre de notation
119
	 */
120
	 */
120
	BarreNotationVue noteVue = null;
121
	BarreNotationVue noteVue = null;
121
 
122
 
122
	/**
123
	/**
123
	 * Booleen d'instanciation
124
	 * Booleen d'instanciation
124
	 */
125
	 */
125
	boolean estInstancie = false;
126
	boolean estInstancie = false;
126
	
127
	
127
	Timer timerRedimensionnement = null;
128
	Timer timerRedimensionnement = null;
128
 
129
 
129
	/**
130
	/**
130
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
131
	 * Constructeur sans argument (privé car ne doit pas être utilisé)
131
	 */
132
	 */
132
	@SuppressWarnings("unused")
133
	@SuppressWarnings("unused")
133
	private PanneauMetadonneesVue() {
134
	private PanneauMetadonneesVue() {
134
		super();
135
		super();
135
	}
136
	}
136
 
137
 
137
	/**
138
	/**
138
	 * Constructeur avec argument
139
	 * Constructeur avec argument
139
	 * 
140
	 * 
140
	 * @param im
141
	 * @param im
141
	 */
142
	 */
142
	public PanneauMetadonneesVue(ImageMediateur im) {
143
	public PanneauMetadonneesVue(ImageMediateur im) {
143
		super();
144
		super();
144
 
145
 
145
		// on associe le médiateur
146
		// on associe le médiateur
146
		imediateur = im;
147
		imediateur = im;
147
 
148
 
148
		// on crée et dispose les panneaux et les champs
149
		// on crée et dispose les panneaux et les champs
149
		panneauExifGrid = new Panel("Exif");
150
		panneauExifGrid = new Panel("Exif");
150
		panneauIptcGrid = new Panel("Iptc");
151
		panneauIptcGrid = new Panel("Iptc");
151
		panneauInfoGrid = new Panel("Infos");
152
		panneauInfoGrid = new Panel("Infos");
152
		panneauMotsCles = new ArbreMotsClesVue(im);
153
		panneauMotsCles = new ArbreMotsClesVue(im);
153
		panneauMotsCles.setHeight("500px");
154
		panneauMotsCles.setHeight("500px");
154
 
155
 
155
		Panel sousPanneauInfosGenerales = new Panel("Infos Générales");
156
		Panel sousPanneauInfosGenerales = new Panel("Infos Générales");
156
		sousPanneauInfosGenerales.setLayout(new VerticalLayout());
157
		sousPanneauInfosGenerales.setLayout(new VerticalLayout());
157
		sousPanneauInfosGenerales.setBorder(false);
158
		sousPanneauInfosGenerales.setBorder(false);
158
		sousPanneauInfosGenerales.setHeight(200);
159
		sousPanneauInfosGenerales.setHeight(200);
159
		sousPanneauInfosGenerales.setAutoWidth(true);
160
		sousPanneauInfosGenerales.setAutoWidth(true);
160
		sousPanneauInfosGenerales.setMargins(5);
161
		sousPanneauInfosGenerales.setMargins(5);
161
		sousPanneauInfosGenerales.setPaddings(5);
162
		sousPanneauInfosGenerales.setPaddings(5);
162
		sousPanneauInfosGenerales.setCollapsible(true);
163
		sousPanneauInfosGenerales.setCollapsible(true);
163
 
164
 
164
		Label labelComm = new Label("Commentaires :");
165
		Label labelComm = new Label("Commentaires :");
165
		labelComm.setHeight("20px");
166
		labelComm.setHeight("20px");
166
		commentaireGeneral = new TextArea();
167
		commentaireGeneral = new TextArea();
167
		commentaireGeneral.setWidth("90%");
168
		commentaireGeneral.setWidth("90%");
168
		Label labelDate = new Label("Date :");
169
		Label labelDate = new Label("Date :");
169
		Label labelNote = new Label("Note :");
170
		Label labelNote = new Label("Note :");
170
 
171
 
171
		panneauMotsCles.setBorder(false);
172
		panneauMotsCles.setBorder(false);
172
 
173
 
173
		labelDate.setHeight("20px");
174
		labelDate.setHeight("20px");
174
 
175
 
175
		dateImage = new DateField();
176
		dateImage = new DateField();
176
		dateImage.setAutoWidth(true);
177
		dateImage.setAutoWidth(true);
177
		dateImage.setFormat("d/m/Y");
178
		dateImage.setFormat("d/m/Y");
178
 
179
 
179
		validerInfo = new Button("OK");
180
		validerInfo = new Button("OK");
180
 
181
 
181
		noteVue = new BarreNotationVue(im, 5);
182
		noteVue = new BarreNotationVue(im, 5);
182
		panneauMiniListeObservation = new Panel("Observations") ;
183
		panneauMiniListeObservation = new Panel("Observations") ;
183
		
184
		
184
		if(!Ext.isIE()) {
185
		if(!Ext.isIE()) {
185
			panneauMiniListeObservation.setLayout(new RowLayout());
186
			panneauMiniListeObservation.setLayout(new RowLayout());
186
		}
187
		}
187
		
188
		
188
		miniListeObservation = new MiniListeObservationVue(im);
189
		miniListeObservation = new MiniListeObservationVue(im);
189
		rechercheFiltreTaxonVue = new RechercheFiltreTaxonVue(im);
190
		rechercheFiltreTaxonVue = new RechercheFiltreTaxonVue(im);
190
		rechercheFiltreTaxonVue.setTitle("Recherche dans les observations");
191
		rechercheFiltreTaxonVue.setTitle("Recherche dans les observations");
191
		if(Ext.isIE()) {
192
		if(Ext.isIE()) {
192
			panneauMiniListeObservation.add(rechercheFiltreTaxonVue);
193
			panneauMiniListeObservation.add(rechercheFiltreTaxonVue);
193
			rechercheFiltreTaxonVue.setHeight(90);
194
			rechercheFiltreTaxonVue.setHeight(90);
194
		} else {
195
		} else {
195
			panneauMiniListeObservation.add(rechercheFiltreTaxonVue, new RowLayoutData(90));
196
			panneauMiniListeObservation.add(rechercheFiltreTaxonVue, new RowLayoutData(90));
196
		}
197
		}
197
		rechercheFiltreTaxonVue.setWidth("100%") ;
198
		rechercheFiltreTaxonVue.setWidth("100%") ;
198
		rechercheFiltreTaxonVue.setBorder(false);
199
		rechercheFiltreTaxonVue.setBorder(false);
199
	
200
	
200
		if(Ext.isIE()) {
201
		if(Ext.isIE()) {
201
			panneauMiniListeObservation.add(miniListeObservation, new RowLayoutData(400)) ;
202
			panneauMiniListeObservation.add(miniListeObservation, new RowLayoutData(400)) ;
202
		} else {
203
		} else {
203
			panneauMiniListeObservation.add(miniListeObservation, new RowLayoutData()) ;
204
			panneauMiniListeObservation.add(miniListeObservation, new RowLayoutData()) ;
204
		}
205
		}
205
 
206
 
206
		sousPanneauInfosGenerales.add(labelComm);
207
		sousPanneauInfosGenerales.add(labelComm);
207
		sousPanneauInfosGenerales.add(commentaireGeneral);
208
		sousPanneauInfosGenerales.add(commentaireGeneral);
208
		sousPanneauInfosGenerales.add(labelDate);
209
		sousPanneauInfosGenerales.add(labelDate);
209
		sousPanneauInfosGenerales.add(dateImage);
210
		sousPanneauInfosGenerales.add(dateImage);
210
		sousPanneauInfosGenerales.add(labelNote);
211
		sousPanneauInfosGenerales.add(labelNote);
211
		sousPanneauInfosGenerales.add(noteVue);
212
		sousPanneauInfosGenerales.add(noteVue);
212
		sousPanneauInfosGenerales.add(validerInfo);
213
		sousPanneauInfosGenerales.add(validerInfo);
213
		sousPanneauInfosGenerales.setAutoHeight(true);
214
		sousPanneauInfosGenerales.setAutoHeight(true);
214
		panneauMotsCles.setAutoHeight(true);
215
		panneauMotsCles.setAutoHeight(true);
215
 
216
 
216
		panneauInfoGrid.setBorder(false);
217
		panneauInfoGrid.setBorder(false);
217
		panneauInfoGrid.setAutoHeight(true);
218
		panneauInfoGrid.setAutoHeight(true);
218
		
219
		
219
		panneauExifGrid.setAutoScroll(true);
220
		panneauExifGrid.setAutoScroll(true);
220
		panneauIptcGrid.setAutoScroll(true);
221
		panneauIptcGrid.setAutoScroll(true);
221
 
222
 
222
		panneauInfoGrid.add(sousPanneauInfosGenerales);
223
		panneauInfoGrid.add(sousPanneauInfosGenerales);
223
		panneauInfoGrid.add(panneauMotsCles);
224
		panneauInfoGrid.add(panneauMotsCles);
224
		
225
		
225
 
226
 
226
		this.add(panneauMiniListeObservation) ;
227
		this.add(panneauMiniListeObservation) ;
227
		this.add(panneauInfoGrid);
228
		this.add(panneauInfoGrid);
228
		this.add(panneauExifGrid);
229
		this.add(panneauExifGrid);
229
		this.add(panneauIptcGrid);
230
		this.add(panneauIptcGrid);
230
 
231
 
231
		gViewExif = new GridView();
232
		gViewExif = new GridView();
232
		gViewExif.setForceFit(true);
233
		gViewExif.setForceFit(true);
233
 
234
 
234
		ExifGrid = new PropertyGridPanel();
235
		ExifGrid = new PropertyGridPanel();
235
		ExifGrid.setId("meta_exif");
236
		ExifGrid.setId("meta_exif");
236
		ExifGrid.setView(gViewExif);
237
		ExifGrid.setView(gViewExif);
237
		ExifGrid.setNameText("Métadonnées Exif");
238
		ExifGrid.setNameText("Métadonnées Exif");
238
		ExifGrid.setAutoWidth(true);
239
		ExifGrid.setAutoWidth(true);
239
		ExifGrid.setHeight(500);
240
		ExifGrid.setHeight(500);
240
		ExifGrid.setSorted(false);
241
		ExifGrid.setSorted(false);
241
		ExifGrid.setAutoScroll(true);
242
		ExifGrid.setAutoScroll(true);
242
 
243
 
243
		gViewIptc = new GridView();
244
		gViewIptc = new GridView();
244
		gViewIptc.setForceFit(true);
245
		gViewIptc.setForceFit(true);
245
 
246
 
246
		IptcGrid = new PropertyGridPanel();
247
		IptcGrid = new PropertyGridPanel();
247
		IptcGrid.setId("meta_iptc");
248
		IptcGrid.setId("meta_iptc");
248
		IptcGrid.setView(gViewIptc);
249
		IptcGrid.setView(gViewIptc);
249
 
250
 
250
		IptcGrid.setNameText("Métadonnées IPTC");
251
		IptcGrid.setNameText("Métadonnées IPTC");
251
		IptcGrid.setAutoWidth(true);
252
		IptcGrid.setAutoWidth(true);
252
		IptcGrid.setHeight(500);
253
		IptcGrid.setHeight(500);
253
		IptcGrid.setSorted(false);
254
		IptcGrid.setSorted(false);
254
		IptcGrid.setAutoScroll(true);
255
		IptcGrid.setAutoScroll(true);
255
 
256
 
256
		panneauExifGrid.add(ExifGrid);
257
		panneauExifGrid.add(ExifGrid);
257
		panneauIptcGrid.add(IptcGrid);
258
		panneauIptcGrid.add(IptcGrid);
258
 
259
 
259
		// on ajoute les listeners
260
		// on ajoute les listeners
260
		ajouterListeners();
261
		ajouterListeners();
261
 
262
 
262
		// on effectue le rendu
263
		// on effectue le rendu
263
		//this.doLayout(true);
264
		//this.doLayout(true);
264
 
265
 
265
	}
266
	}
266
 
267
 
267
	private void ajouterListeners() {
268
	private void ajouterListeners() {
268
		// on ajoute un écouteur
269
		// on ajoute un écouteur
269
		validerInfo.addListener(new ButtonListenerAdapter() {
270
		validerInfo.addListener(new ButtonListenerAdapter() {
270
 
271
 
271
			// gestion du clic
272
			// gestion du clic
272
 
273
 
273
			public void onClick(Button button, EventObject e) {
274
			public void onClick(Button button, EventObject e) {
274
 
275
 
275
				button.focus();
276
				button.focus();
276
				// lors du clic sur le bouton valider on met à jour les
277
				// lors du clic sur le bouton valider on met à jour les
277
				// commentaires et la date
278
				// commentaires et la date
278
				getIMediateur().mettreAJourInfo(commentaireGeneral.getText(),
279
				getIMediateur().mettreAJourInfo(commentaireGeneral.getText(),
279
						dateImage.getRawValue(), noteVue.getNote());
280
						dateImage.getRawValue(), noteVue.getNote());
280
 
281
 
281
			}
282
			}
282
		});
283
		});
283
 
284
 
284
		// gestion des clics dans la grille
285
		// gestion des clics dans la grille
285
		ExifGrid.addGridCellListener(new GridCellListenerAdapter() {
286
		ExifGrid.addGridCellListener(new GridCellListenerAdapter() {
286
 
287
 
287
			// lors d'un clic d'une cellule
288
			// lors d'un clic d'une cellule
288
 
289
 
289
			public void onCellClick(GridPanel grid, int rowIndex, int colIndex,
290
			public void onCellClick(GridPanel grid, int rowIndex, int colIndex,
290
					EventObject e) {
291
					EventObject e) {
291
 
292
 
292
				// on empeche l'édition
293
				// on empeche l'édition
293
				e.stopEvent();
294
				e.stopEvent();
294
				ExifGrid.stopEditing();
295
				ExifGrid.stopEditing();
295
 
296
 
296
			}
297
			}
297
 
298
 
298
			// lors du double clic sur une cellule
299
			// lors du double clic sur une cellule
299
 
300
 
300
			public void onCellDblClick(GridPanel grid, int rowIndex,
301
			public void onCellDblClick(GridPanel grid, int rowIndex,
301
					int colIndex, EventObject e) {
302
					int colIndex, EventObject e) {
302
 
303
 
303
				// on empêche l'édition
304
				// on empêche l'édition
304
				e.stopEvent();
305
				e.stopEvent();
305
				ExifGrid.stopEditing();
306
				ExifGrid.stopEditing();
306
 
307
 
307
			}
308
			}
308
 
309
 
309
		});
310
		});
310
 
311
 
311
		IptcGrid.addGridCellListener(new GridCellListenerAdapter() {
312
		IptcGrid.addGridCellListener(new GridCellListenerAdapter() {
312
 
313
 
313
			// lors d'un clic d'une cellule
314
			// lors d'un clic d'une cellule
314
 
315
 
315
			public void onCellClick(GridPanel grid, int rowIndex, int colIndex,
316
			public void onCellClick(GridPanel grid, int rowIndex, int colIndex,
316
					EventObject e) {
317
					EventObject e) {
317
				// on empeche l'édition
318
				// on empeche l'édition
318
				e.stopEvent();
319
				e.stopEvent();
319
				ExifGrid.stopEditing();
320
				ExifGrid.stopEditing();
320
 
321
 
321
			}
322
			}
322
 
323
 
323
			// lors d'un double clic d'une cellule
324
			// lors d'un double clic d'une cellule
324
			public void onCellDblClick(GridPanel grid, int rowIndex,
325
			public void onCellDblClick(GridPanel grid, int rowIndex,
325
					int colIndex, EventObject e) {
326
					int colIndex, EventObject e) {
326
				// on empeche l'édition
327
				// on empeche l'édition
327
				e.stopEvent();
328
				e.stopEvent();
328
				ExifGrid.stopEditing();
329
				ExifGrid.stopEditing();
329
 
330
 
330
			}
331
			}
331
 
332
 
332
		});
333
		});
333
		
334
		
334
		panneauMiniListeObservation.addListener(new ContainerListenerAdapter() {
335
		panneauMiniListeObservation.addListener(new ContainerListenerAdapter() {
335
								
336
								
336
			public void onResize(BoxComponent component, int adjWidth, int adjHeight,
337
			public void onResize(BoxComponent component, int adjWidth, int adjHeight,
337
					int rawWidth, int rawHeight) {
338
					int rawWidth, int rawHeight) {
338
									
339
									
339
				timerRedimensionnement = new Timer() {
340
				timerRedimensionnement = new Timer() {
340
					public void run() {
341
					public void run() {
341
						
342
						
342
						int taille = 500;
343
						int taille = 500;
343
						
344
						
344
						if(Window.getClientHeight() > 800 ) {
345
						if(Window.getClientHeight() > 800 ) {
345
							taille = Window.getClientHeight() - 226;
346
							taille = Window.getClientHeight() - 226;
346
						}
347
						}
347
						panneauMiniListeObservation.setHeight(taille);
348
						panneauMiniListeObservation.setHeight(taille);
348
					}
349
					}
349
				};
350
				};
350
				
351
				
351
				timerRedimensionnement.schedule(300);
352
				timerRedimensionnement.schedule(300);
352
			}
353
			}
353
		});
354
		});
354
		
355
		
355
		panneauExifGrid.addListener(new ContainerListenerAdapter() {
356
		panneauExifGrid.addListener(new ContainerListenerAdapter() {
356
			
357
			
357
			public void onResize(BoxComponent component, int adjWidth, int adjHeight,
358
			public void onResize(BoxComponent component, int adjWidth, int adjHeight,
358
					int rawWidth, int rawHeight) {
359
					int rawWidth, int rawHeight) {
359
									
360
									
360
				timerRedimensionnement = new Timer() {
361
				timerRedimensionnement = new Timer() {
361
					public void run() {
362
					public void run() {
362
						
363
						
363
						int taille = 500;
364
						int taille = 500;
364
						
365
						
365
						taille = Window.getClientHeight() - 150;
366
						taille = Window.getClientHeight() - 150;
366
						
367
						
367
						ExifGrid.setHeight(taille);
368
						ExifGrid.setHeight(taille);
368
						panneauExifGrid.setHeight(taille);
369
						panneauExifGrid.setHeight(taille);
369
					}
370
					}
370
				};
371
				};
371
				
372
				
372
				timerRedimensionnement.schedule(300);
373
				timerRedimensionnement.schedule(300);
373
			}
374
			}
374
		});
375
		});
375
		
376
		
376
		panneauExifGrid.addListener(new ContainerListenerAdapter() {
377
		panneauExifGrid.addListener(new ContainerListenerAdapter() {
377
			
378
			
378
			public void onResize(BoxComponent component, int adjWidth, int adjHeight,
379
			public void onResize(BoxComponent component, int adjWidth, int adjHeight,
379
					int rawWidth, int rawHeight) {
380
					int rawWidth, int rawHeight) {
380
									
381
									
381
				timerRedimensionnement = new Timer() {
382
				timerRedimensionnement = new Timer() {
382
					public void run() {
383
					public void run() {
383
						
384
						
384
						int taille = 500;
385
						int taille = 500;
385
						
386
						
386
						taille = Window.getClientHeight() - 150;
387
						taille = Window.getClientHeight() - 150;
387
						
388
						
388
						IptcGrid.setHeight(taille);
389
						IptcGrid.setHeight(taille);
389
						panneauIptcGrid.setHeight(taille);
390
						panneauIptcGrid.setHeight(taille);
390
					}
391
					}
391
				};
392
				};
392
				
393
				
393
				timerRedimensionnement.schedule(300);
394
				timerRedimensionnement.schedule(300);
394
			}
395
			}
395
		});
396
		});
396
	}
397
	}
397
 
398
 
398
	/**
399
	/**
399
	 * Desactive visuellement ce panneau
400
	 * Desactive visuellement ce panneau
400
	 */
401
	 */
401
	public void desactiverPanneau() {
402
	public void desactiverPanneau() {
402
		panneauInfoGrid.setDisabled(true);
403
		panneauInfoGrid.setDisabled(true);
403
		panneauExifGrid.setDisabled(true);
404
		panneauExifGrid.setDisabled(true);
404
		panneauIptcGrid.setDisabled(true);
405
		panneauIptcGrid.setDisabled(true);
405
	}
406
	}
406
 
407
 
407
	/**
408
	/**
408
	 * Active visuellement ce panneau
409
	 * Active visuellement ce panneau
409
	 */
410
	 */
410
	public void activerPanneau() {
411
	public void activerPanneau() {
411
		panneauInfoGrid.setDisabled(false);
412
		panneauInfoGrid.setDisabled(false);
412
		panneauExifGrid.setDisabled(false);
413
		panneauExifGrid.setDisabled(false);
413
		panneauIptcGrid.setDisabled(false);
414
		panneauIptcGrid.setDisabled(false);
414
	}
415
	}
415
 
416
 
416
	/**
417
	/**
417
	 * Accesseur pour le médiateur
418
	 * Accesseur pour le médiateur
418
	 * 
419
	 * 
419
	 * @return le médiateur associé à la vue
420
	 * @return le médiateur associé à la vue
420
	 */
421
	 */
421
	public ImageMediateur getIMediateur() {
422
	public ImageMediateur getIMediateur() {
422
		return imediateur;
423
		return imediateur;
423
	}
424
	}
424
 
425
 
425
	/**
426
	/**
426
	 * Méthode héritée de l'interface rafraichissable
427
	 * Méthode héritée de l'interface rafraichissable
427
	 * 
428
	 * 
428
	 * @param nouvelleDonnees
429
	 * @param nouvelleDonnees
429
	 *            les nouvelles données
430
	 *            les nouvelles données
430
	 * @param repandreRafraichissement
431
	 * @param repandreRafraichissement
431
	 *            le booleen de notification de mise à jour
432
	 *            le booleen de notification de mise à jour
432
	 */
433
	 */
433
	public void rafraichir(Object nouvelleDonnees,
434
	public void rafraichir(Object nouvelleDonnees,
434
			boolean repandreRafraichissement) {
435
			boolean repandreRafraichissement) {
435
 
436
 
436
		// si on reçoit un tableau d'objets
437
		// si on reçoit un tableau d'objets
437
		if (nouvelleDonnees instanceof Object[]) {
438
		if (nouvelleDonnees instanceof Object[]) {
438
			
439
			
439
			final Object ressourceObject = nouvelleDonnees;
440
			final Object ressourceObject = nouvelleDonnees;
440
			
441
			
441
			if(!this.isRendered()) {
442
			if(!this.isRendered()) {
442
				addListener(new PanelListenerAdapter() {
443
				addListener(new PanelListenerAdapter() {
443
										
444
										
444
					public void onRender(Component component) {
445
					public void onRender(Component component) {
445
						rafraichir(ressourceObject, false);
446
						rafraichir(ressourceObject, false);
446
					}
447
					}
447
				});
448
				});
448
				
449
				
449
				return ;
450
				return ;
450
			}
451
			}
451
			
452
			
452
			// extrait infos, exifs et iptc
453
			// extrait infos, exifs et iptc
453
			Object meta[] = (Object[]) nouvelleDonnees;
454
			Object meta[] = (Object[]) nouvelleDonnees;
454
			String[][] exif = (String[][]) meta[0];
455
			String[][] exif = (String[][]) meta[0];
455
			String[][] iptc = (String[][]) meta[1];
456
			String[][] iptc = (String[][]) meta[1];
456
			final String[][] gen = (String[][]) meta[2];
457
			final String[][] gen = (String[][]) meta[2];
457
 
458
 
458
			NameValuePair[] exifSource = new NameValuePair[exif.length];
459
			NameValuePair[] exifSource = new NameValuePair[exif.length];
459
			NameValuePair[] iptcSource = new NameValuePair[iptc.length];
460
			NameValuePair[] iptcSource = new NameValuePair[iptc.length];
460
 
461
 
461
			int maxLength;
462
			int maxLength;
462
			if (exif.length <= iptc.length) {
463
			if (exif.length <= iptc.length) {
463
				maxLength = iptc.length;
464
				maxLength = iptc.length;
464
			} else {
465
			} else {
465
				maxLength = exif.length;
466
				maxLength = exif.length;
466
			}
467
			}
467
 
468
 
468
			for (int i = 0; i < maxLength; i++) {
469
			for (int i = 0; i < maxLength; i++) {
469
				if (i < exif.length && !exif[i][0].equals("null")) {
470
				if (i < exif.length && !exif[i][0].equals("null")) {
470
					exifSource[i] = new NameValuePair(exif[i][0], exif[i][1]);
471
					exifSource[i] = new NameValuePair(exif[i][0], exif[i][1]);
471
				}
472
				}
472
 
473
 
473
				if (i < iptc.length && !iptc[i][0].equals("null")) {
474
				if (i < iptc.length && !iptc[i][0].equals("null")) {
474
					iptcSource[i] = new NameValuePair(iptc[i][0], iptc[i][1]);
475
					iptcSource[i] = new NameValuePair(iptc[i][0], iptc[i][1]);
475
				}
476
				}
476
			}
477
			}
477
 
478
 
478
			// on met à jour les champs avec la bonne valeur
479
			// on met à jour les champs avec la bonne valeur
479
			commentaireGeneral.setValue(gen[0][1]);
480
			commentaireGeneral.setValue(gen[0][1]);
480
			dateImage.setValue(gen[1][1]);
481
			dateImage.setValue(gen[1][1]);
481
	
482
	
482
			// et on met à jour les données pour l'affichage
483
			// et on met à jour les données pour l'affichage
483
			ExifGrid.setSource(exifSource);
484
			ExifGrid.setSource(exifSource);
484
			IptcGrid.setSource(iptcSource);
485
			IptcGrid.setSource(iptcSource);
485
 
486
 
486
		}
487
		}
487
	}
488
	}
488
 
489
 
489
	/**
490
	/**
490
	 * Accesseur pour le panneau des mots clés
491
	 * Accesseur pour le panneau des mots clés
491
	 * 
492
	 * 
492
	 * @return the panneauMotsCles
493
	 * @return the panneauMotsCles
493
	 */
494
	 */
494
	public ArbreMotsClesVue getPanneauMotsCles() {
495
	public ArbreMotsClesVue getPanneauMotsCles() {
495
		return panneauMotsCles;
496
		return panneauMotsCles;
496
	}
497
	}
497
 
498
 
498
	public BarreNotationVue getNoteVue() {
499
	public BarreNotationVue getNoteVue() {
499
		return noteVue;
500
		return noteVue;
500
	}
501
	}
501
	
502
	
502
	public MiniListeObservationVue getMiniListeObservation()
503
	public MiniListeObservationVue getMiniListeObservation()
503
	{
504
	{
504
		return miniListeObservation ;
505
		return miniListeObservation ;
505
	}
506
	}
506
	
507
	
507
	public RechercheFiltreTaxonVue getRechercheFiltreTaxonVue()
508
	public RechercheFiltreTaxonVue getRechercheFiltreTaxonVue()
508
	{
509
	{
509
		return rechercheFiltreTaxonVue ;
510
		return rechercheFiltreTaxonVue ;
510
	}
511
	}
511
 
512
 
512
	public void redimensionner() {
513
	public void redimensionner() {
513
		
514
		
514
		if(panneauMiniListeObservation.isCreated() && panneauMiniListeObservation.isVisible()) {
515
		if(panneauMiniListeObservation.isCreated() && panneauMiniListeObservation.isVisible()) {
515
			panneauMiniListeObservation.doLayout();
516
			panneauMiniListeObservation.doLayout();
516
			//panneauMiniListeObservation.show();
517
			//panneauMiniListeObservation.show();
517
			miniListeObservation.redimensionner();
518
			miniListeObservation.redimensionner();
518
		}
519
		}
519
		
520
		
520
	}
521
	}
521
}
522
}