Subversion Repositories eFlore/Applications.cel

Rev

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

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