Subversion Repositories eFlore/Applications.cel

Rev

Rev 595 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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