Subversion Repositories eFlore/Applications.cel

Rev

Rev 324 | Rev 638 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 324 Rev 408
Line 2... Line 2...
2
 
2
 
3
 
3
 
Line -... Line 4...
-
 
4
import org.tela_botanica.client.image.ImageMediateur;
4
import org.tela_botanica.client.image.ImageMediateur;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
6
 
-
 
7
import com.google.gwt.core.client.GWT;
-
 
8
import com.google.gwt.core.client.JavaScriptObject;
-
 
9
import com.google.gwt.event.dom.client.ClickEvent;
-
 
10
import com.google.gwt.event.dom.client.ClickHandler;
-
 
11
import com.google.gwt.event.dom.client.LoadEvent;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import com.google.gwt.event.dom.client.LoadHandler;
6
 
13
import com.google.gwt.event.dom.client.MouseWheelEvent;
7
import com.google.gwt.core.client.JavaScriptObject;
14
import com.google.gwt.event.dom.client.MouseWheelHandler;
8
import com.google.gwt.user.client.Event;
15
import com.google.gwt.user.client.Event;
9
import com.google.gwt.user.client.Timer;
16
import com.google.gwt.user.client.Timer;
Line 94... Line 101...
94
 
101
 
95
	/**
102
	/**
96
	 * Booleen d'initalisation général
103
	 * Booleen d'initalisation général
97
	 */
104
	 */
-
 
105
	private boolean initialise = false;
-
 
106
	
Line 98... Line 107...
98
	private boolean initialise = false;
107
	private Panel infosTaxon = new Panel();
99
 
108
 
100
	/**
109
	/**
101
	 * Booleen d'initalisation du conteneur d'image
110
	 * Booleen d'initalisation du conteneur d'image
Line 102... Line 111...
102
	 */
111
	 */
103
	private boolean conteneurInitialise = false;
-
 
104
	
-
 
105
	private ToolTip tp = new ToolTip("<div class=\"x-tooltip-help\"> Double cliquez pour revenir à la vue précédente, utilisez la roulette ou les boutons fléchés pour faire défiler les images </div>") ;
-
 
106
 
-
 
107
	/**
-
 
108
	 * true pour animer les transitions des animations
-
 
109
	 */
-
 
110
	private boolean animerTransition = false;
-
 
111
	
-
 
112
	/**
-
 
Line 113... Line 112...
113
	 * duree des animation
112
	private boolean conteneurInitialise = false;
114
	 */
113
	
115
	private float dureeAnimation = (float) 0.15 ;
114
	private ToolTip tp = new ToolTip("<div class=\"x-tooltip-help\"> Double cliquez pour revenir à la vue précédente, utilisez la roulette ou les boutons fléchés pour faire défiler les images </div>") ;
116
	
115
	
Line 117... Line 116...
117
	/**.
116
	/**.
Line 118... Line 117...
118
	 * boolean de gestion du double clic
117
	 * boolean de gestion du double clic
119
	 */
-
 
120
	private boolean enClic = false;
-
 
121
	
-
 
122
	private ToolbarButton modeZoom = null;
-
 
123
	
-
 
124
	private ToolbarTextItem valeurZoom = new ToolbarTextItem("x 1");
-
 
125
	
-
 
126
	private int sourisX = 0;
-
 
127
	
-
 
128
	private int sourisY = 0;
-
 
129
	
-
 
130
	private int sourisXFin = 0;
-
 
131
	
-
 
132
	private int sourisYFin = 0;
-
 
133
	
-
 
134
	private float niveauZoom = 1;
-
 
Line 135... Line 118...
135
	
118
	 */
Line 136... Line 119...
136
	private float pasZoom = new Float(0.1);
119
	private boolean enClic = false;
137
 
120
	
Line 195... Line 178...
195
		tb.addButton(modeZoom);
178
		tb.addButton(modeZoom);
196
		tb.addItem(valeurZoom);
179
		tb.addItem(valeurZoom);
Line 197... Line 180...
197
		
180
		
Line -... Line 181...
-
 
181
		//setTopToolbar(tb);
-
 
182
		
-
 
183
		infosTaxon = new Panel();
-
 
184
		infosTaxon.setHeader(false);
-
 
185
		//infosTaxon.setBorder(false);
198
		//setTopToolbar(tb);
186
		infosTaxon.setHeight("30px");
199
		
187
		
200
		this.add(prev, new BorderLayoutData(RegionPosition.WEST));
188
		this.add(prev, new BorderLayoutData(RegionPosition.WEST));
-
 
189
		this.add(imageConteneur, new BorderLayoutData(RegionPosition.CENTER));
Line 201... Line 190...
201
		this.add(imageConteneur, new BorderLayoutData(RegionPosition.CENTER));
190
		this.add(suiv, new BorderLayoutData(RegionPosition.EAST));
202
		this.add(suiv, new BorderLayoutData(RegionPosition.EAST));
191
		this.add(infosTaxon, new BorderLayoutData(RegionPosition.SOUTH));
Line 203... Line 192...
203
 
192
 
Line 230... Line 219...
230
 
219
 
231
		//niveauZoom = 1;
220
		//niveauZoom = 1;
232
		// si on reçoit une string
221
		// si on reçoit une string
233
		if (nouvelleDonnees instanceof String[] && initialise
222
		if (nouvelleDonnees instanceof String[] && initialise
-
 
223
				&& conteneurInitialise) {
234
				&& conteneurInitialise) {
224
			
-
 
225
			String[] infos = (String[]) nouvelleDonnees;
235
			String[] infos = (String[]) nouvelleDonnees;
226
			
236
			// c'est l'url de l'image qu'on associe à la vue
227
			// c'est l'url de l'image qu'on associe à la vue
237
			if (infos[0] != null && infos[1] != null && infos[2] != null && infos[3] != null) {
228
			if (infos[0] != null && infos[1] != null && infos[2] != null && infos[3] != null) {
238
				getImage().setUrl(infos[0]);
229
				getImage().setUrl(infos[0]);
239
				int x = Integer.parseInt(infos[1]);
230
				int x = Integer.parseInt(infos[1]);
Line 240... Line 231...
240
				int y = Integer.parseInt(infos[2]);
231
				int y = Integer.parseInt(infos[2]);
Line 241... Line 232...
241
 
232
 
-
 
233
				setTailleImage(x, y);
-
 
234
				
-
 
235
				setIdImage(infos[3]) ;
-
 
236
				
-
 
237
				String infosTaxon = "" ;
-
 
238
				
-
 
239
				if(infos.length == 5 && infos[4] != null)  {
-
 
240
					infosTaxon = infos[4]; 
Line 242... Line 241...
242
				setTailleImage(x, y);
241
				}
243
				
242
				
244
				setIdImage(infos[3]) ;
243
				setInfosTaxon(infosTaxon);
245
 
244
 
246
				//verifierEtRetaillerImage();
245
				verifierEtRetaillerImage();
247
			}
246
			}
Line 284... Line 283...
284
 
283
 
285
	/**
284
	/**
286
	 * Ajoute les listeners pour la gestions d'évènement
285
	 * Ajoute les listeners pour la gestions d'évènement
287
	 */
286
	 */
288
	public void ajouterListeners() {
-
 
289
		
-
 
290
		modeZoom.addListener(new ButtonListenerAdapter() {
-
 
291
 
-
 
292
			public void onClick(Button button, EventObject e) {
-
 
293
				// TODO Auto-generated method stub
-
 
294
				if(modeZoom.isPressed()) {
-
 
295
					modeZoom.toggle(false);
-
 
296
				} else {
-
 
297
					modeZoom.toggle(true);
-
 
298
				}
-
 
299
			}
-
 
300
			
-
 
301
			public void onToggle(Button button, boolean pressed) {
-
 
302
				if(pressed) {
-
 
303
					scroll = true;
-
 
304
					image.addStyleName("img-curseur-depl");
-
 
305
				} else  {
-
 
306
					scroll = false;
-
 
307
					image.removeStyleName("img-curseur-depl");
-
 
308
					niveauZoom = 1;
-
 
309
					verifierEtRetaillerImage();
-
 
310
					Ext.get(image.getElement()).center(imageConteneur.getElement());
-
 
311
				}
-
 
312
			}
-
 
313
		});
-
 
314
		
-
 
315
		image.addLoadListener(new LoadListener() {
-
 
316
 
-
 
317
			public void onError(Widget sender) {
-
 
318
				// TODO Auto-generated method stub
-
 
319
			}
-
 
320
 
-
 
Line 321... Line -...
321
			public void onLoad(Widget sender) {
-
 
322
				
-
 
323
				/*int max = Math.min(imageConteneur.getHeight(), imageConteneur.getWidth());
-
 
324
				int[] tailleImage = calculerDimensions(getTailleImage(), max, max);
-
 
325
				ExtElement imgElement = Ext.get(image.getElement());
287
	public void ajouterListeners() {
326
				if(animerTransition) {
-
 
327
					AnimationConfig a = new AnimationConfig() ;
-
 
328
					a.setDuration((float) dureeAnimation);
-
 
329
					imgElement.setHeight(tailleImage[1], a);
-
 
330
					imgElement.setWidth(tailleImage[0], a);
-
 
331
				} else {
-
 
332
					imgElement.setHeight(tailleImage[1], false);
-
 
333
					imgElement.setWidth(tailleImage[0], false);
-
 
334
				}*/
-
 
335
				verifierEtRetaillerImage();
-
 
336
				Ext.get(image.getElement()).center(imageConteneur.getElement());
-
 
Line 337... Line -...
337
				demasquerChargement();
-
 
338
			}
-
 
339
			
-
 
340
		});
-
 
341
		
288
				
342
		image.addClickListener(new ClickListener() {
289
		image.addClickHandler(new ClickHandler() {
343
 
290
			
344
			public void onClick(Widget sender) {
291
			public void onClick(ClickEvent event) {
345
				if(!scroll) {
292
				if(!scroll) {
346
					if(enClic) {
293
					if(enClic) {
Line 355... Line 302...
355
						enClic = true;
302
						enClic = true;
356
						t.schedule(800);
303
						t.schedule(800);
357
					}
304
					}
358
				}
305
				}
359
			}
306
			}
360
			
-
 
361
		});
307
		});
Line 362... Line 308...
362
		
308
		
-
 
309
		image.addLoadHandler(new LoadHandler() {
-
 
310
			
Line 363... Line -...
363
		image.addMouseWheelListener(new MouseWheelListener() {
-
 
364
 
-
 
365
			public void onMouseWheel(Widget sender, MouseWheelVelocity velocity) {
311
			public void onLoad(LoadEvent event) {
366
				
312
 
367
				if(velocity.getDeltaY() > 0) {
-
 
368
					if(scroll) {
-
 
369
						zoomOut();
313
				verifierEtRetaillerImage();
370
					} else {
-
 
371
						suiv.click();
-
 
372
					}
-
 
373
				} else {
-
 
374
					if(scroll) {
-
 
375
						zoomIn();
-
 
376
					} else {
-
 
377
						prev.click();
-
 
378
					}
314
				Ext.get(image.getElement()).center(imageConteneur.getElement());
379
				}
-
 
380
			}
315
				demasquerChargement();
Line 381... Line 316...
381
			
316
			}
382
		});
-
 
383
		
-
 
384
		image.addMouseListener(new MouseListener() {
-
 
385
 
-
 
386
			public void onMouseDown(Widget sender, int x, int y) {
-
 
387
				if(scroll) {
-
 
388
					Event.getCurrentEvent().preventDefault();
-
 
389
					scroll = true;
-
 
390
					sourisX = x;
-
 
391
					sourisY = y;
-
 
392
					image.addStyleName("img-curseur-depl");
-
 
393
				}
-
 
394
			}
-
 
395
 
-
 
396
			public void onMouseEnter(Widget sender) {
-
 
397
				// TODO Auto-generated method stub
-
 
398
				
-
 
399
			}
-
 
400
 
-
 
401
			public void onMouseLeave(Widget sender) {
-
 
402
				// TODO Auto-generated method stub
317
		});
403
				
318
		
404
			}
-
 
405
 
-
 
406
			public void onMouseMove(Widget sender, int x, int y) {
-
 
407
				
-
 
408
				sourisXFin = x;
-
 
409
				sourisYFin = y;
-
 
410
				Event.getCurrentEvent().preventDefault();
-
 
Line 411... Line 319...
411
			}
319
		image.addMouseWheelHandler(new MouseWheelHandler() {
412
 
-
 
413
			public void onMouseUp(Widget sender, int x, int y) {
-
 
414
				
320
			
415
				if(scroll) {
321
			public void onMouseWheel(MouseWheelEvent event) {
416
					Event.getCurrentEvent().preventDefault();
-
 
417
					
-
 
418
					if(sourisX - sourisXFin > 0) {
-
 
419
						Ext.get(image.getElement()).move(Direction.LEFT, sourisX - sourisXFin, false);
-
 
420
					}
322
				
421
					
-
 
422
					if(sourisXFin - sourisX > 0) {
323
				if(event.isNorth()) {
423
						Ext.get(image.getElement()).move(Direction.RIGHT, sourisXFin - sourisX, false);
324
					masquerChargement();
424
					}
-
 
425
					
-
 
426
					if(sourisY - sourisYFin > 0) {
-
 
427
						Ext.get(image.getElement()).move(Direction.UP, sourisY - sourisYFin, false);
-
 
428
					}
-
 
429
					
325
					getIMediateur().clicBoutonZoomImage("suiv");
430
					if(sourisYFin - sourisY > 0) {
326
				} else {
431
						Ext.get(image.getElement()).move(Direction.DOWN, sourisYFin - sourisY, false);
-
 
432
					}
327
					masquerChargement();
Line 433... Line 328...
433
				}
328
					getIMediateur().clicBoutonZoomImage("prev");
434
			}
329
				}			
Line 435... Line 330...
435
			
330
			}
436
		});
331
		});
437
		
332
		
438
		// gestion du clic sur le bouton précedent
333
		// gestion du clic sur le bouton précedent
439
		prev.addClickListener(new ClickListener() {
334
		prev.addClickHandler(new ClickHandler() {
440
 
335
 
441
			// en cas de clic
-
 
442
			public void onClick(Widget sender) {
336
			// en cas de clic
Line 443... Line 337...
443
				// on notifie le médiateur
337
			public void onClick(ClickEvent event) {
444
				masquerChargement();
338
				// on notifie le médiateur
Line 445... Line 339...
445
				getIMediateur().clicBoutonZoomImage("prev");
339
				masquerChargement();
446
			}
340
				getIMediateur().clicBoutonZoomImage("prev");
447
 
341
			}
448
		});
342
		});
449
 
343
 
450
		// gestion du clic sur le bouton suivant
344
		// gestion du clic sur le bouton suivant
Line 486... Line 380...
486
	/**
380
	/**
487
	 * Verifie si l'image est plus grande que le conteneur et la retaille le cas
381
	 * Verifie si l'image est plus grande que le conteneur et la retaille le cas
488
	 * echeant
382
	 * echeant
489
	 */
383
	 */
490
	public void verifierEtRetaillerImage() {
384
	public void verifierEtRetaillerImage() {
-
 
385
		
491
		// si l'image est nulle
386
		// si l'image est nulle
492
		if (image == null) {
387
		if (image == null) {
493
			// on ne fait rien
388
			// on ne fait rien
494
			return;
389
			return;
495
		}
390
		}
496
 
391
		
497
		// on prend la taille originale de l'image
-
 
498
		/*int originalX = getTailleImage()[0];
-
 
499
		int originalY = getTailleImage()[1];
-
 
500
 
-
 
501
		// on la transforme en float (la division entre entier donne de curieux
-
 
502
		// résultats)
-
 
503
		float fOriginalX = (new Float(originalX)).floatValue();
-
 
504
		float fOriginalY = (new Float(originalY)).floatValue();
-
 
505
 
-
 
506
		// et on fait le rapport longueur sur hauteur (pour connaitre le ratio)
-
 
507
		float rapportTaille = fOriginalX / fOriginalY;
-
 
508
 
-
 
509
		// la nouvelle taille est pour le moment égale à l'ancienne
-
 
510
		int nouvelleTailleX = originalX;
-
 
511
		int nouvelleTailleY = originalY;
-
 
512
 
-
 
513
		// on prend la taille du conteneur
-
 
514
		int tailleConteneurX = imageConteneur.getWidth();
-
 
515
		int tailleConteneurY = imageConteneur.getHeight();*/
-
 
516
 
-
 
517
		// si celle-ci est égale à 0 (conteneur mal initialisé)
-
 
518
		/*
-
 
519
		 * if(imageConteneur.getHeight() == 0 && tailleConteneurX == 0) { // on
-
 
520
		 * essaie de la calculer en fonction de la taille du parent et des
-
 
521
		 * frères tailleConteneurY = this.getHeight() ; tailleConteneurX =
-
 
522
		 * this.getWidth() - prev.getOffsetWidth() * 2 ;
-
 
523
		 *  }
-
 
524
		 */
-
 
525
/*
-
 
526
		// si l'image ne rentre pas telle quelle (longueur ou hauteur trop
-
 
527
		// grande)
-
 
528
		if (originalY > tailleConteneurY || originalX > tailleConteneurX) {
-
 
529
			// si la longueur de l'image est la plus grande des deux
-
 
530
			if (originalX > originalY) {
-
 
531
				// on prend la longueur comme taille de référence, qu'on met à
-
 
532
				// la longueur du conteneur
-
 
533
				nouvelleTailleX = tailleConteneurX;
-
 
534
				// et on recalcule la hauteur, par rapport à la nouvelle
-
 
535
				// longueur, en gardant le format de 'limage
-
 
536
				nouvelleTailleY = (int) Math.floor(nouvelleTailleX * 1
-
 
537
						/ rapportTaille);
-
 
538
			} else {
-
 
539
				// si la hauteur est la plus grande, on fait le même genre
-
 
540
				// d'opération en prenant la hauteur comme référence
-
 
541
				nouvelleTailleY = tailleConteneurY;
-
 
542
				nouvelleTailleX = (int) Math.floor(nouvelleTailleY
-
 
543
						* rapportTaille);
-
 
544
			}
-
 
545
		}
-
 
546
*/
-
 
547
		// on modifie enfin la taille de l'image pour qu'elle soit affichée
392
		// on modifie enfin la taille de l'image pour qu'elle soit affichée
548
		int max = Math.min(imageConteneur.getHeight(), imageConteneur.getWidth());
393
		int max = Math.min(imageConteneur.getHeight(), imageConteneur.getWidth());
Line 549... Line 394...
549
		
394
		
550
		int[] tailleImage = new int[2];
-
 
551
		ExtElement imgElement = Ext.get(image.getElement());
-
 
552
		
-
 
553
		if(max == imageConteneur.getHeight()) {
-
 
554
			//tailleImage[0] = getTailleImage()[0];
-
 
555
			//tailleImage[1] = max;
-
 
556
			imgElement.setHeight(max, false);
-
 
557
		} else {
-
 
558
			//tailleImage[1] = getTailleImage()[0];
-
 
559
			//tailleImage[0] = max;
-
 
560
			imgElement.setWidth(max, false);
-
 
Line 561... Line -...
561
		}
-
 
562
		
-
 
563
		//int[] tailleImage = calculerDimensions(getTailleImage(), max, max);
395
		int[] tailleImage = new int[2];
564
		//imgElement.
-
 
565
		/*if(animerTransition) {
-
 
566
			AnimationConfig a = new AnimationConfig() ;
396
		
567
			a.setDuration((float) dureeAnimation);
397
		if(Ext.isIE()) {
568
			imgElement.setHeight(tailleImage[1], a);
398
			image.setHeight(calculerDimensions(getTailleImage(),max,max)[1]+"px");
569
			imgElement.setWidth(tailleImage[0], a);
-
 
570
		} else {
-
 
571
			imgElement.setHeight(tailleImage[1], false);
-
 
572
			imgElement.setWidth(tailleImage[0], false);
-
 
573
		}*/
-
 
574
		
-
 
Line -... Line 399...
-
 
399
			image.setWidth(calculerDimensions(getTailleImage(),max,max)[0]+"px");
-
 
400
		} else {
-
 
401
		
575
		String strZoom = ""+niveauZoom+"";
402
			if(max == imageConteneur.getHeight()) {
-
 
403
				tailleImage[0] = getTailleImage()[0];
-
 
404
				tailleImage[1] = max;			
-
 
405
				image.setHeight(max+"px");
-
 
406
	
-
 
407
			} else {
-
 
408
				tailleImage[1] = getTailleImage()[0];
-
 
409
				tailleImage[0] = max;
576
		strZoom = strZoom.substring(0,3);
410
				image.setWidth(max+"px");
Line 577... Line 411...
577
		
411
			}
Line 578... Line 412...
578
		valeurZoom.setText("x "+strZoom);
412
		}
Line 593... Line 427...
593
            float rapport = tailleXYf[0]/tailleXYf[1] ;
427
            float rapport = tailleXYf[0]/tailleXYf[1] ;
594
            XYresize[1] = tailleOr ;
428
            XYresize[1] = tailleOr ;
595
            XYresize[0] = tailleOr*rapport ;
429
            XYresize[0] = tailleOr*rapport ;
596
        }
430
        }
Line 597... Line 431...
597
        
431
        
Line 598... Line 432...
598
        int[] res = {(int)Math.round(XYresize[0]*niveauZoom),(int) Math.round(XYresize[1]*niveauZoom)} ;
432
        int[] res = {(int)Math.round(XYresize[0]),(int) Math.round(XYresize[1])} ;
599
        
433
        
Line 600... Line 434...
600
        return res;
434
        return res;
Line 694... Line 528...
694
	 */
528
	 */
695
	public void setIdImage(String id)
529
	public void setIdImage(String id)
696
	{
530
	{
697
		idImage = id ;
531
		idImage = id ;
698
	}
532
	}
-
 
533
	
-
 
534
	public void setInfosTaxon(String nomTaxon) {
-
 
535
	
-
 
536
		if(nomTaxon != null && !nomTaxon.equals("")) {
-
 
537
			nomTaxon = getNomsObservationsFormatees(nomTaxon);
-
 
538
		}
-
 
539
		
-
 
540
		infosTaxon.setHtml("<div id='infos_taxon'><span class='texte_info_taxon'>"+nomTaxon+"</span></div>");
-
 
541
		infosTaxon.doLayout();
-
 
542
	}
Line 699... Line 543...
699
 
543
 
700
	/**
544
	/**
701
	 * renvoie la taille originale de l'image
545
	 * renvoie la taille originale de l'image
702
	 * 
546
	 * 
Line 706... Line 550...
706
		int[] taille = { imageHeight, imageWidth };
550
		int[] taille = { imageHeight, imageWidth };
Line 707... Line 551...
707
 
551
 
708
		return taille;
552
		return taille;
Line -... Line 553...
-
 
553
	}
-
 
554
	
-
 
555
	public boolean estPortrait() {
-
 
556
		return imageHeight > imageWidth;
-
 
557
	}
-
 
558
	
-
 
559
	public boolean estPaysage() {
-
 
560
		return !estPortrait();
709
	}
561
	}
710
	
562
	
711
	/**
563
	/**
712
	 * Accesseur pour le conteneur de l'image
564
	 * Accesseur pour le conteneur de l'image
713
	 * @return le conteur de l'image
565
	 * @return le conteur de l'image
Line 714... Line 566...
714
	 */
566
	 */
Line 715... Line 567...
715
	public Panel getImageConteneur() {
567
	public Panel getImageConteneur() {
Line 716... Line 568...
716
 
568
 
-
 
569
		return imageConteneur;
717
		return imageConteneur;
570
 
-
 
571
	}
718
 
572
	
-
 
573
	private String getNomsObservationsFormatees(String nomObs) {
719
	}
574
		
-
 
575
		String htmlInfobulle = "";
-
 
576
		
720
	
577
		String[][] obs = getObservationsAssociees(nomObs);
721
	private void zoomOut() {
578
		
722
		if(niveauZoom >= minZoom) {
-
 
723
			niveauZoom -= pasZoom;
-
 
724
			if(niveauZoom <= minZoom) {
579
		for(int i = 0; i < obs.length; i++) {
-
 
580
						
-
 
581
			if(obs[i].length == 3 && obs[i][1] != null && !obs[i][1].equals("")) {
-
 
582
				htmlInfobulle += ", "+obs[i][1];
-
 
583
			}
725
				niveauZoom = minZoom;
584
		}
726
			}
585
		
727
			verifierEtRetaillerImage();
586
		htmlInfobulle = htmlInfobulle.replaceFirst(", ", "");
-
 
587
		
728
			gererDecalage(false);
588
		return htmlInfobulle;
729
		}
589
	}
-
 
590
	
-
 
591
	private String[][] getObservationsAssociees(String nomObs) {
730
	}
592
		
731
 
593
		if(nomObs.trim().equals("")) {
732
	private void zoomIn() {
594
			return new String[0][0];
733
		if(niveauZoom < maxZoom ) { 
595
		}
-
 
596
		
734
			niveauZoom += pasZoom;
597
		String[] obsTab = nomObs.split(";;");
-
 
598
		String[][] obsAnalysees = new String[obsTab.length][3];
735
			if(niveauZoom >= maxZoom) {
599
		
-
 
600
		for(int i = 0; i < obsTab.length; i++) {
-
 
601
			
736
				niveauZoom = maxZoom;
602
			obsAnalysees[i] = obsTab[i].split("#");
Line 737... Line 603...
737
			}
603
			
Line -... Line 604...
-
 
604
		}
738
			verifierEtRetaillerImage();
605
		
Line 739... Line 606...
739
			gererDecalage(true);
606
		return obsAnalysees;
740
		}
607
	}
741
	}
608
	
Line 742... Line -...
742
	
-
 
743
	private void gererDecalage(boolean in) {
-
 
744
		
-
 
745
		float nZoom = niveauZoom;
-
 
746
		
-
 
747
		if(niveauZoom < 1) {
-
 
748
			nZoom = 1/niveauZoom;
-
 
749
		}
-
 
750
		
-
 
751
		if(!in) {
-
 
752
			int diffX = imageConteneur.getWidth()/2 - sourisX;
-
 
753
			int diffY = imageConteneur.getHeight()/2 - sourisY;
-
 
754
			
-
 
755
			if(diffX > 0) {
-
 
756
				Ext.get(image.getElement()).move(Direction.RIGHT, (int)((diffX/maxZoom)/nZoom), false);
-
 
757
			}
-
 
758
			
-
 
759
			if(-diffX > 0) {
-
 
760
				Ext.get(image.getElement()).move(Direction.LEFT, (int)(-(diffX/maxZoom)/nZoom), false);
-
 
761
			}
-
 
762
			
609
	private boolean[] estAssocieeTransmise(String nomObs) {
763
			if(diffY > 0) {
-
 
764
				Ext.get(image.getElement()).move(Direction.DOWN, (int)((diffY/maxZoom)/nZoom), false);
-
 
765
			}
-
 
766
			
-
 
767
			if(-diffY > 0) {
-
 
768
				Ext.get(image.getElement()).move(Direction.UP, (int)(-(diffY/maxZoom)/nZoom), false);
-
 
769
			}
-
 
770
		} else {
-
 
771
			int diffX = imageConteneur.getWidth()/2;
-
 
772
			int diffY = imageConteneur.getHeight()/2;
-
 
773
			if(diffX > 0) {
-
 
774
				Ext.get(image.getElement()).move(Direction.LEFT, (int)((diffX/maxZoom)/nZoom), false);
-
 
Line 775... Line 610...
775
			}
610
		
776
			
611
		String[][] obs = getObservationsAssociees(nomObs);
777
			if(-diffX > 0) {
612
		boolean[] associeesTranmises = {false, false};
778
				Ext.get(image.getElement()).move(Direction.RIGHT, (int)((-diffX/maxZoom)/nZoom), false);
613
		
-
 
614
		if(obs.length > 0) {
-
 
615
			associeesTranmises[0] = true;
779
			}
616
		}
780
			
617